aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp
diff options
context:
space:
mode:
authorDan Gohman <dan433584@gmail.com>2016-12-03 23:00:12 +0000
committerDan Gohman <dan433584@gmail.com>2016-12-03 23:00:12 +0000
commit66caac5735624f10a90921e43bb8c27eca58bee5 (patch)
treef8528f3eee049022347110bfcc204712695df366 /llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp
parent9c89ba7fa7179c1ae70a1da2995d1246e95720b3 (diff)
downloadllvm-66caac5735624f10a90921e43bb8c27eca58bee5.zip
llvm-66caac5735624f10a90921e43bb8c27eca58bee5.tar.gz
llvm-66caac5735624f10a90921e43bb8c27eca58bee5.tar.bz2
[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
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp
index 56b0f4f..04ede7f 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp
@@ -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>();