diff options
author | David Green <david.green@arm.com> | 2018-12-07 12:10:23 +0000 |
---|---|---|
committer | David Green <david.green@arm.com> | 2018-12-07 12:10:23 +0000 |
commit | 18cb958e452b870589b7527b80a83eca7f650794 (patch) | |
tree | 69bae0bab929838c331d75c83c95c66af4524e5e /llvm/lib/Target/Lanai | |
parent | 14d06c73126fafcb5d73291072cab8ff70312475 (diff) |
[Targets] Add errors for tiny and kernel codemodel on targets that don't support them
Adds fatal errors for any target that does not support the Tiny or Kernel
codemodels by rejigging the getEffectiveCodeModel calls.
Differential Revision: https://reviews.llvm.org/D50141
Diffstat (limited to 'llvm/lib/Target/Lanai')
-rw-r--r-- | llvm/lib/Target/Lanai/LanaiTargetMachine.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/llvm/lib/Target/Lanai/LanaiTargetMachine.cpp b/llvm/lib/Target/Lanai/LanaiTargetMachine.cpp index 2c21a53b13b..10bd9e2c65d 100644 --- a/llvm/lib/Target/Lanai/LanaiTargetMachine.cpp +++ b/llvm/lib/Target/Lanai/LanaiTargetMachine.cpp @@ -53,12 +53,6 @@ static Reloc::Model getEffectiveRelocModel(Optional<Reloc::Model> RM) { return *RM; } -static CodeModel::Model getEffectiveCodeModel(Optional<CodeModel::Model> CM) { - if (CM) - return *CM; - return CodeModel::Medium; -} - LanaiTargetMachine::LanaiTargetMachine(const Target &T, const Triple &TT, StringRef Cpu, StringRef FeatureString, const TargetOptions &Options, @@ -67,7 +61,8 @@ LanaiTargetMachine::LanaiTargetMachine(const Target &T, const Triple &TT, CodeGenOpt::Level OptLevel, bool JIT) : LLVMTargetMachine(T, computeDataLayout(), TT, Cpu, FeatureString, Options, getEffectiveRelocModel(RM), - getEffectiveCodeModel(CodeModel), OptLevel), + getEffectiveCodeModel(CodeModel, CodeModel::Medium), + OptLevel), Subtarget(TT, Cpu, FeatureString, *this, Options, getCodeModel(), OptLevel), TLOF(new LanaiTargetObjectFile()) { |