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

Chris Lattner lattner at cs.uiuc.edu
Sun Feb 8 18:16:01 PST 2004


Changes in directory llvm/lib/VMCore:

SlotCalculator.cpp updated: 1.50 -> 1.51

---
Log message:

Fix PR215: [bcwriter] Problem compactifying ConstantPointerRefs

Have I ever mentioned how much I _hate_ constantpointerrefs?


---
Diffs of the changes:  (+2 -0)

Index: llvm/lib/VMCore/SlotCalculator.cpp
diff -u llvm/lib/VMCore/SlotCalculator.cpp:1.50 llvm/lib/VMCore/SlotCalculator.cpp:1.51
--- llvm/lib/VMCore/SlotCalculator.cpp:1.50	Tue Jan 20 13:50:23 2004
+++ llvm/lib/VMCore/SlotCalculator.cpp	Sun Feb  8 18:15:41 2004
@@ -381,6 +381,8 @@
 /// getOrCreateCompactionTableSlot - This method is used to build up the initial
 /// approximation of the compaction table.
 unsigned SlotCalculator::getOrCreateCompactionTableSlot(const Value *V) {
+  if (const ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(V))
+    V = CPR->getValue();
   std::map<const Value*, unsigned>::iterator I =
     CompactionNodeMap.lower_bound(V);
   if (I != CompactionNodeMap.end() && I->first == V)





More information about the llvm-commits mailing list