about summary refs log tree commit diff homepage
path: root/lib/Module
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2010-08-05 17:53:17 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2010-08-05 17:53:17 +0000
commit535a4efdffdbd62d7c3956644cd6bdecdca7d18f (patch)
treef68dc97ea163c9b535f42783e3fe64572ac5d7d7 /lib/Module
parent1d98ac411c77ac56478e4b4365c81311f7849725 (diff)
downloadklee-535a4efdffdbd62d7c3956644cd6bdecdca7d18f.tar.gz
Have getDirectCallTarget use CallSite
git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@110351 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Module')
-rw-r--r--lib/Module/ModuleUtil.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Module/ModuleUtil.cpp b/lib/Module/ModuleUtil.cpp
index df495da8..17c4aa91 100644
--- a/lib/Module/ModuleUtil.cpp
+++ b/lib/Module/ModuleUtil.cpp
@@ -17,6 +17,7 @@
 #include "llvm/Module.h"
 #include "llvm/Assembly/AsmAnnotationWriter.h"
 #include "llvm/Support/CFG.h"
+#include "llvm/Support/CallSite.h"
 #include "llvm/Support/InstIterator.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Analysis/ValueTracking.h"
@@ -45,10 +46,8 @@ Module *klee::linkWithLibrary(Module *module,
   return linker.releaseModule();
 }
 
-Function *klee::getDirectCallTarget(const Instruction *i) {
-  assert(isa<CallInst>(i) || isa<InvokeInst>(i));
-
-  Value *v = i->getOperand(0);
+Function *klee::getDirectCallTarget(CallSite cs) {
+  Value *v = cs.getCalledValue();
   if (Function *f = dyn_cast<Function>(v)) {
     return f;
   } else if (llvm::ConstantExpr *ce = dyn_cast<llvm::ConstantExpr>(v)) {