[llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp

Chris Lattner lattner at cs.uiuc.edu
Tue Sep 10 10:54:00 PDT 2002


Changes in directory llvm/lib/VMCore:

AsmWriter.cpp updated: 1.75 -> 1.76

---
Log message:

Add support for printing constpointerrefs more nicely


---
Diffs of the changes:

Index: llvm/lib/VMCore/AsmWriter.cpp
diff -u llvm/lib/VMCore/AsmWriter.cpp:1.75 llvm/lib/VMCore/AsmWriter.cpp:1.76
--- llvm/lib/VMCore/AsmWriter.cpp:1.75	Fri Aug 16 16:17:11 2002
+++ llvm/lib/VMCore/AsmWriter.cpp	Tue Sep 10 10:53:49 2002
@@ -872,6 +872,13 @@
 
 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;





More information about the llvm-commits mailing list