mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-03-03 18:09:29 +00:00
Fix iterator invalidation problem
llvm-svn: 9272
This commit is contained in:
parent
7a4e225f37
commit
84a991bc86
@ -144,8 +144,8 @@ bool ReduceMisCodegenFunctions::TestFuncs(const std::vector<Function*> &Funcs,
|
||||
ResolverArgs.push_back(GEP);
|
||||
|
||||
// Insert code at the beginning of the function
|
||||
for (Value::use_iterator i=F->use_begin(), e=F->use_end(); i!=e; ++i) {
|
||||
if (Instruction* Inst = dyn_cast<Instruction>(*i)) {
|
||||
while (!F->use_empty())
|
||||
if (Instruction *Inst = dyn_cast<Instruction>(F->use_back())) {
|
||||
// call resolver(GetElementPtr...)
|
||||
CallInst *resolve = new CallInst(resolverFunc, ResolverArgs,
|
||||
"resolver", Inst);
|
||||
@ -161,7 +161,6 @@ bool ReduceMisCodegenFunctions::TestFuncs(const std::vector<Function*> &Funcs,
|
||||
std::cerr << "Non-instruction is using an external function!\n";
|
||||
abort();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user