summaryrefslogtreecommitdiffstats
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
commit1b30951f2f849860f9118e2c5c338b700efbfddd (patch)
treee31b082d222a3349dfa9e59e6c9043618c289484
parent9dc154bcb408001a2a686553e21a8f45276e8a7a (diff)
downloadbcm5719-llvm-1b30951f2f849860f9118e2c5c338b700efbfddd.tar.gz
bcm5719-llvm-1b30951f2f849860f9118e2c5c338b700efbfddd.zip
reformulate CallSiteBase::getCallee to adapt to CallInst::ArgOffset, and make it work even if CallInst::op_* are private
llvm-svn: 107392
-rw-r--r--llvm/include/llvm/Support/CallSite.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/include/llvm/Support/CallSite.h b/llvm/include/llvm/Support/CallSite.h
index 0650b61fbcf..c4d442a5f9c 100644
--- a/llvm/include/llvm/Support/CallSite.h
+++ b/llvm/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
}
OpenPOWER on IntegriCloud