aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2010-07-01 11:26:05 +0000
committerGabor Greif <ggreif@gmail.com>2010-07-01 11:26:05 +0000
commitcf32c6e0049405b521f0baf720d1fe76ec510b26 (patch)
tree572057e0dae6dbbd844aedb59d0f4b07f77bcc93 /include
parentfa680ea1ebfee911ba1a8f97f1cd5e813e143c2e (diff)
reformulate CallSiteBase::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@107392 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Support/CallSite.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/llvm/Support/CallSite.h b/include/llvm/Support/CallSite.h
index 0650b61fbc..c4d442a5f9 100644
--- a/include/llvm/Support/CallSite.h
+++ b/include/llvm/Support/CallSite.h
@@ -273,7 +273,9 @@ private:
// of the op_*() functions here. See CallSite::getCallee.
//
if (isCall())
- return getInstruction()->op_begin(); // Unchanged (ATM)
+ return CallInst::ArgOffset
+ ? getInstruction()->op_begin() // Unchanged
+ : getInstruction()->op_end() - 1; // Skip Function
else
return getInstruction()->op_end() - 3; // Skip BB, BB, Function
}