* keep track of the sections that are created in the asmlists

git-svn-id: trunk@35408 -
This commit is contained in:
svenbarth 2017-02-10 14:38:53 +00:00
parent 49f7e90827
commit c6bfb0064f
4 changed files with 8 additions and 0 deletions

View File

@ -131,6 +131,7 @@ interface
type
TAsmList = class(tlinkedlist)
section_count : longint;
constructor create;
function getlasttaifilepos : pfileposinfo;
end;

View File

@ -955,6 +955,7 @@ implementation
procedure new_section(list:TAsmList;Asectype:TAsmSectiontype;const Aname:string;Aalign:byte;Asecorder:TasmSectionorder=secorder_default);
begin
list.concat(tai_section.create(Asectype,Aname,Aalign,Asecorder));
inc(list.section_count);
list.concat(cai_align.create(Aalign));
end;

View File

@ -738,6 +738,8 @@ implementation
if hp=nil then
break;
p_asm.concat(hp);
if hp.typ=ait_section then
inc(p_asm.section_count);
until false;
end
else
@ -809,6 +811,7 @@ implementation
begin
n.p_asm:=TAsmList.create;
n.p_asm.concatlistcopy(p_asm);
n.p_asm.section_count:=p_asm.section_count;
end
else n.p_asm := nil;
n.currenttai:=currenttai;

View File

@ -355,6 +355,9 @@ interface
current_asmdata.CurrAsmList.concatlist(p_asm);
end;
{ Update section count }
current_asmdata.currasmlist.section_count:=current_asmdata.currasmlist.section_count+p_asm.section_count;
{ Release register used in the assembler block }
if (not has_registerlist) then
cg.deallocallcpuregisters(current_asmdata.CurrAsmList);