summaryrefslogtreecommitdiff
path: root/src/ir/module-utils.h
diff options
context:
space:
mode:
authorÖmer Sinan Ağacan <omeragacan@gmail.com>2024-10-01 23:39:34 +0200
committerGitHub <noreply@github.com>2024-10-01 14:39:34 -0700
commit347fc8a57dcfd9361b05f271a7f2badc929500cf (patch)
tree362a40ae7bc9bcb9e8c40967505d3414691f6af6 /src/ir/module-utils.h
parentcb53f0c6966fe7c8e5cc1a975eab9653b5914bde (diff)
downloadbinaryen-347fc8a57dcfd9361b05f271a7f2badc929500cf.tar.gz
binaryen-347fc8a57dcfd9361b05f271a7f2badc929500cf.tar.bz2
binaryen-347fc8a57dcfd9361b05f271a7f2badc929500cf.zip
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
Diffstat (limited to 'src/ir/module-utils.h')
-rw-r--r--src/ir/module-utils.h21
1 files changed, 12 insertions, 9 deletions
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<std::vector<Index>> 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<std::vector<Index>> fileIndexMap = std::nullopt,
+ std::optional<std::vector<Index>> symbolNameIndexMap = std::nullopt);
// As above, but does not add the copy to the module.
std::unique_ptr<Function> copyFunctionWithoutAdd(
Function* func,
Module& out,
Name newName = Name(),
- std::optional<std::vector<Index>> fileIndexMap = std::nullopt);
+ std::optional<std::vector<Index>> fileIndexMap = std::nullopt,
+ std::optional<std::vector<Index>> symbolNameIndexMap = std::nullopt);
Global* copyGlobal(Global* global, Module& out);