diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2024-04-03 15:06:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-03 15:06:54 +0100 |
commit | 1f7c3d609b01d0cf2a0b973cc17a9b0bca8e56b5 (patch) | |
tree | e3ed618aa765d765f4a995cb4116c7c4c1f85824 | |
parent | d650fcd6bf1323513213dd69eacbb2b08c870618 (diff) | |
download | llvm-1f7c3d609b01d0cf2a0b973cc17a9b0bca8e56b5.zip llvm-1f7c3d609b01d0cf2a0b973cc17a9b0bca8e56b5.tar.gz llvm-1f7c3d609b01d0cf2a0b973cc17a9b0bca8e56b5.tar.bz2 |
[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.
-rw-r--r-- | llvm/lib/Target/X86/X86TargetMachine.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Target/X86/X86TargetMachine.cpp b/llvm/lib/Target/X86/X86TargetMachine.cpp index 276bc7f..86b4560 100644 --- a/llvm/lib/Target/X86/X86TargetMachine.cpp +++ b/llvm/lib/Target/X86/X86TargetMachine.cpp @@ -211,8 +211,9 @@ static Reloc::Model getEffectiveRelocModel(const Triple &TT, bool JIT, } static CodeModel::Model -getEffectiveX86CodeModel(std::optional<CodeModel::Model> CM, bool JIT, - bool Is64Bit) { +getEffectiveX86CodeModel(const Triple &TT, std::optional<CodeModel::Model> CM, + bool JIT) { + bool Is64Bit = TT.getArch() == Triple::x86_64; if (CM) { if (*CM == CodeModel::Tiny) report_fatal_error("Target does not support the tiny CodeModel", false); @@ -234,7 +235,7 @@ X86TargetMachine::X86TargetMachine(const Target &T, const Triple &TT, : LLVMTargetMachine( T, computeDataLayout(TT), TT, CPU, FS, Options, getEffectiveRelocModel(TT, JIT, RM), - getEffectiveX86CodeModel(CM, JIT, TT.getArch() == Triple::x86_64), + getEffectiveX86CodeModel(TT, CM, JIT), OL), TLOF(createTLOF(getTargetTriple())), IsJIT(JIT) { // On PS4/PS5, the "return address" of a 'noreturn' call must still be within |