summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-02-09 00:15:41 +0000
committerChris Lattner <sabre@nondot.org>2004-02-09 00:15:41 +0000
commit5b6892e37c8d138527d395bab22006e9b3c3427a (patch)
treef0ae7776b53aad3301670af67c28cd305f21edb3 /llvm/lib/VMCore
parent3480e935d05c0abc4da4a8f12fcf45fe9f66045a (diff)
downloadbcm5719-llvm-5b6892e37c8d138527d395bab22006e9b3c3427a.tar.gz
bcm5719-llvm-5b6892e37c8d138527d395bab22006e9b3c3427a.zip
Fix PR215: [bcwriter] Problem compactifying ConstantPointerRefs
Have I ever mentioned how much I _hate_ constantpointerrefs? llvm-svn: 11212
Diffstat (limited to 'llvm/lib/VMCore')
-rw-r--r--llvm/lib/VMCore/SlotCalculator.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/SlotCalculator.cpp b/llvm/lib/VMCore/SlotCalculator.cpp
index d928c083926..7b18a1dfd5a 100644
--- a/llvm/lib/VMCore/SlotCalculator.cpp
+++ b/llvm/lib/VMCore/SlotCalculator.cpp
@@ -381,6 +381,8 @@ static inline bool hasNullValue(unsigned TyID) {
/// 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)
OpenPOWER on IntegriCloud