mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 11:02:59 +02:00
cache result of operator*
llvm-svn: 107979
This commit is contained in:
parent
1277447002
commit
1674456c37
@ -253,17 +253,18 @@ void BitcodeReaderValueList::ResolveConstantForwardRefs() {
|
|||||||
// at once.
|
// at once.
|
||||||
while (!Placeholder->use_empty()) {
|
while (!Placeholder->use_empty()) {
|
||||||
Value::use_iterator UI = Placeholder->use_begin();
|
Value::use_iterator UI = Placeholder->use_begin();
|
||||||
|
User *U = *UI;
|
||||||
|
|
||||||
// If the using object isn't uniqued, just update the operands. This
|
// If the using object isn't uniqued, just update the operands. This
|
||||||
// handles instructions and initializers for global variables.
|
// 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);
|
UI.getUse().set(RealVal);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise, we have a constant that uses the placeholder. Replace that
|
// Otherwise, we have a constant that uses the placeholder. Replace that
|
||||||
// constant with a new constant that has *all* placeholder uses updated.
|
// 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();
|
for (User::op_iterator I = UserC->op_begin(), E = UserC->op_end();
|
||||||
I != E; ++I) {
|
I != E; ++I) {
|
||||||
Value *NewOp;
|
Value *NewOp;
|
||||||
|
Loading…
Reference in New Issue
Block a user