OLD | NEW |
1 //===-- X86TargetMachine.cpp - Define TargetMachine for the X86 -----------===// | 1 //===-- X86TargetMachine.cpp - Define TargetMachine for the X86 -----------===// |
2 // | 2 // |
3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // This file defines the X86 specific subclass of TargetMachine. | 10 // This file defines the X86 specific subclass of TargetMachine. |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 static std::unique_ptr<TargetLoweringObjectFile> createTLOF(const Triple &TT) { | 32 static std::unique_ptr<TargetLoweringObjectFile> createTLOF(const Triple &TT) { |
33 if (TT.isOSBinFormatMachO()) { | 33 if (TT.isOSBinFormatMachO()) { |
34 if (TT.getArch() == Triple::x86_64) | 34 if (TT.getArch() == Triple::x86_64) |
35 return make_unique<X86_64MachoTargetObjectFile>(); | 35 return make_unique<X86_64MachoTargetObjectFile>(); |
36 return make_unique<TargetLoweringObjectFileMachO>(); | 36 return make_unique<TargetLoweringObjectFileMachO>(); |
37 } | 37 } |
38 | 38 |
39 if (TT.isOSLinux()) | 39 if (TT.isOSLinux()) |
40 return make_unique<X86LinuxTargetObjectFile>(); | 40 return make_unique<X86LinuxTargetObjectFile>(); |
| 41 // @LOCALMOD-BEGIN |
| 42 if (TT.isOSNaCl()) |
| 43 return make_unique<TargetLoweringObjectFileNaCl>(); |
| 44 // @LOCALMOD-END |
41 if (TT.isOSBinFormatELF()) | 45 if (TT.isOSBinFormatELF()) |
42 return make_unique<TargetLoweringObjectFileELF>(); | 46 return make_unique<TargetLoweringObjectFileELF>(); |
43 if (TT.isKnownWindowsMSVCEnvironment()) | 47 if (TT.isKnownWindowsMSVCEnvironment()) |
44 return make_unique<X86WindowsTargetObjectFile>(); | 48 return make_unique<X86WindowsTargetObjectFile>(); |
45 if (TT.isOSBinFormatCOFF()) | 49 if (TT.isOSBinFormatCOFF()) |
46 return make_unique<TargetLoweringObjectFileCOFF>(); | 50 return make_unique<TargetLoweringObjectFileCOFF>(); |
47 llvm_unreachable("unknown subtarget type"); | 51 llvm_unreachable("unknown subtarget type"); |
48 } | 52 } |
49 | 53 |
50 /// X86TargetMachine ctor - Create an X86 target. | 54 /// X86TargetMachine ctor - Create an X86 target. |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 addPass(createX86IssueVZeroUpperPass()); | 212 addPass(createX86IssueVZeroUpperPass()); |
209 ShouldPrint = true; | 213 ShouldPrint = true; |
210 } | 214 } |
211 | 215 |
212 if (getOptLevel() != CodeGenOpt::None) { | 216 if (getOptLevel() != CodeGenOpt::None) { |
213 addPass(createX86PadShortFunctions()); | 217 addPass(createX86PadShortFunctions()); |
214 addPass(createX86FixupLEAs()); | 218 addPass(createX86FixupLEAs()); |
215 ShouldPrint = true; | 219 ShouldPrint = true; |
216 } | 220 } |
217 | 221 |
| 222 // @LOCALMOD-START |
| 223 if (getX86Subtarget().isTargetNaCl()) { |
| 224 addPass(createX86NaClRewritePass()); |
| 225 ShouldPrint = true; |
| 226 } |
| 227 // @LOCALMOD-END |
| 228 |
218 return ShouldPrint; | 229 return ShouldPrint; |
219 } | 230 } |
OLD | NEW |