[llvm-commits] CVS: llvm/lib/VMCore/iCall.cpp

Chris Lattner lattner at cs.uiuc.edu
Fri Oct 31 12:39:06 PST 2003


Changes in directory llvm/lib/VMCore:

iCall.cpp updated: 1.19 -> 1.20

---
Log message:

Did I mention that I _HATE_ CPRs?


---
Diffs of the changes:  (+12 -0)

Index: llvm/lib/VMCore/iCall.cpp
diff -u llvm/lib/VMCore/iCall.cpp:1.19 llvm/lib/VMCore/iCall.cpp:1.20
--- llvm/lib/VMCore/iCall.cpp:1.19	Fri Oct 31 11:51:16 2003
+++ llvm/lib/VMCore/iCall.cpp	Fri Oct 31 12:38:06 2003
@@ -143,3 +143,15 @@
     return cast<Function>(CPR->getValue());
   return 0;
 }
+
+#include "llvm/Support/CallSite.h"
+
+Function *CallSite::getCalledFunction() const {
+  Value *Callee = getCalledValue();
+  if (Function *F = dyn_cast<Function>(Callee))
+    return F;
+  if (ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(Callee))
+    return cast<Function>(CPR->getValue());
+  return 0;
+}
+





More information about the llvm-commits mailing list