+ added amfrtDeleteAi, support deleting instructions in map_structured_asmlist_inner

This commit is contained in:
Nikolay Nikolov 2023-10-18 03:31:11 +03:00
parent 0f07c966b6
commit 9584348c40

View File

@ -42,12 +42,13 @@ uses
type type
twasmstruc_stack = class; twasmstruc_stack = class;
TAsmMapFuncResultType = (amfrtNoChange, amfrtNewAi, amfrtNewList); TAsmMapFuncResultType = (amfrtNoChange, amfrtNewAi, amfrtNewList, amfrtDeleteAi);
TAsmMapFuncResult = record TAsmMapFuncResult = record
case typ: TAsmMapFuncResultType of case typ: TAsmMapFuncResultType of
amfrtNoChange: (); amfrtNoChange: ();
amfrtNewAi: (newai: tai); amfrtNewAi: (newai: tai);
amfrtNewList: (newlist: TAsmList); amfrtNewList: (newlist: TAsmList);
amfrtDeleteAi: ();
end; end;
TAsmMapFunc = function(ai: tai; blockstack: twasmstruc_stack): TAsmMapFuncResult of object; TAsmMapFunc = function(ai: tai; blockstack: twasmstruc_stack): TAsmMapFuncResult of object;
TWasmLocalAllocator = function(wbt: TWasmBasicType): Integer of object; TWasmLocalAllocator = function(wbt: TWasmBasicType): Integer of object;
@ -2890,6 +2891,12 @@ uses
l.Remove(p); l.Remove(p);
p:=q; p:=q;
end; end;
amfrtDeleteAi:
begin
q:=p;
p:=tai(p.next);
l.Remove(q);
end;
end; end;
end end
else else
@ -2918,6 +2925,12 @@ uses
l.Remove(p); l.Remove(p);
p:=q; p:=q;
end; end;
amfrtDeleteAi:
begin
q:=p;
p:=tai(p.next);
l.Remove(q);
end;
end; end;
end; end;
end; end;