return RM.hasValue() ? *RM : Reloc::Static;
}
+static CodeModel::Model getEffectiveCodeModel(Optional<CodeModel::Model> CM) {
+ if (CM)
+ return *CM;
+ return CodeModel::Small;
+}
+
AVRTargetMachine::AVRTargetMachine(const Target &T, const Triple &TT,
StringRef CPU, StringRef FS,
const TargetOptions &Options,
Optional<Reloc::Model> RM,
Optional<CodeModel::Model> CM,
- CodeGenOpt::Level OL,
- bool JIT)
- : LLVMTargetMachine(
- T, AVRDataLayout, TT,
- getCPU(CPU), FS, Options, getEffectiveRelocModel(RM),
- CM, OL),
+ CodeGenOpt::Level OL, bool JIT)
+ : LLVMTargetMachine(T, AVRDataLayout, TT, getCPU(CPU), FS, Options,
+ getEffectiveRelocModel(RM), getEffectiveCodeModel(CM),
+ OL),
SubTarget(TT, getCPU(CPU), FS, *this) {
this->TLOF = make_unique<AVRTargetObjectFile>();
initAsmInfo();