diff options
author | Ashley Nelson <nashley@google.com> | 2023-11-14 12:50:06 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-14 12:50:06 -0800 |
commit | 1c3a5be545299f289f17edada8620941376a3e00 (patch) | |
tree | 20c799a3761f4d69113259429a46541eb6e1cb37 | |
parent | 53e6e86d1e1d56dd39159fcfcefd9513c0f97079 (diff) | |
download | binaryen-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.cpp | 2 | ||||
-rw-r--r-- | src/passes/passes.h | 5 |
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(); |