From 044eb2f6afba375a914ac9d8024f8f5142bb912e Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 18 Dec 2017 20:10:56 +0000 Subject: Vendor import of llvm trunk r321017: https://llvm.org/svn/llvm-project/llvm/trunk@321017 --- lib/Target/AVR/AVRTargetMachine.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'lib/Target/AVR/AVRTargetMachine.cpp') diff --git a/lib/Target/AVR/AVRTargetMachine.cpp b/lib/Target/AVR/AVRTargetMachine.cpp index e698b6e694cf..f9a738b2182c 100644 --- a/lib/Target/AVR/AVRTargetMachine.cpp +++ b/lib/Target/AVR/AVRTargetMachine.cpp @@ -40,14 +40,21 @@ static Reloc::Model getEffectiveRelocModel(Optional RM) { return RM.hasValue() ? *RM : Reloc::Static; } +static CodeModel::Model getEffectiveCodeModel(Optional CM) { + if (CM) + return *CM; + return CodeModel::Small; +} + AVRTargetMachine::AVRTargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, - Optional RM, CodeModel::Model CM, - CodeGenOpt::Level OL) - : LLVMTargetMachine( - T, AVRDataLayout, TT, - getCPU(CPU), FS, Options, getEffectiveRelocModel(RM), CM, OL), + Optional RM, + Optional CM, + 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(); initAsmInfo(); @@ -81,7 +88,6 @@ extern "C" void LLVMInitializeAVRTarget() { auto &PR = *PassRegistry::getPassRegistry(); initializeAVRExpandPseudoPass(PR); - initializeAVRInstrumentFunctionsPass(PR); initializeAVRRelaxMemPass(PR); } -- cgit v1.3