summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-10-14 03:28:42 +0000
committerChris Lattner <sabre@nondot.org>2002-10-14 03:28:42 +0000
commit8022a0f57cc863c34bf11ebe46562ce12b01c6ae (patch)
tree0fc726bc91ff05a4ba54c2a809b587a6e94c651a
parent8a07a0c25da8ebc4447dfba1d036330f31c92891 (diff)
downloadbcm5719-llvm-8022a0f57cc863c34bf11ebe46562ce12b01c6ae.tar.gz
bcm5719-llvm-8022a0f57cc863c34bf11ebe46562ce12b01c6ae.zip
This loop executed exactly one time, turn it into straightline code
llvm-svn: 4159
-rw-r--r--llvm/lib/AsmParser/llvmAsmParser.y14
1 files changed, 6 insertions, 8 deletions
diff --git a/llvm/lib/AsmParser/llvmAsmParser.y b/llvm/lib/AsmParser/llvmAsmParser.y
index 52ef6907f29..71da575080a 100644
--- a/llvm/lib/AsmParser/llvmAsmParser.y
+++ b/llvm/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);
OpenPOWER on IntegriCloud