浏览代码

* moved the specification of the options for a ttai_typedconstbuilder from
get_final_asmlist() to the constructor, in preparation of supporting the
creation of internal builders for local data that will ignore some of the
irrelevant flags (at creation time)

git-svn-id: branches/hlcgllvm@30334 -

Jonas Maebe 10 年之前
父节点
当前提交
e924dbed90
共有 5 个文件被更改,包括 48 次插入53 次删除
  1. 16 12
      compiler/aasmcnst.pas
  2. 0 7
      compiler/llvm/nllvmtcon.pas
  3. 4 4
      compiler/ncgcon.pas
  4. 22 24
      compiler/ncgvmt.pas
  5. 6 6
      compiler/ngtcon.pas

+ 16 - 12
compiler/aasmcnst.pas

@@ -170,6 +170,9 @@ type
     protected
     protected
      { temporary list in which all data is collected }
      { temporary list in which all data is collected }
      fasmlist: tasmlist;
      fasmlist: tasmlist;
+     { options for the final asmlist }
+     foptions: ttcasmlistoptions;
+
      { while queueing elements of a compound expression, this is the current
      { while queueing elements of a compound expression, this is the current
        offset in the top-level array/record }
        offset in the top-level array/record }
      fqueue_offset: asizeint;
      fqueue_offset: asizeint;
@@ -198,7 +201,7 @@ type
      { easy access to the top level aggregate information instance }
      { easy access to the top level aggregate information instance }
      property curagginfo: taggregateinformation read getcurragginfo;
      property curagginfo: taggregateinformation read getcurragginfo;
     public
     public
-     constructor create; virtual;
+     constructor create(const options: ttcasmlistoptions); virtual;
      destructor destroy; override;
      destructor destroy; override;
 
 
      { add a simple constant data element (p) to the typed constant.
      { add a simple constant data element (p) to the typed constant.
@@ -288,7 +291,7 @@ type
        This asmlist will be freed when the builder is destroyed, so add its
        This asmlist will be freed when the builder is destroyed, so add its
        contents to another list first. This property should only be accessed
        contents to another list first. This property should only be accessed
        once all data has been added. }
        once all data has been added. }
-     function get_final_asmlist(sym: tasmsymbol; def: tdef; section: TAsmSectiontype; const secname: TSymStr; alignment: longint; const options: ttcasmlistoptions): tasmlist;
+     function get_final_asmlist(sym: tasmsymbol; def: tdef; section: TAsmSectiontype; const secname: TSymStr; alignment: longint): tasmlist;
 
 
      { returns the offset of the string data relative to ansi/unicode/widestring
      { returns the offset of the string data relative to ansi/unicode/widestring
        constant labels. On most platforms, this is 0 (with the header at a
        constant labels. On most platforms, this is 0 (with the header at a
@@ -696,11 +699,11 @@ implementation
      end;
      end;
 
 
 
 
-   function ttai_typedconstbuilder.get_final_asmlist(sym: tasmsymbol; def: tdef; section: TAsmSectiontype; const secname: TSymStr; alignment: longint; const options: ttcasmlistoptions): tasmlist;
+   function ttai_typedconstbuilder.get_final_asmlist(sym: tasmsymbol; def: tdef; section: TAsmSectiontype; const secname: TSymStr; alignment: longint): tasmlist;
      begin
      begin
        if not fasmlist_finalized then
        if not fasmlist_finalized then
          begin
          begin
-           finalize_asmlist(sym,def,section,secname,alignment,options);
+           finalize_asmlist(sym,def,section,secname,alignment,foptions);
            fasmlist_finalized:=true;
            fasmlist_finalized:=true;
          end;
          end;
        result:=fasmlist;
        result:=fasmlist;
@@ -750,10 +753,11 @@ implementation
      end;
      end;
 
 
 
 
-   constructor ttai_typedconstbuilder.create;
+   constructor ttai_typedconstbuilder.create(const options: ttcasmlistoptions);
      begin
      begin
        inherited create;
        inherited create;
        fasmlist:=tasmlist.create;
        fasmlist:=tasmlist.create;
+       foptions:=options;
        { queue is empty }
        { queue is empty }
        fqueue_offset:=low(fqueue_offset);
        fqueue_offset:=low(fqueue_offset);
      end;
      end;
@@ -952,7 +956,10 @@ implementation
        datatcb: ttai_typedconstbuilder;
        datatcb: ttai_typedconstbuilder;
        options: ttcasmlistoptions;
        options: ttcasmlistoptions;
      begin
      begin
-       datatcb:=self.create;
+       options:=[tcalo_is_lab];
+       if NewSection then
+         include(options,tcalo_new_section);
+       datatcb:=self.create(options);
        result:=datatcb.emit_string_const_common(st_ansistring,len,encoding,startlab);
        result:=datatcb.emit_string_const_common(st_ansistring,len,encoding,startlab);
 
 
        getmem(s,len+1);
        getmem(s,len+1);
@@ -964,10 +971,7 @@ implementation
        datatcb.emit_tai(tai_string.create_pchar(s,len+1),datadef);
        datatcb.emit_tai(tai_string.create_pchar(s,len+1),datadef);
        datatcb.maybe_end_aggregate(datadef);
        datatcb.maybe_end_aggregate(datadef);
        ansistrrecdef:=datatcb.end_anonymous_record;
        ansistrrecdef:=datatcb.end_anonymous_record;
-       options:=[tcalo_is_lab];
-       if NewSection then
-         include(options,tcalo_new_section);
-       list.concatlist(datatcb.get_final_asmlist(startlab,ansistrrecdef,sec_rodata_norel,startlab.name,const_align(sizeof(pint)),options));
+       list.concatlist(datatcb.get_final_asmlist(startlab,ansistrrecdef,sec_rodata_norel,startlab.name,const_align(sizeof(pint))));
        datatcb.free;
        datatcb.free;
      end;
      end;
 
 
@@ -981,7 +985,7 @@ implementation
        uniwidestrrecdef: trecorddef;
        uniwidestrrecdef: trecorddef;
        datatcb: ttai_typedconstbuilder;
        datatcb: ttai_typedconstbuilder;
      begin
      begin
-       datatcb:=self.create;
+       datatcb:=self.create([tcalo_is_lab,tcalo_new_section]);
        strlength:=getlengthwidestring(pcompilerwidestring(data));
        strlength:=getlengthwidestring(pcompilerwidestring(data));
        if winlike then
        if winlike then
          begin
          begin
@@ -1020,7 +1024,7 @@ implementation
        else
        else
          { code generation for other sizes must be written }
          { code generation for other sizes must be written }
          internalerror(200904271);
          internalerror(200904271);
-       list.concatlist(datatcb.get_final_asmlist(startlab,uniwidestrrecdef,sec_rodata_norel,startlab.name,const_align(sizeof(pint)),[tcalo_is_lab,tcalo_new_section]));
+       list.concatlist(datatcb.get_final_asmlist(startlab,uniwidestrrecdef,sec_rodata_norel,startlab.name,const_align(sizeof(pint))));
        datatcb.free;
        datatcb.free;
      end;
      end;
 
 

+ 0 - 7
compiler/llvm/nllvmtcon.pas

@@ -69,7 +69,6 @@ interface
       procedure begin_aggregate_internal(def: tdef; anonymous: boolean); override;
       procedure begin_aggregate_internal(def: tdef; anonymous: boolean); override;
       procedure end_aggregate_internal(def: tdef; anonymous: boolean); override;
       procedure end_aggregate_internal(def: tdef; anonymous: boolean); override;
      public
      public
-      constructor create; override;
       destructor destroy; override;
       destructor destroy; override;
       procedure emit_tai_procvar2procdef(p: tai; pvdef: tprocvardef); override;
       procedure emit_tai_procvar2procdef(p: tai; pvdef: tprocvardef); override;
       procedure emit_string_offset(const ll: tasmlabofs; const strlength: longint; const st: tstringtype; const winlikewidestring: boolean; const charptrdef: tdef); override;
       procedure emit_string_offset(const ll: tasmlabofs; const strlength: longint; const st: tstringtype; const winlikewidestring: boolean; const charptrdef: tdef); override;
@@ -159,12 +158,6 @@ implementation
     end;
     end;
 
 
 
 
-  constructor tllvmtai_typedconstbuilder.create;
-    begin
-      inherited create;
-    end;
-
-
   destructor tllvmtai_typedconstbuilder.destroy;
   destructor tllvmtai_typedconstbuilder.destroy;
     begin
     begin
       inherited destroy;
       inherited destroy;

+ 4 - 4
compiler/ncgcon.pas

@@ -360,7 +360,7 @@ implementation
                         begin
                         begin
                           current_asmdata.getdatalabel(lastlabel.lab);
                           current_asmdata.getdatalabel(lastlabel.lab);
 
 
-                          datatcb:=ctai_typedconstbuilder.create;
+                          datatcb:=ctai_typedconstbuilder.create([tcalo_is_lab,tcalo_new_section]);
                           { truncate strings larger than 255 chars }
                           { truncate strings larger than 255 chars }
                           if len>255 then
                           if len>255 then
                            l:=255
                            l:=255
@@ -376,7 +376,7 @@ implementation
                           datatcb.emit_tai(Tai_string.Create_pchar(pc,l+1),datadef);
                           datatcb.emit_tai(Tai_string.Create_pchar(pc,l+1),datadef);
                           datatcb.maybe_end_aggregate(datadef);
                           datatcb.maybe_end_aggregate(datadef);
                           current_asmdata.asmlists[al_typedconsts].concatList(
                           current_asmdata.asmlists[al_typedconsts].concatList(
-                            datatcb.get_final_asmlist(lastlabel.lab,datadef,sec_rodata_norel,lastlabel.lab.name,const_align(sizeof(pint)),[tcalo_is_lab,tcalo_new_section])
+                            datatcb.get_final_asmlist(lastlabel.lab,datadef,sec_rodata_norel,lastlabel.lab.name,const_align(sizeof(pint)))
                           );
                           );
                           datatcb.free;
                           datatcb.free;
                         end;
                         end;
@@ -384,7 +384,7 @@ implementation
                         begin
                         begin
                           current_asmdata.getdatalabel(lastlabel.lab);
                           current_asmdata.getdatalabel(lastlabel.lab);
 
 
-                          datatcb:=ctai_typedconstbuilder.create;
+                          datatcb:=ctai_typedconstbuilder.create([tcalo_is_lab,tcalo_new_section]);
                           { include terminating zero }
                           { include terminating zero }
                           getmem(pc,len+1);
                           getmem(pc,len+1);
                           move(value_str^,pc[0],len);
                           move(value_str^,pc[0],len);
@@ -398,7 +398,7 @@ implementation
                           datatcb.emit_tai(Tai_string.Create_pchar(pc,len+1),datadef);
                           datatcb.emit_tai(Tai_string.Create_pchar(pc,len+1),datadef);
                           datatcb.maybe_end_aggregate(datadef);
                           datatcb.maybe_end_aggregate(datadef);
                           current_asmdata.asmlists[al_typedconsts].concatList(
                           current_asmdata.asmlists[al_typedconsts].concatList(
-                            datatcb.get_final_asmlist(lastlabel.lab,datadef,sec_rodata_norel,lastlabel.lab.name,const_align(sizeof(pint)),[tcalo_is_lab,tcalo_new_section])
+                            datatcb.get_final_asmlist(lastlabel.lab,datadef,sec_rodata_norel,lastlabel.lab.name,const_align(sizeof(pint)))
                           );
                           );
                           datatcb.free;
                           datatcb.free;
                         end;
                         end;

+ 22 - 24
compiler/ncgvmt.pas

@@ -238,7 +238,7 @@ implementation
          current_asmdata.getdatalabel(p^.nl);
          current_asmdata.getdatalabel(p^.nl);
          if assigned(p^.l) then
          if assigned(p^.l) then
            writenames(list,p^.l);
            writenames(list,p^.l);
-         tcb:=ctai_typedconstbuilder.create;
+         tcb:=ctai_typedconstbuilder.create([tcalo_is_lab]);
          len:=length(p^.data.messageinf.str^);
          len:=length(p^.data.messageinf.str^);
          tcb.maybe_begin_aggregate(getarraydef(cansichartype,len+1));
          tcb.maybe_begin_aggregate(getarraydef(cansichartype,len+1));
          tcb.emit_tai(tai_const.create_8bit(len),cansichartype);
          tcb.emit_tai(tai_const.create_8bit(len),cansichartype);
@@ -247,7 +247,7 @@ implementation
          ca[len]:=#0;
          ca[len]:=#0;
          tcb.emit_tai(Tai_string.Create_pchar(ca,len),getarraydef(cansichartype,len));
          tcb.emit_tai(Tai_string.Create_pchar(ca,len),getarraydef(cansichartype,len));
          tcb.maybe_end_aggregate(getarraydef(cansichartype,len+1));
          tcb.maybe_end_aggregate(getarraydef(cansichartype,len+1));
-         list.concatList(tcb.get_final_asmlist(p^.nl,getarraydef(cansichartype,len+1),sec_rodata_norel,'',sizeof(pint),[tcalo_is_lab]));
+         list.concatList(tcb.get_final_asmlist(p^.nl,getarraydef(cansichartype,len+1),sec_rodata_norel,'',sizeof(pint)));
          tcb.free;
          tcb.free;
          if assigned(p^.r) then
          if assigned(p^.r) then
            writenames(list,p^.r);
            writenames(list,p^.r);
@@ -283,7 +283,7 @@ implementation
          { insert all message handlers into a tree, sorted by name }
          { insert all message handlers into a tree, sorted by name }
          _class.symtable.SymList.ForEachCall(@insertmsgstr,@count);
          _class.symtable.SymList.ForEachCall(@insertmsgstr,@count);
 
 
-         tcb:=ctai_typedconstbuilder.create;
+         tcb:=ctai_typedconstbuilder.create([tcalo_is_lab]);
          { write all names }
          { write all names }
          if assigned(root) then
          if assigned(root) then
            writenames(list,root);
            writenames(list,root);
@@ -312,7 +312,7 @@ implementation
               disposeprocdeftree(root);
               disposeprocdeftree(root);
            end;
            end;
          tcb.maybe_end_aggregate(msgstrtabdef);
          tcb.maybe_end_aggregate(msgstrtabdef);
-         list.concatList(tcb.get_final_asmlist(result,msgstrtabdef,sec_rodata,'',sizeof(pint),[tcalo_is_lab]));
+         list.concatList(tcb.get_final_asmlist(result,msgstrtabdef,sec_rodata,'',sizeof(pint)));
          tcb.free;
          tcb.free;
       end;
       end;
 
 
@@ -364,7 +364,7 @@ implementation
              end;
              end;
          }
          }
          current_asmdata.getlabel(r,alt_data);
          current_asmdata.getlabel(r,alt_data);
-         tcb:=ctai_typedconstbuilder.create;
+         tcb:=ctai_typedconstbuilder.create([tcalo_is_lab]);
          genintmsgtab:=r;
          genintmsgtab:=r;
          gettabledef('fpc_msgint_table_entries_',s32inttype,msginttabledef,count,0,msgintdef,msgintarrdef);
          gettabledef('fpc_msgint_table_entries_',s32inttype,msginttabledef,count,0,msgintdef,msgintarrdef);
          tcb.maybe_begin_aggregate(msgintdef);
          tcb.maybe_begin_aggregate(msgintdef);
@@ -377,7 +377,7 @@ implementation
               disposeprocdeftree(root);
               disposeprocdeftree(root);
            end;
            end;
          tcb.maybe_end_aggregate(msgintdef);
          tcb.maybe_end_aggregate(msgintdef);
-         list.concatList(tcb.get_final_asmlist(result,msgintdef,sec_rodata,'',sizeof(pint),[tcalo_is_lab]));
+         list.concatList(tcb.get_final_asmlist(result,msgintdef,sec_rodata,'',sizeof(pint)));
          tcb.free;
          tcb.free;
       end;
       end;
 
 
@@ -514,10 +514,10 @@ implementation
               begin
               begin
                 current_asmdata.getlabel(l,alt_data);
                 current_asmdata.getlabel(l,alt_data);
                 { l: name_of_method }
                 { l: name_of_method }
-                tcb:=ctai_typedconstbuilder.create;
+                tcb:=ctai_typedconstbuilder.create([tcalo_is_lab]);
 
 
                 namedef:=tcb.emit_shortstring_const(tsym(p).realname);
                 namedef:=tcb.emit_shortstring_const(tsym(p).realname);
-                lists^.list.concatList(tcb.get_final_asmlist(l,namedef,sec_rodata_norel,'',sizeof(pint),[tcalo_is_lab]));
+                lists^.list.concatList(tcb.get_final_asmlist(l,namedef,sec_rodata_norel,'',sizeof(pint)));
                 tcb.free;
                 tcb.free;
                 { the tmethodnamerec }
                 { the tmethodnamerec }
                 lists^.pubmethodstcb.maybe_begin_aggregate(lists^.methodnamerec);
                 lists^.pubmethodstcb.maybe_begin_aggregate(lists^.methodnamerec);
@@ -567,7 +567,7 @@ implementation
                     entries : packed array[0..0] of tmethodnamerec;
                     entries : packed array[0..0] of tmethodnamerec;
                   end;
                   end;
                }
                }
-              lists.pubmethodstcb:=ctai_typedconstbuilder.create;
+              lists.pubmethodstcb:=ctai_typedconstbuilder.create([tcalo_is_lab]);
               current_asmdata.getlabel(l,alt_data);
               current_asmdata.getlabel(l,alt_data);
               gettabledef('fpc_intern_tmethodnametable_',u32inttype,lists.methodnamerec,count,1,pubmethodsdef,pubmethodsarraydef);
               gettabledef('fpc_intern_tmethodnametable_',u32inttype,lists.methodnamerec,count,1,pubmethodsdef,pubmethodsarraydef);
               { begin tmethodnametable }
               { begin tmethodnametable }
@@ -582,7 +582,7 @@ implementation
               lists.pubmethodstcb.maybe_end_aggregate(pubmethodsarraydef);
               lists.pubmethodstcb.maybe_end_aggregate(pubmethodsarraydef);
               { end methodnametable }
               { end methodnametable }
               lists.pubmethodstcb.maybe_end_aggregate(pubmethodsdef);
               lists.pubmethodstcb.maybe_end_aggregate(pubmethodsdef);
-              list.concatlist(lists.pubmethodstcb.get_final_asmlist(l,pubmethodsdef,sec_rodata,'',sizeof(pint),[tcalo_is_lab]));
+              list.concatlist(lists.pubmethodstcb.get_final_asmlist(l,pubmethodsdef,sec_rodata,'',sizeof(pint)));
               lists.pubmethodstcb.free;
               lists.pubmethodstcb.free;
               genpublishedmethodstable:=l;
               genpublishedmethodstable:=l;
            end
            end
@@ -635,7 +635,7 @@ implementation
               packrecords:=1;
               packrecords:=1;
 
 
             { generate the class table }
             { generate the class table }
-            tcb:=ctai_typedconstbuilder.create;
+            tcb:=ctai_typedconstbuilder.create([tcalo_is_lab]);
             tcb.begin_anonymous_record('$fpc_intern_classtable_'+tostr(classtablelist.Count-1),packrecords);
             tcb.begin_anonymous_record('$fpc_intern_classtable_'+tostr(classtablelist.Count-1),packrecords);
             tcb.emit_tai(Tai_const.Create_16bit(classtablelist.count),u16inttype);
             tcb.emit_tai(Tai_const.Create_16bit(classtablelist.count),u16inttype);
             for i:=0 to classtablelist.Count-1 do
             for i:=0 to classtablelist.Count-1 do
@@ -649,7 +649,7 @@ implementation
                   tfieldvarsym(classdef.vmt_field).vardef);
                   tfieldvarsym(classdef.vmt_field).vardef);
               end;
               end;
             classtabledef:=tcb.end_anonymous_record;
             classtabledef:=tcb.end_anonymous_record;
-            list.concatlist(tcb.get_final_asmlist(classtable,classtabledef,sec_rodata,'',sizeof(pint),[tcalo_is_lab]));
+            list.concatlist(tcb.get_final_asmlist(classtable,classtabledef,sec_rodata,'',sizeof(pint)));
             tcb.free;
             tcb.free;
 
 
             { write fields }
             { write fields }
@@ -664,7 +664,7 @@ implementation
                 Fields: array[0..0] of TFieldInfo
                 Fields: array[0..0] of TFieldInfo
               end;
               end;
             }
             }
-            tcb:=ctai_typedconstbuilder.create;
+            tcb:=ctai_typedconstbuilder.create([tcalo_is_lab]);
             { can't easily specify a name here for reuse of the constructed def,
             { can't easily specify a name here for reuse of the constructed def,
               since it's full of variable length shortstrings (-> all of those
               since it's full of variable length shortstrings (-> all of those
               lengths and their order would have to incorporated in the name,
               lengths and their order would have to incorporated in the name,
@@ -701,7 +701,7 @@ implementation
                   end;
                   end;
               end;
               end;
             fieldtabledef:=tcb.end_anonymous_record;
             fieldtabledef:=tcb.end_anonymous_record;
-            list.concatlist(tcb.get_final_asmlist(fieldtable,fieldtabledef,sec_rodata,'',sizeof(pint),[tcalo_is_lab]));
+            list.concatlist(tcb.get_final_asmlist(fieldtable,fieldtabledef,sec_rodata,'',sizeof(pint)));
             tcb.free;
             tcb.free;
 
 
             result:=fieldtable;
             result:=fieldtable;
@@ -803,7 +803,7 @@ implementation
         interfacearray: tdef;
         interfacearray: tdef;
       begin
       begin
         current_asmdata.getlabel(result,alt_data);
         current_asmdata.getlabel(result,alt_data);
-        tcb:=ctai_typedconstbuilder.create;
+        tcb:=ctai_typedconstbuilder.create([tcalo_is_lab]);
         tcb.begin_anonymous_record('',0);
         tcb.begin_anonymous_record('',0);
         tcb.emit_tai(Tai_const.Create_pint(_class.ImplementedInterfaces.count),search_system_type('SIZEUINT').typedef);
         tcb.emit_tai(Tai_const.Create_pint(_class.ImplementedInterfaces.count),search_system_type('SIZEUINT').typedef);
         interfaceentrydef:=search_system_type('TINTERFACEENTRY').typedef;
         interfaceentrydef:=search_system_type('TINTERFACEENTRY').typedef;
@@ -818,7 +818,7 @@ implementation
           end;
           end;
         tcb.maybe_end_aggregate(interfacearray);
         tcb.maybe_end_aggregate(interfacearray);
         tabledef:=tcb.end_anonymous_record;
         tabledef:=tcb.end_anonymous_record;
-        list.concatlist(tcb.get_final_asmlist(result,tabledef,sec_rodata,'',tabledef.alignment,[tcalo_is_lab]));
+        list.concatlist(tcb.get_final_asmlist(result,tabledef,sec_rodata,'',tabledef.alignment));
 
 
         { Write vtbls }
         { Write vtbls }
         for i:=0 to _class.ImplementedInterfaces.count-1 do
         for i:=0 to _class.ImplementedInterfaces.count-1 do
@@ -894,27 +894,25 @@ implementation
       if assigned(_class.iidguid) then
       if assigned(_class.iidguid) then
         begin
         begin
           s:=make_mangledname('IID',_class.owner,_class.objname^);
           s:=make_mangledname('IID',_class.owner,_class.objname^);
-          tcb:=ctai_typedconstbuilder.create;
+          tcb:=ctai_typedconstbuilder.create([tcalo_new_section]);
           tcb.emit_guid_const(_class.iidguid^);
           tcb.emit_guid_const(_class.iidguid^);
           list.concatlist(tcb.get_final_asmlist(
           list.concatlist(tcb.get_final_asmlist(
             current_asmdata.DefineAsmSymbol(s,AB_GLOBAL,AT_DATA),
             current_asmdata.DefineAsmSymbol(s,AB_GLOBAL,AT_DATA),
             rec_tguid,
             rec_tguid,
             sec_rodata_norel,
             sec_rodata_norel,
             s,
             s,
-            const_align(sizeof(pint)),
-            [tcalo_new_section]));
+            const_align(sizeof(pint))));
           tcb.free;
           tcb.free;
         end;
         end;
       s:=make_mangledname('IIDSTR',_class.owner,_class.objname^);
       s:=make_mangledname('IIDSTR',_class.owner,_class.objname^);
-      tcb:=ctai_typedconstbuilder.create;
+      tcb:=ctai_typedconstbuilder.create([tcalo_new_section]);
       def:=tcb.emit_shortstring_const(_class.iidstr^);
       def:=tcb.emit_shortstring_const(_class.iidstr^);
       list.concatlist(tcb.get_final_asmlist(
       list.concatlist(tcb.get_final_asmlist(
         current_asmdata.DefineAsmSymbol(s,AB_GLOBAL,AT_DATA),
         current_asmdata.DefineAsmSymbol(s,AB_GLOBAL,AT_DATA),
         def,
         def,
         sec_rodata_norel,
         sec_rodata_norel,
         s,
         s,
-        sizeof(pint),
-        [tcalo_new_section]));
+        sizeof(pint)));
       tcb.free;
       tcb.free;
     end;
     end;
 
 
@@ -1058,10 +1056,10 @@ implementation
           begin
           begin
             { write class name }
             { write class name }
             current_asmdata.getlabel(classnamelabel,alt_data);
             current_asmdata.getlabel(classnamelabel,alt_data);
-            tcb:=ctai_typedconstbuilder.create;
+            tcb:=ctai_typedconstbuilder.create([tcalo_is_lab]);
             hs:=_class.RttiName;
             hs:=_class.RttiName;
             classnamedef:=tcb.emit_shortstring_const(_class.RttiName);
             classnamedef:=tcb.emit_shortstring_const(_class.RttiName);
-            templist.concatlist(tcb.get_final_asmlist(classnamelabel,classnamedef,sec_rodata_norel,'',sizeof(pint),[tcalo_is_lab]));
+            templist.concatlist(tcb.get_final_asmlist(classnamelabel,classnamedef,sec_rodata_norel,'',sizeof(pint)));
             tcb.free;
             tcb.free;
 
 
             { interface table }
             { interface table }

+ 6 - 6
compiler/ngtcon.pas

@@ -441,7 +441,7 @@ function get_next_varsym(def: tabstractrecorddef; const SymList:TFPHashObjectLis
       begin
       begin
         inherited;
         inherited;
         fsym:=sym;
         fsym:=sym;
-        ftcb:=ctai_typedconstbuilder.create;
+        ftcb:=ctai_typedconstbuilder.create([tcalo_new_section]);
         fdatalist:=tasmlist.create;
         fdatalist:=tasmlist.create;
         curoffset:=0;
         curoffset:=0;
       end;
       end;
@@ -804,7 +804,7 @@ function get_next_varsym(def: tabstractrecorddef; const SymList:TFPHashObjectLis
             begin
             begin
               { create a tcb for the string data (it's placed in a separate
               { create a tcb for the string data (it's placed in a separate
                 asmlist) }
                 asmlist) }
-              datatcb:=ctai_typedconstbuilder.create;
+              datatcb:=ctai_typedconstbuilder.create([tcalo_is_lab,tcalo_new_section]);
               current_asmdata.getlabel(ll,alt_data);
               current_asmdata.getlabel(ll,alt_data);
               if node.nodetype=stringconstn then
               if node.nodetype=stringconstn then
                 varalign:=size_2_align(tstringconstnode(node).len)
                 varalign:=size_2_align(tstringconstnode(node).len)
@@ -838,7 +838,7 @@ function get_next_varsym(def: tabstractrecorddef; const SymList:TFPHashObjectLis
                   IncompatibleTypes(node.resultdef, def);
                   IncompatibleTypes(node.resultdef, def);
                   datadef:=getarraydef(cansichartype,1);
                   datadef:=getarraydef(cansichartype,1);
                 end;
                 end;
-              current_asmdata.asmlists[al_const].concatlist(datatcb.get_final_asmlist(ll,datadef,sec_rodata,ll.name,varalign,[tcalo_is_lab,tcalo_new_section]));
+              current_asmdata.asmlists[al_const].concatlist(datatcb.get_final_asmlist(ll,datadef,sec_rodata,ll.name,varalign));
               datatcb.free;
               datatcb.free;
               { we now emit the address of the first element of the array
               { we now emit the address of the first element of the array
                 containing the string data }
                 containing the string data }
@@ -865,7 +865,7 @@ function get_next_varsym(def: tabstractrecorddef; const SymList:TFPHashObjectLis
                    begin
                    begin
                      { create a tcb for the string data (it's placed in a separate
                      { create a tcb for the string data (it's placed in a separate
                        asmlist) }
                        asmlist) }
-                     datatcb:=ctai_typedconstbuilder.create;
+                     datatcb:=ctai_typedconstbuilder.create([tcalo_is_lab,tcalo_new_section]);
                      pw:=pcompilerwidestring(tstringconstnode(node).value_str);
                      pw:=pcompilerwidestring(tstringconstnode(node).value_str);
                      { include terminating #0 }
                      { include terminating #0 }
                      datadef:=getarraydef(cwidechartype,tstringconstnode(node).len+1);
                      datadef:=getarraydef(cwidechartype,tstringconstnode(node).len+1);
@@ -876,7 +876,7 @@ function get_next_varsym(def: tabstractrecorddef; const SymList:TFPHashObjectLis
                      datatcb.emit_tai(Tai_const.Create_16bit(0),cwidechartype);
                      datatcb.emit_tai(Tai_const.Create_16bit(0),cwidechartype);
                      datatcb.maybe_end_aggregate(datadef);
                      datatcb.maybe_end_aggregate(datadef);
                      { concat add the string data to the fdatalist }
                      { concat add the string data to the fdatalist }
-                     fdatalist.concatlist(datatcb.get_final_asmlist(ll,datadef,sec_rodata,ll.name,const_align(sizeof(pint)),[tcalo_is_lab,tcalo_new_section]));
+                     fdatalist.concatlist(datatcb.get_final_asmlist(ll,datadef,sec_rodata,ll.name,const_align(sizeof(pint))));
                      datatcb.free;
                      datatcb.free;
                      { we now emit the address of the first element of the array
                      { we now emit the address of the first element of the array
                        containing the string data }
                        containing the string data }
@@ -1102,7 +1102,7 @@ function get_next_varsym(def: tabstractrecorddef; const SymList:TFPHashObjectLis
               sec:=sec_data;
               sec:=sec_data;
             secname:=asmsym.Name;
             secname:=asmsym.Name;
           end;
           end;
-        reslist:=ftcb.get_final_asmlist(asmsym,fsym.vardef,sec,secname,fsym.vardef.alignment,[tcalo_new_section]);
+        reslist:=ftcb.get_final_asmlist(asmsym,fsym.vardef,sec,secname,fsym.vardef.alignment);
         if addstabx then
         if addstabx then
           begin
           begin
             { see same code in ncgutil.insertbssdata }
             { see same code in ncgutil.insertbssdata }