forked from klee/klee
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b4fbe6d
commit 6569119
Showing
6 changed files
with
56 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
//===-- CallRemover.cpp----------------------------------------------------===// | ||
// | ||
// The KLEE Symbolic Virtual Machine | ||
// | ||
// This file is distributed under the University of Illinois Open Source | ||
// License. See LICENSE.TXT for details. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include "Passes.h" | ||
#include <unordered_set> | ||
|
||
namespace klee { | ||
|
||
using namespace llvm; | ||
|
||
char CallRemover::ID; | ||
|
||
bool CallRemover::runOnModule(llvm::Module &M) { | ||
std::vector<std::string> badFuncs = {"llvm.dbg.declare", "llvm.dbg.label"}; | ||
|
||
for (const auto &f : badFuncs) { | ||
auto Declare = M.getFunction(f); | ||
if (!Declare) | ||
continue; | ||
while (!Declare->use_empty()) { | ||
auto CI = cast<CallInst>(Declare->user_back()); | ||
assert(CI->use_empty() && "deleted function must have void result"); | ||
CI->eraseFromParent(); | ||
} | ||
Declare->eraseFromParent(); | ||
} | ||
|
||
return true; | ||
} | ||
} // namespace klee |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters