diff options
author | Chris Lattner <sabre@nondot.org> | 2006-01-30 23:00:08 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-01-30 23:00:08 +0000 |
commit | f2b67cff040d1eb3229f7929d0ec7a5e016a7a57 (patch) | |
tree | 97d82e50cb415968bb301fbfa86f41d1331023ed /lib/CodeGen/AsmPrinter.cpp | |
parent | 73e142f2b6a3b5223de2d557d646f319ca8168cf (diff) |
Print the most trivial inline asms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25822 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp index 83ecfe24c3..ab0465df1c 100644 --- a/lib/CodeGen/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter.cpp @@ -456,5 +456,16 @@ void AsmPrinter::EmitGlobalConstant(const Constant *CV) { /// printInlineAsm - This method formats and prints the specified machine /// instruction that is an inline asm. void AsmPrinter::printInlineAsm(const MachineInstr *MI) const { - O << "INLINE ASM NOT EMITTED YET!\n"; + unsigned NumOperands = MI->getNumOperands(); + + // Count the number of register definitions. + unsigned NumDefs = 0; + for (; MI->getOperand(NumDefs).isDef(); ++NumDefs) + assert(NumDefs != NumOperands-1 && "No asm string?"); + + assert(MI->getOperand(NumDefs).isExternalSymbol() && "No asm string?"); + + const char *AsmStr = MI->getOperand(NumDefs).getSymbolName(); + + O << AsmStr << "\n"; } |