Skip to content

Commit 1f7c3d6

Browse files
authored
[X86] getEffectiveX86CodeModel - take a Triple argument instead of just a Is64Bit flag. NFC. (#87479)
Matches what most other targets do and makes it easier to specify code model based off other triple settings in the future.
1 parent d650fcd commit 1f7c3d6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llvm/lib/Target/X86/X86TargetMachine.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,9 @@ static Reloc::Model getEffectiveRelocModel(const Triple &TT, bool JIT,
211211
}
212212

213213
static CodeModel::Model
214-
getEffectiveX86CodeModel(std::optional<CodeModel::Model> CM, bool JIT,
215-
bool Is64Bit) {
214+
getEffectiveX86CodeModel(const Triple &TT, std::optional<CodeModel::Model> CM,
215+
bool JIT) {
216+
bool Is64Bit = TT.getArch() == Triple::x86_64;
216217
if (CM) {
217218
if (*CM == CodeModel::Tiny)
218219
report_fatal_error("Target does not support the tiny CodeModel", false);
@@ -234,7 +235,7 @@ X86TargetMachine::X86TargetMachine(const Target &T, const Triple &TT,
234235
: LLVMTargetMachine(
235236
T, computeDataLayout(TT), TT, CPU, FS, Options,
236237
getEffectiveRelocModel(TT, JIT, RM),
237-
getEffectiveX86CodeModel(CM, JIT, TT.getArch() == Triple::x86_64),
238+
getEffectiveX86CodeModel(TT, CM, JIT),
238239
OL),
239240
TLOF(createTLOF(getTargetTriple())), IsJIT(JIT) {
240241
// On PS4/PS5, the "return address" of a 'noreturn' call must still be within

0 commit comments

Comments
 (0)