[llvm-commits] [llvm] r107392 - /llvm/trunk/include/llvm/Support/CallSite.h

Gabor Greif ggreif at gmail.com
Thu Jul 1 04:26:05 PDT 2010


Author: ggreif
Date: Thu Jul  1 06:26:05 2010
New Revision: 107392

URL: http://llvm.org/viewvc/llvm-project?rev=107392&view=rev
Log:
reformulate CallSiteBase::getCallee to adapt to CallInst::ArgOffset, and make it work even if CallInst::op_* are private

Modified:
    llvm/trunk/include/llvm/Support/CallSite.h

Modified: llvm/trunk/include/llvm/Support/CallSite.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/CallSite.h?rev=107392&r1=107391&r2=107392&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/CallSite.h (original)
+++ llvm/trunk/include/llvm/Support/CallSite.h Thu Jul  1 06:26:05 2010
@@ -273,7 +273,9 @@
       // 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
   }





More information about the llvm-commits mailing list