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 | 2c0ab48ac23caf138ab754038beb1c54b878e2ff (patch) | |
tree | c928b5a5bca186616979b6e7386ca89937e79ff9 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | 070b9a2cc462028d6b0c2029a3de106b29dcdbde (diff) | |
download | bcm5719-llvm-2c0ab48ac23caf138ab754038beb1c54b878e2ff.tar.gz bcm5719-llvm-2c0ab48ac23caf138ab754038beb1c54b878e2ff.zip |
cache result of operator*
llvm-svn: 107979
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 121dc86d890..527ae49b714 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/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; |