mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 11:02:59 +02:00
[WebAssembly] Eliminate an ad-hoc command-line argument.
Use the target triple to determine whether to run the explicit-locals pass, rather than using a separate command-line argument. llvm-svn: 288602
This commit is contained in:
parent
3523c1f6d4
commit
205bc689ab
@ -146,6 +146,11 @@ bool WebAssemblyExplicitLocals::runOnMachineFunction(MachineFunction &MF) {
|
||||
"********** Function: "
|
||||
<< MF.getName() << '\n');
|
||||
|
||||
// Disable this pass if we aren't doing direct wasm object emission.
|
||||
if (MF.getSubtarget<WebAssemblySubtarget>()
|
||||
.getTargetTriple().isOSBinFormatELF())
|
||||
return false;
|
||||
|
||||
bool Changed = false;
|
||||
MachineRegisterInfo &MRI = MF.getRegInfo();
|
||||
WebAssemblyFunctionInfo &MFI = *MF.getInfo<WebAssemblyFunctionInfo>();
|
||||
|
@ -41,11 +41,6 @@ static cl::opt<bool> EnableEmSjLj(
|
||||
cl::desc("WebAssembly Emscripten-style setjmp/longjmp handling"),
|
||||
cl::init(false));
|
||||
|
||||
static cl::opt<bool> ExplicitLocals(
|
||||
"wasm-explicit-locals",
|
||||
cl::desc("WebAssembly with explicit get_local/set_local"),
|
||||
cl::init(false));
|
||||
|
||||
extern "C" void LLVMInitializeWebAssemblyTarget() {
|
||||
// Register the target.
|
||||
RegisterTargetMachine<WebAssemblyTargetMachine> X(
|
||||
@ -262,8 +257,7 @@ void WebAssemblyPassConfig::addPreEmitPass() {
|
||||
}
|
||||
|
||||
// Insert explicit get_local and set_local operators.
|
||||
if (ExplicitLocals)
|
||||
addPass(createWebAssemblyExplicitLocals());
|
||||
addPass(createWebAssemblyExplicitLocals());
|
||||
|
||||
// Eliminate multiple-entry loops.
|
||||
addPass(createWebAssemblyFixIrreducibleControlFlow());
|
||||
|
Loading…
Reference in New Issue
Block a user