From 7e33d5cb292c88ae10f4a0ffa86c498168fbe16a Mon Sep 17 00:00:00 2001 From: Julian Büning Date: Sun, 4 Nov 2018 11:34:10 +0100 Subject: 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. --- lib/Module/Optimize.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/Module/Optimize.cpp') 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 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. -- cgit 1.4.1