summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-01-30 23:00:08 +0000
committerChris Lattner <sabre@nondot.org>2006-01-30 23:00:08 +0000
commit57ecb561c607e41bf40e96bdfa97f3dcf33bac02 (patch)
treeecc3dde88b1c22475871eb0c13085212e12cfce0 /llvm/lib/CodeGen/AsmPrinter.cpp
parentf263a23735bb8027035ce4920f7faa5c7d8eff1d (diff)
downloadbcm5719-llvm-57ecb561c607e41bf40e96bdfa97f3dcf33bac02.tar.gz
bcm5719-llvm-57ecb561c607e41bf40e96bdfa97f3dcf33bac02.zip
Print the most trivial inline asms.
llvm-svn: 25822
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter.cpp
index 83ecfe24c30..ab0465df1c3 100644
--- a/llvm/lib/CodeGen/AsmPrinter.cpp
+++ b/llvm/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";
}
OpenPOWER on IntegriCloud