@@ -112,22 +112,22 @@ extern "C" LLVM_C_ABI void LLVMInitializeX86Target() {
112112
113113static std::unique_ptr<TargetLoweringObjectFile> createTLOF (const Triple &TT) {
114114 if (TT.isOSBinFormatMachO ()) {
115- if (TT.getArch () == Triple::x86_64 )
115+ if (TT.isX86_64 () )
116116 return std::make_unique<X86_64MachoTargetObjectFile>();
117117 return std::make_unique<TargetLoweringObjectFileMachO>();
118118 }
119119
120120 if (TT.isOSBinFormatCOFF ())
121121 return std::make_unique<TargetLoweringObjectFileCOFF>();
122122
123- if (TT.getArch () == Triple::x86_64 )
123+ if (TT.isX86_64 () )
124124 return std::make_unique<X86_64ELFTargetObjectFile>();
125125 return std::make_unique<X86ELFTargetObjectFile>();
126126}
127127
128128static Reloc::Model getEffectiveRelocModel (const Triple &TT, bool JIT,
129129 std::optional<Reloc::Model> RM) {
130- bool is64Bit = TT.getArch () == Triple::x86_64 ;
130+ bool is64Bit = TT.isX86_64 () ;
131131 if (!RM) {
132132 // JIT codegen should use static relocations by default, since it's
133133 // typically executed in process and not relocatable.
@@ -169,7 +169,7 @@ static Reloc::Model getEffectiveRelocModel(const Triple &TT, bool JIT,
169169static CodeModel::Model
170170getEffectiveX86CodeModel (const Triple &TT, std::optional<CodeModel::Model> CM,
171171 bool JIT) {
172- bool Is64Bit = TT.getArch () == Triple::x86_64 ;
172+ bool Is64Bit = TT.isX86_64 () ;
173173 if (CM) {
174174 if (*CM == CodeModel::Tiny)
175175 reportFatalUsageError (" target does not support the tiny CodeModel" );
@@ -440,7 +440,7 @@ void X86PassConfig::addIRPasses() {
440440 // Add Control Flow Guard checks.
441441 const Triple &TT = TM->getTargetTriple ();
442442 if (TT.isOSWindows ()) {
443- if (TT.getArch () == Triple::x86_64 ) {
443+ if (TT.isX86_64 () ) {
444444 addPass (createCFGuardDispatchPass ());
445445 } else {
446446 addPass (createCFGuardCheckPass ());
@@ -499,7 +499,7 @@ bool X86PassConfig::addILPOpts() {
499499bool X86PassConfig::addPreISel () {
500500 // Only add this pass for 32-bit x86 Windows.
501501 const Triple &TT = TM->getTargetTriple ();
502- if (TT.isOSWindows () && TT.getArch () == Triple::x86 )
502+ if (TT.isOSWindows () && TT.isX86_32 () )
503503 addPass (createX86WinEHStatePass ());
504504 return true ;
505505}
@@ -588,7 +588,7 @@ void X86PassConfig::addPreEmitPass2() {
588588
589589 // Insert extra int3 instructions after trailing call instructions to avoid
590590 // issues in the unwinder.
591- if (TT.isOSWindows () && TT.getArch () == Triple::x86_64 )
591+ if (TT.isOSWindows () && TT.isX86_64 () )
592592 addPass (createX86AvoidTrailingCallPass ());
593593
594594 // Verify basic block incoming and outgoing cfa offset and register values and
@@ -625,7 +625,7 @@ void X86PassConfig::addPreEmitPass2() {
625625
626626 // Analyzes and emits pseudos to support Win x64 Unwind V2. This pass must run
627627 // 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 ( ))
629629 addPass (createX86WinEHUnwindV2Pass ());
630630}
631631
0 commit comments