mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-23 22:23:00 +00:00
fix a bug where we had an implicit assumption that the
result instruction operand numbering matched the result pattern. Fixing this allows us to move the xchg/test aliases to the .td file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118334 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1171,13 +1171,14 @@ void AsmMatcherInfo::BuildAliasOperandReference(MatchableInfo *II,
|
||||
StringRef OperandName,
|
||||
MatchableInfo::AsmOperand &Op) {
|
||||
const CodeGenInstAlias &CGA = *II->DefRec.get<const CodeGenInstAlias*>();
|
||||
|
||||
|
||||
// Set up the operand class.
|
||||
for (unsigned i = 0, e = CGA.ResultOperands.size(); i != e; ++i)
|
||||
if (CGA.ResultOperands[i].Name == OperandName) {
|
||||
// It's safe to go with the first one we find, because CodeGenInstAlias
|
||||
// validates that all operands with the same name have the same record.
|
||||
Op.Class = getOperandClass(CGA.ResultInst->Operands[i]);
|
||||
unsigned ResultIdx =CGA.getResultInstOperandIndexForResultOperandIndex(i);
|
||||
Op.Class = getOperandClass(CGA.ResultInst->Operands[ResultIdx]);
|
||||
Op.SrcOpName = OperandName;
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user