diff options
author | Chris Lattner <sabre@nondot.org> | 2004-02-09 00:15:41 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-02-09 00:15:41 +0000 |
commit | 71151aee60d785aebefb0b4cdf085469d4a696a4 (patch) | |
tree | 29dd823583a75bc38e521b8eba6e41b9987083ff /lib/Bytecode | |
parent | b9806e0101d093b8ab60b8816a47a88e4f862f10 (diff) | |
download | external_llvm-71151aee60d785aebefb0b4cdf085469d4a696a4.zip external_llvm-71151aee60d785aebefb0b4cdf085469d4a696a4.tar.gz external_llvm-71151aee60d785aebefb0b4cdf085469d4a696a4.tar.bz2 |
Fix PR215: [bcwriter] Problem compactifying ConstantPointerRefs
Have I ever mentioned how much I _hate_ constantpointerrefs?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11212 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode')
-rw-r--r-- | lib/Bytecode/Writer/SlotCalculator.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Bytecode/Writer/SlotCalculator.cpp b/lib/Bytecode/Writer/SlotCalculator.cpp index d928c08..7b18a1d 100644 --- a/lib/Bytecode/Writer/SlotCalculator.cpp +++ b/lib/Bytecode/Writer/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) |