forked from OSchip/llvm-project
parent
2783469566
commit
314ed201f3
|
@ -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);
|
||||
|
||||
|
|
|
@ -68,12 +68,12 @@ static Reloc::Model getEffectiveRelocModel(Optional<Reloc::Model> RM) {
|
|||
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()) :
|
||||
|
|
|
@ -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<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 *
|
||||
|
|
Loading…
Reference in New Issue