diff options
| author | Chris Lattner <sabre@nondot.org> | 2002-09-10 15:53:49 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2002-09-10 15:53:49 +0000 |
| commit | 7d734801d10ebb8be53a336268849fdb451b2ebe (patch) | |
| tree | 741a807adbcef9dce119190d32610b262bf86450 /llvm | |
| parent | 3c787446c751ad4fa9d0a2ae3fbf6fa862e688f0 (diff) | |
| download | bcm5719-llvm-7d734801d10ebb8be53a336268849fdb451b2ebe.tar.gz bcm5719-llvm-7d734801d10ebb8be53a336268849fdb451b2ebe.zip | |
Add support for printing constpointerrefs more nicely
llvm-svn: 3654
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/VMCore/AsmWriter.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp index d8a1394497b..4ba16621430 100644 --- a/llvm/lib/VMCore/AsmWriter.cpp +++ b/llvm/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 << "<null> constant value\n"; return; } + + // Handle CPR's special, because they have context information... + if (const ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(this)) { + CPR->getValue()->print(o); // Print as a global value, with context info. + return; + } + o << " " << getType()->getDescription() << " "; map<const Type *, string> TypeTable; |

