From ba276adab596bafe48a27dc02dcc5867446a52b5 Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Mon, 20 Apr 2015 10:19:02 -0700 Subject: LLVM < 3.5 is unsupported since bb18a3c --- src/rustllvm/PassWrapper.cpp | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'src/rustllvm/PassWrapper.cpp') diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp index b205d87598c..a2ab8040198 100644 --- a/src/rustllvm/PassWrapper.cpp +++ b/src/rustllvm/PassWrapper.cpp @@ -92,9 +92,6 @@ LLVMRustCreateTargetMachine(const char *triple, TargetOptions Options; Options.PositionIndependentExecutable = PositionIndependentExecutable; Options.NoFramePointerElim = NoFramePointerElim; -#if LLVM_VERSION_MINOR < 5 - Options.EnableSegmentedStacks = EnableSegmentedStacks; -#endif Options.FloatABIType = FloatABI::Default; Options.UseSoftFloat = UseSoftFloat; if (UseSoftFloat) { @@ -128,10 +125,8 @@ LLVMRustAddAnalysisPasses(LLVMTargetMachineRef TM, PassManagerBase *PM = unwrap(PMR); #if LLVM_VERSION_MINOR >= 6 PM->add(new DataLayoutPass()); -#elif LLVM_VERSION_MINOR == 5 - PM->add(new DataLayoutPass(unwrap(M))); #else - PM->add(new DataLayout(unwrap(M))); + PM->add(new DataLayoutPass(unwrap(M))); #endif unwrap(TM)->addAnalysisPasses(*PM); } @@ -202,10 +197,8 @@ LLVMRustWriteOutputFile(LLVMTargetMachineRef Target, raw_fd_ostream OS(path, EC, sys::fs::F_None); if (EC) ErrorInfo = EC.message(); -#elif LLVM_VERSION_MINOR >= 4 - raw_fd_ostream OS(path, ErrorInfo, sys::fs::F_None); #else - raw_fd_ostream OS(path, ErrorInfo, raw_fd_ostream::F_Binary); + raw_fd_ostream OS(path, ErrorInfo, sys::fs::F_None); #endif if (ErrorInfo != "") { LLVMRustSetLastError(ErrorInfo.c_str()); @@ -230,19 +223,13 @@ LLVMRustPrintModule(LLVMPassManagerRef PMR, raw_fd_ostream OS(path, EC, sys::fs::F_None); if (EC) ErrorInfo = EC.message(); -#elif LLVM_VERSION_MINOR >= 4 - raw_fd_ostream OS(path, ErrorInfo, sys::fs::F_None); #else - raw_fd_ostream OS(path, ErrorInfo, raw_fd_ostream::F_Binary); + raw_fd_ostream OS(path, ErrorInfo, sys::fs::F_None); #endif formatted_raw_ostream FOS(OS); -#if LLVM_VERSION_MINOR >= 5 PM->add(createPrintModulePass(FOS)); -#else - PM->add(createPrintModulePass(&FOS)); -#endif PM->run(*unwrap(M)); } -- cgit 1.4.1-3-g733a5