浏览代码

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

git-svn-id: trunk@35408 -
svenbarth 8 年之前
父节点
当前提交
c6bfb0064f
共有 4 个文件被更改,包括 8 次插入0 次删除
  1. 1 0
      compiler/aasmdata.pas
  2. 1 0
      compiler/aasmtai.pas
  3. 3 0
      compiler/nbas.pas
  4. 3 0
      compiler/ncgbas.pas

+ 1 - 0
compiler/aasmdata.pas

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

+ 1 - 0
compiler/aasmtai.pas

@@ -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;
 

+ 3 - 0
compiler/nbas.pas

@@ -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;

+ 3 - 0
compiler/ncgbas.pas

@@ -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);