From 715d1becddcb89c49d71aa19e62ed27f967e5860 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 5 May 2016 09:41:01 -0700 Subject: add optimization to c api, and so that we can find all passes in the c api library, make it dynamic --- src/binaryen-c.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/binaryen-c.cpp') 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 ========== // -- cgit v1.2.3