Record all of the expanded registers in the DAG and machine instr, fixing

several bugs in inline asm expanded operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26332 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2006-02-23 19:21:04 +00:00
parent f4afdd9f41
commit c3a9f8d31c
3 changed files with 137 additions and 79 deletions
+12 -5
View File
@@ -569,19 +569,26 @@ void AsmPrinter::printInlineAsm(const MachineInstr *MI) const {
exit(1);
}
char ExtraCode = 0; // FIXME:
// Okay, we finally have an operand number. Ask the target to print this
// Okay, we finally have a value number. Ask the target to print this
// operand!
if (CurVariant == -1 || CurVariant == AsmPrinterVariant)
if (CurVariant == -1 || CurVariant == AsmPrinterVariant) {
unsigned OpNo = 1;
// Scan to find the machine operand number for the operand.
for (; Val; --Val)
OpNo += MI->getOperand(OpNo).getImmedValue()+1;
++OpNo; // Skip over the ID number.
if (const_cast<AsmPrinter*>(this)->
PrintAsmOperand(MI, Val+1, AsmPrinterVariant,
PrintAsmOperand(MI, OpNo, AsmPrinterVariant,
Modifier[0] ? Modifier : 0)) {
std::cerr << "Invalid operand found in inline asm: '"
<< AsmStr << "'\n";
MI->dump();
exit(1);
}
}
break;
}
case '{':