From fa680ea1ebfee911ba1a8f97f1cd5e813e143c2e Mon Sep 17 00:00:00 2001 From: Gabor Greif Date: Thu, 1 Jul 2010 10:41:37 +0000 Subject: 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 --- lib/VMCore/Instructions.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/VMCore') diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp index e8ac392..a063659 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(II)->op_begin() + ? (CallInst::ArgOffset + ? cast(II)->op_begin() + : cast(II)->op_end() - 1) : cast(II)->op_end() - 3; // Skip BB, BB, Function } -- cgit v1.1