diff options
author | Chris Lattner <sabre@nondot.org> | 2002-10-14 03:28:42 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-10-14 03:28:42 +0000 |
commit | 9e932bd566f7cd2c1602b5b5ed4e46e2e00bf736 (patch) | |
tree | 17554cb92b8b296877f7ddea4fe3b3f855e0315e /lib/AsmParser | |
parent | 700d48806b2c1a88b48b216abdba55a3a851de7b (diff) | |
download | external_llvm-9e932bd566f7cd2c1602b5b5ed4e46e2e00bf736.zip external_llvm-9e932bd566f7cd2c1602b5b5ed4e46e2e00bf736.tar.gz external_llvm-9e932bd566f7cd2c1602b5b5ed4e46e2e00bf736.tar.bz2 |
This loop executed exactly one time, turn it into straightline code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4159 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AsmParser')
-rw-r--r-- | lib/AsmParser/llvmAsmParser.y | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y index 52ef690..71da575 100644 --- a/lib/AsmParser/llvmAsmParser.y +++ b/lib/AsmParser/llvmAsmParser.y @@ -117,15 +117,13 @@ static struct PerModuleInfo { // Loop over all of the uses of the GlobalValue. The only thing they are // allowed to be is ConstantPointerRef's. assert(OldGV->use_size() == 1 && "Only one reference should exist!"); - while (!OldGV->use_empty()) { - User *U = OldGV->use_back(); // Must be a ConstantPointerRef... - ConstantPointerRef *CPR = cast<ConstantPointerRef>(U); - assert(CPR->getValue() == OldGV && "Something isn't happy"); + 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->mutateReferences(OldGV, GV); - } + // Change the const pool reference to point to the real global variable + // now. This should drop a use from the OldGV. + CPR->mutateReferences(OldGV, GV); + assert(OldGV->use_empty() && "All uses should be gone now!"); // Remove OldGV from the module... CurrentModule->getGlobalList().remove(OldGV); |