summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitf4013373cd9919fb7f4425ad549e4fdf0c875fba (patch)
treeca91eca70111f94b6a90c0122a063b49db4c37ae /llvm/lib/Transforms/IPO/StructRetPromotion.cpp
parent8c5ffd07610476f5e7fd95fca8817e12c76584f4 (diff)
downloadbcm5719-llvm-f4013373cd9919fb7f4425ad549e4fdf0c875fba.tar.gz
bcm5719-llvm-f4013373cd9919fb7f4425ad549e4fdf0c875fba.zip
introduce a useful abstraction to find out if a Use is in the call position of an instruction
llvm-svn: 62788
Diffstat (limited to 'llvm/lib/Transforms/IPO/StructRetPromotion.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/StructRetPromotion.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/IPO/StructRetPromotion.cpp b/llvm/lib/Transforms/IPO/StructRetPromotion.cpp
index 00556f96335..9f54388aa45 100644
--- a/llvm/lib/Transforms/IPO/StructRetPromotion.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud