[llvm-commits] [llvm] r107390 - /llvm/trunk/lib/VMCore/Instructions.cpp
Gabor Greif
ggreif at gmail.com
Thu Jul 1 03:41:38 PDT 2010
Author: ggreif
Date: Thu Jul 1 05:41:37 2010
New Revision: 107390
URL: http://llvm.org/viewvc/llvm-project?rev=107390&view=rev
Log:
reformulate CallSite::getCallee to adapt to CallInst::ArgOffset, and make it work even if CallInst::op_* are private
Modified:
llvm/trunk/lib/VMCore/Instructions.cpp
Modified: llvm/trunk/lib/VMCore/Instructions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instructions.cpp?rev=107390&r1=107389&r2=107390&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Instructions.cpp (original)
+++ llvm/trunk/lib/VMCore/Instructions.cpp Thu Jul 1 05:41:37 2010
@@ -33,7 +33,9 @@
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
}
More information about the llvm-commits
mailing list