|
17 | 17 |
|
18 | 18 | #include "llvm/Analysis/TargetLibraryInfo.h" |
19 | 19 | #include "llvm/Analysis/TargetTransformInfo.h" |
| 20 | +#include "llvm/CodeGen/TargetSubtargetInfo.h" |
20 | 21 | #include "llvm/IR/AutoUpgrade.h" |
21 | 22 | #include "llvm/IR/AssemblyAnnotationWriter.h" |
| 23 | +#include "llvm/IR/IntrinsicInst.h" |
22 | 24 | #include "llvm/Support/CBindingWrapping.h" |
23 | 25 | #include "llvm/Support/FileSystem.h" |
24 | 26 | #include "llvm/Support/Host.h" |
25 | 27 | #include "llvm/Target/TargetMachine.h" |
26 | 28 | #include "llvm/Transforms/IPO/PassManagerBuilder.h" |
27 | | - |
28 | | -#if LLVM_VERSION_GE(6, 0) |
29 | | -#include "llvm/CodeGen/TargetSubtargetInfo.h" |
30 | | -#include "llvm/IR/IntrinsicInst.h" |
31 | | -#else |
32 | | -#include "llvm/Target/TargetSubtargetInfo.h" |
33 | | -#endif |
34 | | - |
35 | 29 | #include "llvm/Transforms/IPO/AlwaysInliner.h" |
36 | 30 | #include "llvm/Transforms/IPO/FunctionImport.h" |
37 | 31 | #include "llvm/Transforms/Utils/FunctionImportUtils.h" |
@@ -198,13 +192,9 @@ GEN_SUBTARGETS |
198 | 192 |
|
199 | 193 | extern "C" bool LLVMRustHasFeature(LLVMTargetMachineRef TM, |
200 | 194 | const char *Feature) { |
201 | | -#if LLVM_VERSION_GE(6, 0) |
202 | 195 | TargetMachine *Target = unwrap(TM); |
203 | 196 | const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo(); |
204 | 197 | return MCInfo->checkFeatures(std::string("+") + Feature); |
205 | | -#else |
206 | | - return false; |
207 | | -#endif |
208 | 198 | } |
209 | 199 |
|
210 | 200 | enum class LLVMRustCodeModel { |
@@ -392,13 +382,9 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine( |
392 | 382 | Options.ThreadModel = ThreadModel::Single; |
393 | 383 | } |
394 | 384 |
|
395 | | -#if LLVM_VERSION_GE(6, 0) |
396 | 385 | Options.EmitStackSizeSection = EmitStackSizeSection; |
397 | 386 |
|
398 | 387 | Optional<CodeModel::Model> CM; |
399 | | -#else |
400 | | - CodeModel::Model CM = CodeModel::Model::Default; |
401 | | -#endif |
402 | 388 | if (RustCM != LLVMRustCodeModel::None) |
403 | 389 | CM = fromRust(RustCM); |
404 | 390 | TargetMachine *TM = TheTarget->createTargetMachine( |
|
0 commit comments