diff options
Diffstat (limited to 'src/tools/wasm-split')
-rw-r--r-- | src/tools/wasm-split/instrumenter.cpp | 3 | ||||
-rw-r--r-- | src/tools/wasm-split/instrumenter.h | 3 | ||||
-rw-r--r-- | src/tools/wasm-split/wasm-split.cpp | 6 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/tools/wasm-split/instrumenter.cpp b/src/tools/wasm-split/instrumenter.cpp index 7f9ff9c75..86a52688e 100644 --- a/src/tools/wasm-split/instrumenter.cpp +++ b/src/tools/wasm-split/instrumenter.cpp @@ -26,8 +26,7 @@ Instrumenter::Instrumenter(const InstrumenterConfig& config, uint64_t moduleHash) : config(config), moduleHash(moduleHash) {} -void Instrumenter::run(PassRunner* runner, Module* wasm) { - this->runner = runner; +void Instrumenter::run(Module* wasm) { this->wasm = wasm; size_t numFuncs = 0; diff --git a/src/tools/wasm-split/instrumenter.h b/src/tools/wasm-split/instrumenter.h index f4f2f2119..135d2b74f 100644 --- a/src/tools/wasm-split/instrumenter.h +++ b/src/tools/wasm-split/instrumenter.h @@ -41,7 +41,6 @@ struct InstrumenterConfig { // at the beginning of each function to set its timestamp, and a new exported // function for dumping the profile data. struct Instrumenter : public Pass { - PassRunner* runner = nullptr; Module* wasm = nullptr; const InstrumenterConfig& config; @@ -54,7 +53,7 @@ struct Instrumenter : public Pass { Instrumenter(const InstrumenterConfig& config, uint64_t moduleHash); - void run(PassRunner* runner, Module* wasm) override; + void run(Module* wasm) override; private: void addGlobals(size_t numFuncs); diff --git a/src/tools/wasm-split/wasm-split.cpp b/src/tools/wasm-split/wasm-split.cpp index ec1f5555c..49a15e934 100644 --- a/src/tools/wasm-split/wasm-split.cpp +++ b/src/tools/wasm-split/wasm-split.cpp @@ -110,7 +110,6 @@ void instrumentModule(const WasmSplitOptions& options) { } uint64_t moduleHash = hashFile(options.inputFiles[0]); - PassRunner runner(&wasm, options.passOptions); InstrumenterConfig config; if (options.importNamespace.size()) { config.importNamespace = options.importNamespace; @@ -120,7 +119,10 @@ void instrumentModule(const WasmSplitOptions& options) { } config.storageKind = options.storageKind; config.profileExport = options.profileExport; - Instrumenter(config, moduleHash).run(&runner, &wasm); + + PassRunner runner(&wasm, options.passOptions); + runner.add(std::make_unique<Instrumenter>(config, moduleHash)); + runner.run(); adjustTableSize(wasm, options.initialTableSize); |