diff options
Diffstat (limited to 'lib/VMCore/AsmWriter.cpp')
| -rw-r--r-- | lib/VMCore/AsmWriter.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index a5ac8f0..ec70454 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -556,9 +556,18 @@ static void WriteAsOperandInternal(std::ostream &Out, const Value *V, Out << getLLVMName(V->getName()); else { const Constant *CV = dyn_cast<Constant>(V); - if (CV && !isa<GlobalValue>(CV)) + if (CV && !isa<GlobalValue>(CV)) { WriteConstantInt(Out, CV, PrintName, TypeTable, Machine); - else { + } else if (const InlineAsm *IA = dyn_cast<InlineAsm>(V)) { + Out << "asm "; + if (IA->hasSideEffects()) + Out << "sideeffect "; + Out << '"'; + PrintEscapedString(IA->getAsmString(), Out); + Out << "\", \""; + PrintEscapedString(IA->getConstraintString(), Out); + Out << '"'; + } else { int Slot; if (Machine) { Slot = Machine->getSlot(V); @@ -1271,8 +1280,7 @@ void Function::print(std::ostream &o, AssemblyAnnotationWriter *AAW) const { } void InlineAsm::print(std::ostream &o, AssemblyAnnotationWriter *AAW) const { - assert(0 && "Inline asm printing unimplemented!"); - //W.write(this); + WriteAsOperand(o, this, true, true, 0); } void BasicBlock::print(std::ostream &o, AssemblyAnnotationWriter *AAW) const { |
