diff options
| author | Chris Lattner <sabre@nondot.org> | 2006-02-23 19:21:04 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2006-02-23 19:21:04 +0000 |
| commit | c3a9f8d31ce93ba384bd2bbdd55c757b06600a15 (patch) | |
| tree | ae77d3434862aae9fe98efb1e164eab322ab5742 /lib/CodeGen/AsmPrinter.cpp | |
| parent | f4afdd9f413c472e5785355f0d69847eaf729192 (diff) | |
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
Diffstat (limited to 'lib/CodeGen/AsmPrinter.cpp')
| -rw-r--r-- | lib/CodeGen/AsmPrinter.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp index af5346cb53..9450576a9a 100644 --- a/lib/CodeGen/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter.cpp @@ -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 '{': |
