summaryrefslogtreecommitdiff
path: root/lib/Target/X86/MCTargetDesc
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2017-08-03 02:16:21 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2017-08-03 02:16:21 +0000
commit9aafb854cc7cb8df8338c50cb411a54ce1e09796 (patch)
tree904ca934d72726b3c0e0736d9027056ee11751a7 /lib/Target/X86/MCTargetDesc
parent65d41d8235523f0913767507b6c816e16caa2594 (diff)
Delete Default and JITDefault code models
IMHO it is an antipattern to have a enum value that is Default. At any given piece of code it is not clear if we have to handle Default or if has already been mapped to a concrete value. In this case in particular, only the target can do the mapping and it is nice to make sure it is always done. This deletes the two default enum values of CodeModel and uses an explicit Optional<CodeModel> when it is possible that it is unspecified. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309911 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/MCTargetDesc')
-rw-r--r--lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp15
1 files changed, 0 insertions, 15 deletions
diff --git a/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp b/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp
index 22cb0fac33c..b33d895520b 100644
--- a/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp
+++ b/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp
@@ -198,18 +198,6 @@ static MCAsmInfo *createX86MCAsmInfo(const MCRegisterInfo &MRI,
return MAI;
}
-static void adjustCodeGenOpts(const Triple &TT, Reloc::Model RM,
- CodeModel::Model &CM) {
- bool is64Bit = TT.getArch() == Triple::x86_64;
-
- // For static codegen, if we're not already set, use Small codegen.
- if (CM == CodeModel::Default)
- CM = CodeModel::Small;
- else if (CM == CodeModel::JITDefault)
- // 64-bit JIT places everything in the same buffer except external funcs.
- CM = is64Bit ? CodeModel::Large : CodeModel::Small;
-}
-
static MCInstPrinter *createX86MCInstPrinter(const Triple &T,
unsigned SyntaxVariant,
const MCAsmInfo &MAI,
@@ -238,9 +226,6 @@ extern "C" void LLVMInitializeX86TargetMC() {
// Register the MC asm info.
RegisterMCAsmInfoFn X(*T, createX86MCAsmInfo);
- // Register the MC codegen info.
- RegisterMCAdjustCodeGenOptsFn Y(*T, adjustCodeGenOpts);
-
// Register the MC instruction info.
TargetRegistry::RegisterMCInstrInfo(*T, createX86MCInstrInfo);