Changes in directory llvm/lib/CodeGen:

AsmPrinter.cpp updated: 1.41 -> 1.42
---
Log message:

Print the most trivial inline asms.


---
Diffs of the changes:  (+12 -1)

 AsmPrinter.cpp |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletion(-)


Index: llvm/lib/CodeGen/AsmPrinter.cpp
diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.41 
llvm/lib/CodeGen/AsmPrinter.cpp:1.42
--- llvm/lib/CodeGen/AsmPrinter.cpp:1.41        Thu Jan 26 20:10:10 2006
+++ llvm/lib/CodeGen/AsmPrinter.cpp     Mon Jan 30 17:00:08 2006
@@ -456,5 +456,16 @@
 /// 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";
 }



_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to