From dfd6a10efb6d20ab543db8769d89ccbb1663de45 Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Thu, 3 Aug 2017 05:15:53 +0000 Subject: [PATCH] Fix WebAssembly target after r309911. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309922 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../MCTargetDesc/WebAssemblyMCTargetDesc.cpp | 12 ------------ lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp | 4 ++-- lib/Target/WebAssembly/WebAssemblyTargetMachine.h | 5 +++-- 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.cpp b/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.cpp index 9580eeaa33d..18de4273d1d 100644 --- a/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.cpp +++ b/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.cpp @@ -41,15 +41,6 @@ static MCAsmInfo *createMCAsmInfo(const MCRegisterInfo & /*MRI*/, return new WebAssemblyMCAsmInfo(TT); } -static void adjustCodeGenOpts(const Triple & /*TT*/, Reloc::Model /*RM*/, - CodeModel::Model &CM) { - CodeModel::Model M = (CM == CodeModel::Default || CM == CodeModel::JITDefault) - ? CodeModel::Large - : CM; - if (M != CodeModel::Large) - report_fatal_error("Non-large code models are not supported yet"); -} - static MCInstrInfo *createMCInstrInfo() { MCInstrInfo *X = new MCInstrInfo(); InitWebAssemblyMCInstrInfo(X); @@ -115,9 +106,6 @@ extern "C" void LLVMInitializeWebAssemblyTargetMC() { // Register the MC instruction info. TargetRegistry::RegisterMCInstrInfo(*T, createMCInstrInfo); - // Register the MC codegen info. - TargetRegistry::registerMCAdjustCodeGenOpts(*T, adjustCodeGenOpts); - // Register the MC register info. TargetRegistry::RegisterMCRegInfo(*T, createMCRegisterInfo); diff --git a/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp b/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp index 7b05f671bdc..8ad74d9db7b 100644 --- a/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp +++ b/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp @@ -68,12 +68,12 @@ static Reloc::Model getEffectiveRelocModel(Optional RM) { WebAssemblyTargetMachine::WebAssemblyTargetMachine( const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Optional RM, - CodeModel::Model CM, CodeGenOpt::Level OL) + Optional CM, CodeGenOpt::Level OL, bool JIT) : LLVMTargetMachine(T, TT.isArch64Bit() ? "e-m:e-p:64:64-i64:64-n32:64-S128" : "e-m:e-p:32:32-i64:64-n32:64-S128", TT, CPU, FS, Options, getEffectiveRelocModel(RM), - CM, OL), + CM ? *CM : CodeModel::Large, OL), TLOF(TT.isOSBinFormatELF() ? static_cast( new WebAssemblyTargetObjectFileELF()) : diff --git a/lib/Target/WebAssembly/WebAssemblyTargetMachine.h b/lib/Target/WebAssembly/WebAssemblyTargetMachine.h index 52a2ef78736..22484952651 100644 --- a/lib/Target/WebAssembly/WebAssemblyTargetMachine.h +++ b/lib/Target/WebAssembly/WebAssemblyTargetMachine.h @@ -28,8 +28,9 @@ class WebAssemblyTargetMachine final : public LLVMTargetMachine { public: WebAssemblyTargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, - Optional RM, CodeModel::Model CM, - CodeGenOpt::Level OL); + Optional RM, + Optional CM, CodeGenOpt::Level OL, + bool JIT); ~WebAssemblyTargetMachine() override; const WebAssemblySubtarget * -- 2.50.1