diff options
author | Martin Nowack <martin.nowack@gmail.com> | 2018-05-15 15:12:12 +0100 |
---|---|---|
committer | Cristian Cadar <c.cadar@imperial.ac.uk> | 2018-07-04 15:13:02 +0100 |
commit | ef90f1e219fec27a3d594158ae5f380a9e9a2f37 (patch) | |
tree | 0a02b5da762b4bc59f7f6bd2453a2a6591f00062 /lib/Module/Optimize.cpp | |
parent | 6803c37be83f0c97c95870a18cb230e135a131c9 (diff) | |
download | klee-ef90f1e219fec27a3d594158ae5f380a9e9a2f37.tar.gz |
Reorder linking and optimizations
Link intrinsic library before executing optimizations. This makes sure that any optimization run by KLEE on the module is executed for the intrinsic library as well. Support .ll files as input for KLEE as well.
Diffstat (limited to 'lib/Module/Optimize.cpp')
-rw-r--r-- | lib/Module/Optimize.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Module/Optimize.cpp b/lib/Module/Optimize.cpp index 64e4863f..18c56cc2 100644 --- a/lib/Module/Optimize.cpp +++ b/lib/Module/Optimize.cpp @@ -144,7 +144,7 @@ static void AddStandardCompilePasses(klee::LegacyLLVMPassManagerTy &PM) { /// Optimize - Perform link time optimizations. This will run the scalar /// optimizations, any loaded plugin-optimization modules, and then the /// inter-procedural optimizations if applicable. -void Optimize(Module *M, const std::string &EntryPoint) { +void Optimize(Module *M, llvm::ArrayRef<const char *> preservedFunctions) { // Instantiate the pass manager to organize the passes. klee::LegacyLLVMPassManagerTy Passes; @@ -174,8 +174,7 @@ void Optimize(Module *M, const std::string &EntryPoint) { // for a main function. If main is defined, mark all other functions // internal. if (!DisableInternalize) { - ModulePass *pass = createInternalizePass( - std::vector<const char *>(1, EntryPoint.c_str())); + ModulePass *pass = createInternalizePass(preservedFunctions); addPass(Passes, pass); } |