summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/AsmWriter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-01-25 22:26:05 +0000
committerChris Lattner <sabre@nondot.org>2006-01-25 22:26:05 +0000
commita2d810d9355de1ed5615d4000f8882ac7f6b0909 (patch)
tree39bc5ebe6301b1f16029b120fe2aec24cd64961a /llvm/lib/VMCore/AsmWriter.cpp
parentff45f0d5b7c02c14fb976752b6ecb68e55bf4189 (diff)
downloadbcm5719-llvm-a2d810d9355de1ed5615d4000f8882ac7f6b0909.tar.gz
bcm5719-llvm-a2d810d9355de1ed5615d4000f8882ac7f6b0909.zip
Print InlineAsm objects
llvm-svn: 25617
Diffstat (limited to 'llvm/lib/VMCore/AsmWriter.cpp')
-rw-r--r--llvm/lib/VMCore/AsmWriter.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp
index a5ac8f03311..ec70454e0bb 100644
--- a/llvm/lib/VMCore/AsmWriter.cpp
+++ b/llvm/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 {
OpenPOWER on IntegriCloud