diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2010-08-05 17:53:17 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2010-08-05 17:53:17 +0000 |
commit | 535a4efdffdbd62d7c3956644cd6bdecdca7d18f (patch) | |
tree | f68dc97ea163c9b535f42783e3fe64572ac5d7d7 | |
parent | 1d98ac411c77ac56478e4b4365c81311f7849725 (diff) | |
download | klee-535a4efdffdbd62d7c3956644cd6bdecdca7d18f.tar.gz |
Have getDirectCallTarget use CallSite
git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@110351 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/klee/Internal/Support/ModuleUtil.h | 3 | ||||
-rw-r--r-- | lib/Core/StatsTracker.cpp | 2 | ||||
-rw-r--r-- | lib/Module/ModuleUtil.cpp | 7 |
3 files changed, 6 insertions, 6 deletions
diff --git a/include/klee/Internal/Support/ModuleUtil.h b/include/klee/Internal/Support/ModuleUtil.h index 6cf5fbee..29adc94a 100644 --- a/include/klee/Internal/Support/ModuleUtil.h +++ b/include/klee/Internal/Support/ModuleUtil.h @@ -16,6 +16,7 @@ namespace llvm { class Function; class Instruction; class Module; + class CallSite; } namespace klee { @@ -28,7 +29,7 @@ namespace klee { /// null if it cannot be determined (should be only for indirect /// calls, although complicated constant expressions might be /// another possibility). - llvm::Function *getDirectCallTarget(const llvm::Instruction*); + llvm::Function *getDirectCallTarget(llvm::CallSite); /// Return true iff the given Function value is used in something /// other than a direct call (or a constant expression that diff --git a/lib/Core/StatsTracker.cpp b/lib/Core/StatsTracker.cpp index 08df3127..1c963bfc 100644 --- a/lib/Core/StatsTracker.cpp +++ b/lib/Core/StatsTracker.cpp @@ -615,7 +615,7 @@ void StatsTracker::computeReachableUncovered() { // (which should be correct anyhow). callTargets.insert(std::make_pair(it, std::vector<Function*>())); - } else if (Function *target = getDirectCallTarget(it)) { + } else if (Function *target = getDirectCallTarget(cs)) { callTargets[it].push_back(target); } else { callTargets[it] = 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)) { |