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.
- Generation in two modes: naive and determinitic - Mocks are reproducible - Special mocks for allocators: malloc, calloc, realloc
- Loading branch information
1 parent
7f6fd2d
commit 3340a08
Showing
32 changed files
with
957 additions
and
45 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
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,39 @@ | ||
#ifndef KLEE_MOCKBUILDER_H | ||
#define KLEE_MOCKBUILDER_H | ||
|
||
#include "llvm/IR/IRBuilder.h" | ||
#include "llvm/IR/Module.h" | ||
|
||
#include <set> | ||
#include <string> | ||
|
||
namespace klee { | ||
|
||
class MockBuilder { | ||
private: | ||
const llvm::Module *userModule; | ||
std::unique_ptr<llvm::Module> mockModule; | ||
std::unique_ptr<llvm::IRBuilder<>> builder; | ||
std::map<std::string, llvm::Type *> externals; | ||
|
||
const std::string mockEntrypoint, userEntrypoint; | ||
|
||
void initMockModule(); | ||
void buildMockMain(); | ||
void buildExternalGlobalsDefinitions(); | ||
void buildExternalFunctionsDefinitions(); | ||
void buildCallKleeMakeSymbol(const std::string &klee_function_name, | ||
llvm::Value *source, llvm::Type *type, | ||
const std::string &symbol_name); | ||
|
||
public: | ||
MockBuilder(const llvm::Module *initModule, std::string mockEntrypoint, | ||
std::string userEntrypoint, | ||
std::map<std::string, llvm::Type *> externals); | ||
|
||
std::unique_ptr<llvm::Module> build(); | ||
}; | ||
|
||
} // namespace klee | ||
|
||
#endif // KLEE_MOCKBUILDER_H |
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
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
Oops, something went wrong.