Print the most trivial inline asms.

llvm-svn: 25822
This commit is contained in:
Chris Lattner 2006-01-30 23:00:08 +00:00
parent f263a23735
commit 57ecb561c6
1 changed files with 12 additions and 1 deletions

View File

@ -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";
}