[llvm] r309922 - Fix WebAssembly target after r309911.

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 3 08:52:01 PDT 2017


Why is WebAssembly still considered experimental from LLVM's point of
view?

Cheers,
Rafael

Daniel Jasper via llvm-commits <llvm-commits at lists.llvm.org> writes:

> Author: djasper
> Date: Wed Aug  2 22:15:53 2017
> New Revision: 309922
>
> URL: http://llvm.org/viewvc/llvm-project?rev=309922&view=rev
> Log:
> Fix WebAssembly target after r309911.
>
> Modified:
>     llvm/trunk/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.cpp
>     llvm/trunk/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
>     llvm/trunk/lib/Target/WebAssembly/WebAssemblyTargetMachine.h
>
> Modified: llvm/trunk/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.cpp?rev=309922&r1=309921&r2=309922&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.cpp (original)
> +++ llvm/trunk/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.cpp Wed Aug  2 22:15:53 2017
> @@ -41,15 +41,6 @@ static MCAsmInfo *createMCAsmInfo(const
>    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 LLVMInitializeWebAssembl
>      // 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);
>  
>
> Modified: llvm/trunk/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp?rev=309922&r1=309921&r2=309922&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp (original)
> +++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp Wed Aug  2 22:15:53 2017
> @@ -68,12 +68,12 @@ static Reloc::Model getEffectiveRelocMod
>  WebAssemblyTargetMachine::WebAssemblyTargetMachine(
>      const Target &T, const Triple &TT, StringRef CPU, StringRef FS,
>      const TargetOptions &Options, Optional<Reloc::Model> RM,
> -    CodeModel::Model CM, CodeGenOpt::Level OL)
> +    Optional<CodeModel::Model> 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<TargetLoweringObjectFile*>(
>                    new WebAssemblyTargetObjectFileELF()) :
>
> Modified: llvm/trunk/lib/Target/WebAssembly/WebAssemblyTargetMachine.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/WebAssembly/WebAssemblyTargetMachine.h?rev=309922&r1=309921&r2=309922&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/WebAssembly/WebAssemblyTargetMachine.h (original)
> +++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyTargetMachine.h Wed Aug  2 22:15:53 2017
> @@ -28,8 +28,9 @@ class WebAssemblyTargetMachine final : p
>  public:
>    WebAssemblyTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
>                             StringRef FS, const TargetOptions &Options,
> -                           Optional<Reloc::Model> RM, CodeModel::Model CM,
> -                           CodeGenOpt::Level OL);
> +                           Optional<Reloc::Model> RM,
> +                           Optional<CodeModel::Model> CM, CodeGenOpt::Level OL,
> +                           bool JIT);
>  
>    ~WebAssemblyTargetMachine() override;
>    const WebAssemblySubtarget *
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits


More information about the llvm-commits mailing list