diff options
| author | Jonathan Turner <jonathandturner@users.noreply.github.com> | 2016-09-26 17:29:49 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-09-26 17:29:49 -0700 |
| commit | 816f1477bbcf591c0cce20f92824606412ed3c5b (patch) | |
| tree | 4c313f48d3a2fa6fc4b72fa66895a1311c49821f /src/rustllvm/PassWrapper.cpp | |
| parent | ee2e115995bdb485cfe2ee71e66cca29206714c4 (diff) | |
| parent | e6e117c33ac16d2dc0a852bbc8809e5b23fa8c7b (diff) | |
| download | rust-816f1477bbcf591c0cce20f92824606412ed3c5b.tar.gz rust-816f1477bbcf591c0cce20f92824606412ed3c5b.zip | |
Rollup merge of #36742 - shepmaster:llvm-4-preamble, r=alexcrichton
Extend preprocessor LLVM version checks to support LLVM 4.x This doesn't actually do anything for LLVM 4.x yet, but sets the stage.
Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
| -rw-r--r-- | src/rustllvm/PassWrapper.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp index a271987210b..60093e9bd37 100644 --- a/src/rustllvm/PassWrapper.cpp +++ b/src/rustllvm/PassWrapper.cpp @@ -46,7 +46,7 @@ LLVMInitializePasses() { initializeVectorization(Registry); initializeIPO(Registry); initializeAnalysis(Registry); -#if LLVM_VERSION_MINOR == 7 +#if LLVM_VERSION_EQ(3, 7) initializeIPA(Registry); #endif initializeTransformUtils(Registry); @@ -297,7 +297,7 @@ LLVMRustCreateTargetMachine(const char *triple, bool FunctionSections, bool DataSections) { -#if LLVM_VERSION_MINOR <= 8 +#if LLVM_VERSION_LE(3, 8) Reloc::Model RM; #else Optional<Reloc::Model> RM; @@ -316,7 +316,7 @@ LLVMRustCreateTargetMachine(const char *triple, RM = Reloc::DynamicNoPIC; break; default: -#if LLVM_VERSION_MINOR <= 8 +#if LLVM_VERSION_LE(3, 8) RM = Reloc::Default; #endif break; @@ -337,7 +337,7 @@ LLVMRustCreateTargetMachine(const char *triple, } TargetOptions Options; -#if LLVM_VERSION_MINOR <= 8 +#if LLVM_VERSION_LE(3, 8) Options.PositionIndependentExecutable = PositionIndependentExecutable; #endif @@ -539,7 +539,7 @@ extern "C" void LLVMRustRunRestrictionPass(LLVMModuleRef M, char **symbols, size_t len) { llvm::legacy::PassManager passes; -#if LLVM_VERSION_MINOR <= 8 +#if LLVM_VERSION_LE(3, 8) ArrayRef<const char*> ref(symbols, len); passes.add(llvm::createInternalizePass(ref)); #else @@ -593,7 +593,7 @@ LLVMRustGetModuleDataLayout(LLVMModuleRef M) { extern "C" void LLVMRustSetModulePIELevel(LLVMModuleRef M) { -#if LLVM_VERSION_MINOR >= 9 +#if LLVM_VERSION_GE(3, 9) unwrap(M)->setPIELevel(PIELevel::Level::Large); #endif } |
