summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2010-07-01 10:41:37 +0000
committerGabor Greif <ggreif@gmail.com>2010-07-01 10:41:37 +0000
commit9dc154bcb408001a2a686553e21a8f45276e8a7a (patch)
treec8574a6b2c781b79c30db3c32ccd58ab1a9772c0 /llvm/lib
parentbf81ed1fcfec40c8374c0448172b803e96e8bb39 (diff)
downloadbcm5719-llvm-9dc154bcb408001a2a686553e21a8f45276e8a7a.tar.gz
bcm5719-llvm-9dc154bcb408001a2a686553e21a8f45276e8a7a.zip
reformulate CallSite::getCallee to adapt to CallInst::ArgOffset, and make it work even if CallInst::op_* are private
llvm-svn: 107390
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/VMCore/Instructions.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/VMCore/Instructions.cpp b/llvm/lib/VMCore/Instructions.cpp
index e8ac392d71f..a0636592180 100644
--- a/llvm/lib/VMCore/Instructions.cpp
+++ b/llvm/lib/VMCore/Instructions.cpp
@@ -33,7 +33,9 @@ using namespace llvm;
User::op_iterator CallSite::getCallee() const {
Instruction *II(getInstruction());
return isCall()
- ? cast<CallInst>(II)->op_begin()
+ ? (CallInst::ArgOffset
+ ? cast</*FIXME: CallInst*/User>(II)->op_begin()
+ : cast</*FIXME: CallInst*/User>(II)->op_end() - 1)
: cast<InvokeInst>(II)->op_end() - 3; // Skip BB, BB, Function
}
OpenPOWER on IntegriCloud