From cba6931381ef9cc71ea1692ea860848c3f3f4c99 Mon Sep 17 00:00:00 2001 From: Cristian Cadar Date: Thu, 4 Apr 2013 11:50:07 +0000 Subject: Patch by Michael Contreras and Jiri Slaby for compiling KLEE with LLVM 3.2 git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@178759 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Module/Optimize.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib/Module/Optimize.cpp') diff --git a/lib/Module/Optimize.cpp b/lib/Module/Optimize.cpp index da2c9733..d05002fe 100644 --- a/lib/Module/Optimize.cpp +++ b/lib/Module/Optimize.cpp @@ -197,8 +197,14 @@ void Optimize(Module* M) { // Now that composite has been compiled, scan through the module, looking // for a main function. If main is defined, mark all other functions // internal. - if (!DisableInternalize) - addPass(Passes, createInternalizePass(true)); + if (!DisableInternalize) { +#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 2) + ModulePass *pass = createInternalizePass(createInternalizePass(std::vector(1, "main")); +#else + ModulePass *pass = createInternalizePass(true); +#endif + addPass(Passes, pass); + } // Propagate constants at call sites into the functions they call. This // opens opportunities for globalopt (and inlining) by substituting function -- cgit 1.4.1