diff options
author | Julian Büning <julian.buening@rwth-aachen.de> | 2018-11-04 11:34:10 +0100 |
---|---|---|
committer | Cristian Cadar <c.cadar@imperial.ac.uk> | 2019-03-05 15:15:39 +0000 |
commit | 7e33d5cb292c88ae10f4a0ffa86c498168fbe16a (patch) | |
tree | 769f3ff2ba656810198fe7a4416058c68f6096f0 /lib/Module/Optimize.cpp | |
parent | d5de3df2c7e481426c39220072b42dfd307a3526 (diff) | |
download | klee-7e33d5cb292c88ae10f4a0ffa86c498168fbe16a.tar.gz |
workaround for LLVM PR39177
provides a workaround for LLVM bug PR39177, which affects LLVM versions 3.9 - 7.0.0: https://bugs.llvm.org/show_bug.cgi?id=39177 This commit is intended to be reverted once support for LLVM versions <= 7 is dropped from KLEE.
Diffstat (limited to 'lib/Module/Optimize.cpp')
-rw-r--r-- | lib/Module/Optimize.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Module/Optimize.cpp b/lib/Module/Optimize.cpp index 627921cb..e0a8fc41 100644 --- a/lib/Module/Optimize.cpp +++ b/lib/Module/Optimize.cpp @@ -18,6 +18,10 @@ #include "klee/Config/Version.h" #include "klee/Internal/Module/LLVMPassManager.h" +#ifdef USE_WORKAROUND_LLVM_PR39177 +#include "Passes.h" +#endif + #include "llvm/Analysis/Passes.h" #include "llvm/Analysis/LoopPass.h" #include "llvm/IR/Module.h" @@ -180,6 +184,10 @@ void Optimize(Module *M, llvm::ArrayRef<const char *> preservedFunctions) { if (VerifyEach) Passes.add(createVerifierPass()); +#ifdef USE_WORKAROUND_LLVM_PR39177 + addPass(Passes, new klee::WorkaroundLLVMPR39177Pass()); +#endif + // Add an appropriate DataLayout instance for this module... #if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7) // LLVM 3.7+ doesn't have DataLayoutPass anymore. |