diff options
author | Jay Foad <jay.foad@gmail.com> | 2009-06-10 08:41:11 +0000 |
---|---|---|
committer | Jay Foad <jay.foad@gmail.com> | 2009-06-10 08:41:11 +0000 |
commit | 757068f3bad425fb126fe16ab7b8a82a636e6bbd (patch) | |
tree | 16aac7d61fc8b5409af46cc2b5cc3245e3fd9ad3 /lib/Transforms/IPO/ArgumentPromotion.cpp | |
parent | cb597c9cc457ee0bb9c6ab3195b90da6d0049caf (diff) |
Implement and use new method Function::hasAddressTaken().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73164 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/ArgumentPromotion.cpp')
-rw-r--r-- | lib/Transforms/IPO/ArgumentPromotion.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/lib/Transforms/IPO/ArgumentPromotion.cpp b/lib/Transforms/IPO/ArgumentPromotion.cpp index 2bb6428060..a612634016 100644 --- a/lib/Transforms/IPO/ArgumentPromotion.cpp +++ b/lib/Transforms/IPO/ArgumentPromotion.cpp @@ -127,17 +127,8 @@ bool ArgPromotion::PromoteArguments(CallGraphNode *CGN) { // Second check: make sure that all callers are direct callers. We can't // transform functions that have indirect callers. - for (Value::use_iterator UI = F->use_begin(), E = F->use_end(); - UI != E; ++UI) { - CallSite CS = CallSite::get(*UI); - if (!CS.getInstruction()) // "Taking the address" of the function - return false; - - // Ensure that this call site is CALLING the function, not passing it as - // an argument. - if (!CS.isCallee(UI)) - return false; - } + if (F->hasAddressTaken()) + return false; // Check to see which arguments are promotable. If an argument is promotable, // add it to ArgsToPromote. |