diff options
author | Gabor Greif <ggreif@gmail.com> | 2010-07-09 16:01:21 +0000 |
---|---|---|
committer | Gabor Greif <ggreif@gmail.com> | 2010-07-09 16:01:21 +0000 |
commit | c654d1b8c195a13413537a668f669fd9b0c7f226 (patch) | |
tree | a05db0a98ac2d7eb256578df41d565ed92d97d3d /lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | d7cc5215f131a4df933c750595d7c642df3ee5b8 (diff) |
cache result of operator*
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107979 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r-- | lib/Bitcode/Reader/BitcodeReader.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index 121dc86d89..527ae49b71 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -253,17 +253,18 @@ void BitcodeReaderValueList::ResolveConstantForwardRefs() { // at once. while (!Placeholder->use_empty()) { Value::use_iterator UI = Placeholder->use_begin(); + User *U = *UI; // If the using object isn't uniqued, just update the operands. This // handles instructions and initializers for global variables. - if (!isa<Constant>(*UI) || isa<GlobalValue>(*UI)) { + if (!isa<Constant>(U) || isa<GlobalValue>(U)) { UI.getUse().set(RealVal); continue; } // Otherwise, we have a constant that uses the placeholder. Replace that // constant with a new constant that has *all* placeholder uses updated. - Constant *UserC = cast<Constant>(*UI); + Constant *UserC = cast<Constant>(U); for (User::op_iterator I = UserC->op_begin(), E = UserC->op_end(); I != E; ++I) { Value *NewOp; |