diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-05-05 09:41:01 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-05-05 10:26:01 -0700 |
commit | 715d1becddcb89c49d71aa19e62ed27f967e5860 (patch) | |
tree | 546dd534511b228a9b46c9d1b491db3a335cad80 /src/binaryen-c.cpp | |
parent | 9afdb5e5512ae4c9c23d7f2d41a35e63ecc3a0f5 (diff) | |
download | binaryen-715d1becddcb89c49d71aa19e62ed27f967e5860.tar.gz binaryen-715d1becddcb89c49d71aa19e62ed27f967e5860.tar.bz2 binaryen-715d1becddcb89c49d71aa19e62ed27f967e5860.zip |
add optimization to c api, and so that we can find all passes in the c api library, make it dynamic
Diffstat (limited to 'src/binaryen-c.cpp')
-rw-r--r-- | src/binaryen-c.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/binaryen-c.cpp b/src/binaryen-c.cpp index b2c695ec0..bbafdf49d 100644 --- a/src/binaryen-c.cpp +++ b/src/binaryen-c.cpp @@ -19,6 +19,7 @@ //=============================== #include "binaryen-c.h" +#include "pass.h" #include "wasm.h" #include "wasm-builder.h" #include "wasm-printing.h" @@ -384,6 +385,13 @@ void BinaryenModulePrint(BinaryenModuleRef module) { WasmPrinter::printModule((Module*)module); } +void BinaryenModuleOptimize(BinaryenModuleRef module) { + Module* wasm = (Module*)module; + PassRunner passRunner(wasm); + passRunner.addDefaultOptimizationPasses(); + passRunner.run(); +} + // // ========== CFG / Relooper ========== // |