From: Chris Lattner Date: Tue, 10 Sep 2002 15:53:49 +0000 (+0000) Subject: Add support for printing constpointerrefs more nicely X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3bc06b33dac11e9372b06484139b4d4c11788273;p=oota-llvm.git Add support for printing constpointerrefs more nicely git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3654 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index d8a1394497b..4ba16621430 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -872,6 +872,13 @@ void Instruction::print(std::ostream &o) const { void Constant::print(std::ostream &o) const { if (this == 0) { o << " constant value\n"; return; } + + // Handle CPR's special, because they have context information... + if (const ConstantPointerRef *CPR = dyn_cast(this)) { + CPR->getValue()->print(o); // Print as a global value, with context info. + return; + } + o << " " << getType()->getDescription() << " "; map TypeTable;