summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshley Nelson <nashley@google.com>2023-11-14 12:50:06 -0800
committerGitHub <noreply@github.com>2023-11-14 12:50:06 -0800
commit1c3a5be545299f289f17edada8620941376a3e00 (patch)
tree20c799a3761f4d69113259429a46541eb6e1cb37
parent53e6e86d1e1d56dd39159fcfcefd9513c0f97079 (diff)
downloadbinaryen-1c3a5be545299f289f17edada8620941376a3e00.tar.gz
binaryen-1c3a5be545299f289f17edada8620941376a3e00.tar.bz2
binaryen-1c3a5be545299f289f17edada8620941376a3e00.zip
[Outlining] Add SKIP_OUTLINING macro
Allow outlining to be excluded from the command line on non-Emscripten builds.
-rw-r--r--src/passes/pass.cpp2
-rw-r--r--src/passes/passes.h5
2 files changed, 5 insertions, 2 deletions
diff --git a/src/passes/pass.cpp b/src/passes/pass.cpp
index c18f47ac7..38b6c73a6 100644
--- a/src/passes/pass.cpp
+++ b/src/passes/pass.cpp
@@ -313,7 +313,7 @@ void PassRegistry::registerPasses() {
"optimize-stack-ir", "optimize Stack IR", createOptimizeStackIRPass);
// Outlining currently relies on LLVM's SuffixTree, which we can't rely upon
// when building Binaryen for Emscripten.
-#ifndef __EMSCRIPTEN__
+#ifndef SKIP_OUTLINING
registerPass("outlining", "outline instructions", createOutliningPass);
#endif
registerPass("pick-load-signs",
diff --git a/src/passes/passes.h b/src/passes/passes.h
index 3d1aa0bfd..b0b42d5de 100644
--- a/src/passes/passes.h
+++ b/src/passes/passes.h
@@ -101,7 +101,10 @@ Pass* createOptimizeForJSPass();
Pass* createOptimizeStackIRPass();
// Outlining currently relies on LLVM's SuffixTree, which we can't rely upon
// when building Binaryen for Emscripten.
-#ifndef __EMSCRIPTEN__
+#ifdef __EMSCRIPTEN__
+#define SKIP_OUTLINING
+#endif
+#ifndef SKIP_OUTLINING
Pass* createOutliningPass();
#endif
Pass* createPickLoadSignsPass();