diff options
author | Chris Lattner <sabre@nondot.org> | 2004-07-13 06:58:07 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-07-13 06:58:07 +0000 |
commit | cc459c9d667fb90949a99ecd3b4d746569bd293f (patch) | |
tree | f996be47bcc8c1aa0ad781a53b8f1a40f2e04b03 /llvm/lib | |
parent | 8e30a4dfc5226637472f536e714fa0b639e49ad6 (diff) | |
download | bcm5719-llvm-cc459c9d667fb90949a99ecd3b4d746569bd293f.tar.gz bcm5719-llvm-cc459c9d667fb90949a99ecd3b4d746569bd293f.zip |
Replace a bunch of complex ConstantPointerRef referring code with simple
code.
llvm-svn: 14785
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/AsmParser/llvmAsmParser.y | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/llvm/lib/AsmParser/llvmAsmParser.y b/llvm/lib/AsmParser/llvmAsmParser.y index b2f901f206e..a4d2cf4f9c8 100644 --- a/llvm/lib/AsmParser/llvmAsmParser.y +++ b/llvm/lib/AsmParser/llvmAsmParser.y @@ -118,17 +118,9 @@ static struct PerModuleInfo { if (I != GlobalRefs.end()) { GlobalValue *OldGV = I->second; // Get the placeholder... I->first.second.destroy(); // Free string memory if necessary - - // Loop over all of the uses of the GlobalValue. The only thing they are - // allowed to be is ConstantPointerRef's. - assert(OldGV->hasOneUse() && "Only one reference should exist!"); - User *U = OldGV->use_back(); // Must be a ConstantPointerRef... - ConstantPointerRef *CPR = cast<ConstantPointerRef>(U); - - // Change the const pool reference to point to the real global variable - // now. This should drop a use from the OldGV. - CPR->replaceUsesOfWithOnConstant(OldGV, GV); - assert(OldGV->use_empty() && "All uses should be gone now!"); + + // Replace all uses of the placeholder with the new GV + OldGV->replaceAllUsesWith(GV); // Remove OldGV from the module... if (GlobalVariable *GVar = dyn_cast<GlobalVariable>(OldGV)) |