Remove Module::mutateConstantPointerRef, which is now thankfully dead!

This is one small step towards the complete obliteration of
ConstantPointerRef's entirely!! Woot!

llvm-svn: 12216
This commit is contained in:
Chris Lattner 2004-03-08 06:16:10 +00:00
parent 8301a593a9
commit c3ecaae16c
1 changed files with 0 additions and 25 deletions

View File

@ -335,28 +335,3 @@ void Module::destroyConstantPointerRef(ConstantPointerRef *CPR) {
GVRefMap = 0;
}
}
void Module::mutateConstantPointerRef(GlobalValue *OldGV, GlobalValue *NewGV) {
assert(OldGV != NewGV && "Cannot mutate to the same global!");
GlobalValueRefMap::iterator I = GVRefMap->Map.find(OldGV);
assert(I != GVRefMap->Map.end() &&
"mutateConstantPointerRef; OldGV not in table!");
ConstantPointerRef *Ref = I->second;
// Remove the old entry...
GVRefMap->Map.erase(I);
// Check to see if a CPR already exists for NewGV
I = GVRefMap->Map.lower_bound(NewGV);
if (I == GVRefMap->Map.end() || I->first != NewGV) {
// Insert the new entry...
GVRefMap->Map.insert(I, std::make_pair(NewGV, Ref));
} else {
// Otherwise, an entry already exists for the current global value.
// Completely replace the old CPR with the existing one...
Ref->replaceAllUsesWith(I->second);
delete Ref;
}
}