From 28076f1e1992efcc7231ee0763d8a8fad6734a14 Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Wed, 20 Aug 2014 21:38:46 +0100 Subject: Fix LLVM3.5 compilation. This is due to r202168 --- lib/Module/Optimize.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/Module') 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. -- cgit 1.4.1