mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 05:01:59 +01:00
[WebAssembly] Update WebAssembly target for r269988.
llvm-svn: 270017
This commit is contained in:
parent
4a761c4c76
commit
bb2c8e5fad
@ -39,16 +39,23 @@ extern "C" void LLVMInitializeWebAssemblyTarget() {
|
|||||||
// WebAssembly Lowering public interface.
|
// WebAssembly Lowering public interface.
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
static Reloc::Model getEffectiveRelocModel(Optional<Reloc::Model> RM) {
|
||||||
|
if (!RM.hasValue())
|
||||||
|
return Reloc::PIC_;
|
||||||
|
return *RM;
|
||||||
|
}
|
||||||
|
|
||||||
/// Create an WebAssembly architecture model.
|
/// Create an WebAssembly architecture model.
|
||||||
///
|
///
|
||||||
WebAssemblyTargetMachine::WebAssemblyTargetMachine(
|
WebAssemblyTargetMachine::WebAssemblyTargetMachine(
|
||||||
const Target &T, const Triple &TT, StringRef CPU, StringRef FS,
|
const Target &T, const Triple &TT, StringRef CPU, StringRef FS,
|
||||||
const TargetOptions &Options, Reloc::Model RM, CodeModel::Model CM,
|
const TargetOptions &Options, Optional<Reloc::Model> RM,
|
||||||
CodeGenOpt::Level OL)
|
CodeModel::Model CM, CodeGenOpt::Level OL)
|
||||||
: LLVMTargetMachine(T,
|
: LLVMTargetMachine(T,
|
||||||
TT.isArch64Bit() ? "e-m:e-p:64:64-i64:64-n32:64-S128"
|
TT.isArch64Bit() ? "e-m:e-p:64:64-i64:64-n32:64-S128"
|
||||||
: "e-m:e-p:32:32-i64:64-n32:64-S128",
|
: "e-m:e-p:32:32-i64:64-n32:64-S128",
|
||||||
TT, CPU, FS, Options, RM, CM, OL),
|
TT, CPU, FS, Options, getEffectiveRelocModel(RM),
|
||||||
|
CM, OL),
|
||||||
TLOF(make_unique<WebAssemblyTargetObjectFile>()) {
|
TLOF(make_unique<WebAssemblyTargetObjectFile>()) {
|
||||||
// WebAssembly type-checks expressions, but a noreturn function with a return
|
// WebAssembly type-checks expressions, but a noreturn function with a return
|
||||||
// type that doesn't match the context will cause a check failure. So we lower
|
// type that doesn't match the context will cause a check failure. So we lower
|
||||||
|
@ -28,7 +28,7 @@ class WebAssemblyTargetMachine final : public LLVMTargetMachine {
|
|||||||
public:
|
public:
|
||||||
WebAssemblyTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
|
WebAssemblyTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
|
||||||
StringRef FS, const TargetOptions &Options,
|
StringRef FS, const TargetOptions &Options,
|
||||||
Reloc::Model RM, CodeModel::Model CM,
|
Optional<Reloc::Model> RM, CodeModel::Model CM,
|
||||||
CodeGenOpt::Level OL);
|
CodeGenOpt::Level OL);
|
||||||
|
|
||||||
~WebAssemblyTargetMachine() override;
|
~WebAssemblyTargetMachine() override;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user