[llvm-commits] [llvm] r51947 - in /llvm/trunk/lib: Analysis/IPA/CallGraph.cpp Transforms/IPO/DeadArgumentElimination.cpp
Matthijs Kooijman
matthijs at stdin.nl
Wed Jun 4 09:57:50 PDT 2008
Author: matthijs
Date: Wed Jun 4 11:57:50 2008
New Revision: 51947
URL: http://llvm.org/viewvc/llvm-project?rev=51947&view=rev
Log:
Replace two manual loops with calls to CallSite::hasArguments (no functional changes).
Modified:
llvm/trunk/lib/Analysis/IPA/CallGraph.cpp
llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp
Modified: llvm/trunk/lib/Analysis/IPA/CallGraph.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/CallGraph.cpp?rev=51947&r1=51946&r2=51947&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/IPA/CallGraph.cpp (original)
+++ llvm/trunk/lib/Analysis/IPA/CallGraph.cpp Wed Jun 4 11:57:50 2008
@@ -26,9 +26,7 @@
/// takes the address of the function.
static bool isOnlyADirectCall(Function *F, CallSite CS) {
if (!CS.getInstruction()) return false;
- for (CallSite::arg_iterator I = CS.arg_begin(), E = CS.arg_end(); I != E; ++I)
- if (*I == F) return false;
- return true;
+ return !CS.hasArgument(F);
}
namespace {
Modified: llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp?rev=51947&r1=51946&r2=51947&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Wed Jun 4 11:57:50 2008
@@ -331,13 +331,11 @@
}
// If the function is PASSED IN as an argument, its address has been taken
- for (CallSite::arg_iterator AI = CS.arg_begin(), E = CS.arg_end();
- AI != E; ++AI)
- if (AI->get() == &F) {
- FunctionIntrinsicallyLive = true;
- break;
- }
- if (FunctionIntrinsicallyLive) break;
+
+ if (CS.hasArgument(&F)) {
+ FunctionIntrinsicallyLive = true;
+ break;
+ }
}
if (FunctionIntrinsicallyLive) {
More information about the llvm-commits
mailing list