about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
-rw-r--r--lib/Module/Optimize.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Module/Optimize.cpp b/lib/Module/Optimize.cpp
index 2aeb9f83..ce43cd96 100644
--- a/lib/Module/Optimize.cpp
+++ b/lib/Module/Optimize.cpp
@@ -175,9 +175,12 @@ void Optimize(Module* M) {
 #if LLVM_VERSION_CODE <= LLVM_VERSION(3, 1)
   // Add an appropriate TargetData instance for this module...
   addPass(Passes, new TargetData(M));
-#else
+#elif LLVM_VERSION_CODE < LLVM_VERSION(3, 5)
   // Add an appropriate DataLayout instance for this module...
   addPass(Passes, new DataLayout(M));
+#else
+  // Add an appropriate DataLayout instance for this module...
+  addPass(Passes, new DataLayoutPass(M));
 #endif
 
   // DWD - Run the opt standard pass list as well.