about summary refs log tree commit diff homepage
path: root/lib/Module
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Module')
-rw-r--r--lib/Module/InstructionInfoTable.cpp4
-rw-r--r--lib/Module/IntrinsicCleaner.cpp4
-rw-r--r--lib/Module/Optimize.cpp10
3 files changed, 15 insertions, 3 deletions
diff --git a/lib/Module/InstructionInfoTable.cpp b/lib/Module/InstructionInfoTable.cpp
index 0e193452..d0ef52d0 100644
--- a/lib/Module/InstructionInfoTable.cpp
+++ b/lib/Module/InstructionInfoTable.cpp
@@ -24,7 +24,9 @@
 #include "llvm/Support/CFG.h"
 #include "llvm/Support/InstIterator.h"
 #include "llvm/Support/raw_ostream.h"
-#if LLVM_VERSION_CODE >= LLVM_VERSION(2, 7)
+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 2)
+#include "llvm/DebugInfo.h"
+#elif LLVM_VERSION_CODE >= LLVM_VERSION(2, 7)
 #include "llvm/Analysis/DebugInfo.h"
 #endif
 #include "llvm/Analysis/ValueTracking.h"
diff --git a/lib/Module/IntrinsicCleaner.cpp b/lib/Module/IntrinsicCleaner.cpp
index fd0db91d..b897fcc7 100644
--- a/lib/Module/IntrinsicCleaner.cpp
+++ b/lib/Module/IntrinsicCleaner.cpp
@@ -23,7 +23,11 @@
 #include "llvm/Module.h"
 #include "llvm/Pass.h"
 #include "llvm/Type.h"
+#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 2)
+#include "llvm/IRBuilder.h"
+#else
 #include "llvm/Support/IRBuilder.h"
+#endif
 #include "llvm/Transforms/Scalar.h"
 #include "llvm/Transforms/Utils/BasicBlockUtils.h"
 #if LLVM_VERSION_CODE <= LLVM_VERSION(3, 1)
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<const char *>(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