aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2008-11-03 03:49:14 +0000
committerNick Lewycky <nicholas@mxc.ca>2008-11-03 03:49:14 +0000
commitaf38613e319fa9a8868578e94a48ec6349788266 (patch)
treea417cd3fe2606167966907716b63f72df78a1020
parent8f4d5eb9e543d22df61a98c4115ed81887213333 (diff)
Replace explicit loop with utility function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58593 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Scalar/SCCP.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp
index 48842b2e38..01b192630d 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;