forked from OSchip/llvm-project
Replace explicit loop with utility function.
llvm-svn: 58593
This commit is contained in:
parent
7b14e20a5e
commit
d73806a9cc
|
@ -1638,10 +1638,8 @@ static bool AddressIsTaken(GlobalValue *GV) {
|
|||
} else if (isa<InvokeInst>(*UI) || isa<CallInst>(*UI)) {
|
||||
// Make sure we are calling the function, not passing the address.
|
||||
CallSite CS = CallSite::get(cast<Instruction>(*UI));
|
||||
for (CallSite::arg_iterator AI = CS.arg_begin(),
|
||||
E = CS.arg_end(); AI != E; ++AI)
|
||||
if (*AI == GV)
|
||||
return true;
|
||||
if (CS.hasArgument(GV))
|
||||
return true;
|
||||
} else if (LoadInst *LI = dyn_cast<LoadInst>(*UI)) {
|
||||
if (LI->isVolatile())
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue