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 | ca29c271d2b951b125b7f97264ca7b927db0b1cf (patch) | |
tree | 0c576a9c69d06179da070a855a87d460b62e4003 /llvm/lib/Target/RISCV/RISCVTargetMachine.cpp | |
parent | 700a29a153039c6176efaf7a3b7c0a274b8aafed (diff) | |
download | llvm-ca29c271d2b951b125b7f97264ca7b927db0b1cf.zip llvm-ca29c271d2b951b125b7f97264ca7b927db0b1cf.tar.gz llvm-ca29c271d2b951b125b7f97264ca7b927db0b1cf.tar.bz2 |
[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
llvm-svn: 348585
Diffstat (limited to 'llvm/lib/Target/RISCV/RISCVTargetMachine.cpp')
-rw-r--r-- | llvm/lib/Target/RISCV/RISCVTargetMachine.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/llvm/lib/Target/RISCV/RISCVTargetMachine.cpp b/llvm/lib/Target/RISCV/RISCVTargetMachine.cpp index e75da76..8937ec2 100644 --- a/llvm/lib/Target/RISCV/RISCVTargetMachine.cpp +++ b/llvm/lib/Target/RISCV/RISCVTargetMachine.cpp @@ -47,12 +47,6 @@ static Reloc::Model getEffectiveRelocModel(const Triple &TT, return *RM; } -static CodeModel::Model getEffectiveCodeModel(Optional<CodeModel::Model> CM) { - if (CM) - return *CM; - return CodeModel::Small; -} - RISCVTargetMachine::RISCVTargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, @@ -61,7 +55,7 @@ RISCVTargetMachine::RISCVTargetMachine(const Target &T, const Triple &TT, CodeGenOpt::Level OL, bool JIT) : LLVMTargetMachine(T, computeDataLayout(TT), TT, CPU, FS, Options, getEffectiveRelocModel(TT, RM), - getEffectiveCodeModel(CM), OL), + getEffectiveCodeModel(CM, CodeModel::Small), OL), TLOF(make_unique<RISCVELFTargetObjectFile>()), Subtarget(TT, CPU, FS, *this) { initAsmInfo(); |