diff options
Diffstat (limited to 'src/passes/LogExecution.cpp')
-rw-r--r-- | src/passes/LogExecution.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/passes/LogExecution.cpp b/src/passes/LogExecution.cpp index 8d555fefe..45a29eae9 100644 --- a/src/passes/LogExecution.cpp +++ b/src/passes/LogExecution.cpp @@ -30,6 +30,7 @@ #include "shared-constants.h" #include "asmjs/shared-constants.h" #include "asm_v_wasm.h" +#include "ir/function-type-utils.h" namespace wasm { @@ -46,13 +47,14 @@ struct LogExecution : public WalkerPass<PostWalker<LogExecution>> { void visitModule(Module *curr) { // Add the import - auto import = new Import; + auto import = new Function; import->name = LOGGER; import->module = ENV; import->base = LOGGER; - import->functionType = ensureFunctionType("vi", curr)->name; - import->kind = ExternalKind::Function; - curr->addImport(import); + auto* functionType = ensureFunctionType("vi", curr); + import->type = functionType->name; + FunctionTypeUtils::fillFunction(import, functionType); + curr->addFunction(import); } private: @@ -60,7 +62,7 @@ private: static Index id = 0; Builder builder(*getModule()); return builder.makeSequence( - builder.makeCallImport( + builder.makeCall( LOGGER, { builder.makeConst(Literal(int32_t(id++))) }, none |