diff options
-rw-r--r-- | lib/Transforms/Scalar/SCCP.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp index 48842b2..01b1926 100644 --- a/lib/Transforms/Scalar/SCCP.cpp +++ b/lib/Transforms/Scalar/SCCP.cpp @@ -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; |