Fix PR215: [bcwriter] Problem compactifying ConstantPointerRefs

Have I ever mentioned how much I _hate_ constantpointerrefs?

llvm-svn: 11212
This commit is contained in:
Chris Lattner 2004-02-09 00:15:41 +00:00
parent 58ca173834
commit 9523c4de75

View File

@ -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)