Browse Source

+ introduced method TWasmExeOutput.AddToGlobalNameMap

Nikolay Nikolov 10 months ago
parent
commit
b5d0cd57ed
1 changed files with 7 additions and 0 deletions
  1. 7 0
      compiler/ogwasm.pas

+ 7 - 0
compiler/ogwasm.pas

@@ -297,8 +297,10 @@ interface
         FMaxMemoryPages: Integer;
         { use for the Name section }
         FFunctionNameMap: TCustomSectionNameMap;
+        FGlobalNameMap: TCustomSectionNameMap;
         procedure AddToNameMap(var nm: TCustomSectionNameMap; aidx: UInt32; const aname: string);
         procedure AddToFunctionNameMap(aidx: UInt32; const aname: string);
+        procedure AddToGlobalNameMap(aidx: UInt32; const aname: string);
         procedure WriteWasmSection(wsid: TWasmSectionID);
         procedure WriteWasmSectionIfNotEmpty(wsid: TWasmSectionID);
         procedure WriteWasmCustomSection(wcst: TWasmCustomSectionType);
@@ -4791,6 +4793,11 @@ implementation
         AddToNameMap(FFunctionNameMap,aidx,aname);
       end;
 
+    procedure TWasmExeOutput.AddToGlobalNameMap(aidx: UInt32; const aname: string);
+      begin
+        AddToNameMap(FGlobalNameMap,aidx,aname);
+      end;
+
     procedure TWasmExeOutput.WriteWasmSection(wsid: TWasmSectionID);
       var
         b: byte;