diff options
author | Dan Liew <delcypher@gmail.com> | 2014-01-12 06:41:32 -0800 |
---|---|---|
committer | Dan Liew <delcypher@gmail.com> | 2014-01-12 06:41:32 -0800 |
commit | 8c03dfa5ea9fe5176cbb82b70a36ffa93c70b91c (patch) | |
tree | a78ec50217f5732bd3df084c5bdf38821570d2cc /lib/Module/Checks.cpp | |
parent | 3eff4a22c77d70e1c5c3193eaa0b825e8e0b4a3f (diff) | |
parent | 5b2dcbbcf91062e463a040d58302706c612f03bd (diff) | |
download | klee-8c03dfa5ea9fe5176cbb82b70a36ffa93c70b91c.tar.gz |
Merge pull request #68 from MartinNowack/feature_kleeInternalFunctions
Feature klee internal functions
Diffstat (limited to 'lib/Module/Checks.cpp')
-rw-r--r-- | lib/Module/Checks.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Module/Checks.cpp b/lib/Module/Checks.cpp index 79fd4afc..80b6b245 100644 --- a/lib/Module/Checks.cpp +++ b/lib/Module/Checks.cpp @@ -83,7 +83,12 @@ bool DivCheckPass::runOnModule(Module &M) { divZeroCheckFunction = cast<Function>(fc); } - CallInst::Create(divZeroCheckFunction, denominator, "", &*i); + CallInst * ci = CallInst::Create(divZeroCheckFunction, denominator, "", &*i); + + // Set debug location of checking call to that of the div/rem + // operation so error locations are reported in the correct + // location. + ci->setDebugLoc(binOp->getDebugLoc()); moduleChanged = true; } } @@ -138,11 +143,14 @@ bool OvershiftCheckPass::runOnModule(Module &M) { } // Inject CallInstr to check if overshifting possible + CallInst* ci = #if LLVM_VERSION_CODE >= LLVM_VERSION(3, 0) CallInst::Create(overshiftCheckFunction, args, "", &*i); #else CallInst::Create(overshiftCheckFunction, args.begin(), args.end(), "", &*i); #endif + // set debug information from binary operand to preserve it + ci->setDebugLoc(binOp->getDebugLoc()); moduleChanged = true; } } |