aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/StructRetPromotion.cpp
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2009-01-22 21:35:57 +0000
committerGabor Greif <ggreif@gmail.com>2009-01-22 21:35:57 +0000
commitedc4d69917df7dc34543adf719d5c93249fd5e27 (patch)
tree5da6a083d7eff2b5ba22d563b1a817caf42abcaf /lib/Transforms/IPO/StructRetPromotion.cpp
parent1592e5b75a4e919c463914acdb4cab0a6a6ebd53 (diff)
introduce a useful abstraction to find out if a Use is in the call position of an instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62788 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/StructRetPromotion.cpp')
-rw-r--r--lib/Transforms/IPO/StructRetPromotion.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/Transforms/IPO/StructRetPromotion.cpp b/lib/Transforms/IPO/StructRetPromotion.cpp
index 00556f9633..9f54388aa4 100644
--- a/lib/Transforms/IPO/StructRetPromotion.cpp
+++ b/lib/Transforms/IPO/StructRetPromotion.cpp
@@ -149,14 +149,11 @@ bool SRETPromotion::isSafeToUpdateAllCallers(Function *F) {
FnUseI != FnUseE; ++FnUseI) {
// The function is passed in as an argument to (possibly) another function,
// we can't change it!
- if (FnUseI.getOperandNo() != 0)
- return false;
-
CallSite CS = CallSite::get(*FnUseI);
Instruction *Call = CS.getInstruction();
// The function is used by something else than a call or invoke instruction,
// we can't change it!
- if (!Call)
+ if (!Call || !CS.isCallee(FnUseI))
return false;
CallSite::arg_iterator AI = CS.arg_begin();
Value *FirstArg = *AI;