From 347fc8a57dcfd9361b05f271a7f2badc929500cf Mon Sep 17 00:00:00 2001 From: Ömer Sinan Ağacan Date: Tue, 1 Oct 2024 23:39:34 +0200 Subject: Source Maps: Support 5 segment mappings (#6795) Support 5-segment source mappings, which add a name. Reference: https://github.com/tc39/source-map/blob/main/source-map-rev3.md#proposed-format --- src/ir/module-utils.h | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'src/ir/module-utils.h') diff --git a/src/ir/module-utils.h b/src/ir/module-utils.h index 46e524165..bb8b6ae43 100644 --- a/src/ir/module-utils.h +++ b/src/ir/module-utils.h @@ -25,21 +25,24 @@ namespace wasm::ModuleUtils { // Copies a function into a module. If newName is provided it is used as the -// name of the function (otherwise the original name is copied). If fileIndexMap -// is specified, it is used to rename source map filename indices when copying -// the function from one module to another one. -Function* -copyFunction(Function* func, - Module& out, - Name newName = Name(), - std::optional> fileIndexMap = std::nullopt); +// name of the function (otherwise the original name is copied). When specified, +// fileIndexMap and symbolNameIndexMap are used to rename source map filename +// and symbol name indices when copying the function from one module to another +// one. +Function* copyFunction( + Function* func, + Module& out, + Name newName = Name(), + std::optional> fileIndexMap = std::nullopt, + std::optional> symbolNameIndexMap = std::nullopt); // As above, but does not add the copy to the module. std::unique_ptr copyFunctionWithoutAdd( Function* func, Module& out, Name newName = Name(), - std::optional> fileIndexMap = std::nullopt); + std::optional> fileIndexMap = std::nullopt, + std::optional> symbolNameIndexMap = std::nullopt); Global* copyGlobal(Global* global, Module& out); -- cgit v1.2.3