summaryrefslogtreecommitdiff
path: root/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
commitfa680ea1ebfee911ba1a8f97f1cd5e813e143c2e (patch)
treed385e375bc266c1ab355498cafb68c6d411e672b /lib
parentc6f00e701e744fdf73508d47ff0cc75817ba8474 (diff)
downloadllvm-fa680ea1ebfee911ba1a8f97f1cd5e813e143c2e.tar.gz
llvm-fa680ea1ebfee911ba1a8f97f1cd5e813e143c2e.tar.bz2
llvm-fa680ea1ebfee911ba1a8f97f1cd5e813e143c2e.tar.xz
reformulate CallSite::getCallee to adapt to CallInst::ArgOffset, and make it work even if CallInst::op_* are private
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107390 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/VMCore/Instructions.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp
index e8ac392d71..a063659218 100644
--- a/lib/VMCore/Instructions.cpp
+++ b/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
}