@@ -112,22 +112,22 @@ extern "C" LLVM_C_ABI void LLVMInitializeX86Target() {
112
112
113
113
static std::unique_ptr<TargetLoweringObjectFile> createTLOF (const Triple &TT) {
114
114
if (TT.isOSBinFormatMachO ()) {
115
- if (TT.getArch () == Triple::x86_64 )
115
+ if (TT.isX86_64 () )
116
116
return std::make_unique<X86_64MachoTargetObjectFile>();
117
117
return std::make_unique<TargetLoweringObjectFileMachO>();
118
118
}
119
119
120
120
if (TT.isOSBinFormatCOFF ())
121
121
return std::make_unique<TargetLoweringObjectFileCOFF>();
122
122
123
- if (TT.getArch () == Triple::x86_64 )
123
+ if (TT.isX86_64 () )
124
124
return std::make_unique<X86_64ELFTargetObjectFile>();
125
125
return std::make_unique<X86ELFTargetObjectFile>();
126
126
}
127
127
128
128
static Reloc::Model getEffectiveRelocModel (const Triple &TT, bool JIT,
129
129
std::optional<Reloc::Model> RM) {
130
- bool is64Bit = TT.getArch () == Triple::x86_64 ;
130
+ bool is64Bit = TT.isX86_64 () ;
131
131
if (!RM) {
132
132
// JIT codegen should use static relocations by default, since it's
133
133
// typically executed in process and not relocatable.
@@ -169,7 +169,7 @@ static Reloc::Model getEffectiveRelocModel(const Triple &TT, bool JIT,
169
169
static CodeModel::Model
170
170
getEffectiveX86CodeModel (const Triple &TT, std::optional<CodeModel::Model> CM,
171
171
bool JIT) {
172
- bool Is64Bit = TT.getArch () == Triple::x86_64 ;
172
+ bool Is64Bit = TT.isX86_64 () ;
173
173
if (CM) {
174
174
if (*CM == CodeModel::Tiny)
175
175
reportFatalUsageError (" target does not support the tiny CodeModel" );
@@ -440,7 +440,7 @@ void X86PassConfig::addIRPasses() {
440
440
// Add Control Flow Guard checks.
441
441
const Triple &TT = TM->getTargetTriple ();
442
442
if (TT.isOSWindows ()) {
443
- if (TT.getArch () == Triple::x86_64 ) {
443
+ if (TT.isX86_64 () ) {
444
444
addPass (createCFGuardDispatchPass ());
445
445
} else {
446
446
addPass (createCFGuardCheckPass ());
@@ -499,7 +499,7 @@ bool X86PassConfig::addILPOpts() {
499
499
bool X86PassConfig::addPreISel () {
500
500
// Only add this pass for 32-bit x86 Windows.
501
501
const Triple &TT = TM->getTargetTriple ();
502
- if (TT.isOSWindows () && TT.getArch () == Triple::x86 )
502
+ if (TT.isOSWindows () && TT.isX86_32 () )
503
503
addPass (createX86WinEHStatePass ());
504
504
return true ;
505
505
}
@@ -588,7 +588,7 @@ void X86PassConfig::addPreEmitPass2() {
588
588
589
589
// Insert extra int3 instructions after trailing call instructions to avoid
590
590
// issues in the unwinder.
591
- if (TT.isOSWindows () && TT.getArch () == Triple::x86_64 )
591
+ if (TT.isOSWindows () && TT.isX86_64 () )
592
592
addPass (createX86AvoidTrailingCallPass ());
593
593
594
594
// Verify basic block incoming and outgoing cfa offset and register values and
@@ -625,7 +625,7 @@ void X86PassConfig::addPreEmitPass2() {
625
625
626
626
// Analyzes and emits pseudos to support Win x64 Unwind V2. This pass must run
627
627
// after all real instructions have been added to the epilog.
628
- if (TT.isOSWindows () && ( TT.getArch () == Triple::x86_64 ))
628
+ if (TT.isOSWindows () && TT.isX86_64 ( ))
629
629
addPass (createX86WinEHUnwindV2Pass ());
630
630
}
631
631
0 commit comments