reformulate CallSiteBase::getCallee to adapt to CallInst::ArgOffset, and make it work even if CallInst::op_* are private

llvm-svn: 107392
This commit is contained in:
Gabor Greif 2010-07-01 11:26:05 +00:00
parent 9dc154bcb4
commit 1b30951f2f
1 changed files with 3 additions and 1 deletions

View File

@ -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
}