瀏覽代碼

* converted a number of string data generators to the internal data builder
functionality

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

Jonas Maebe 10 年之前
父節點
當前提交
a76aba4a20
共有 1 個文件被更改,包括 4 次插入7 次删除
  1. 4 7
      compiler/ngtcon.pas

+ 4 - 7
compiler/ngtcon.pas

@@ -804,8 +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([tcalo_is_lab,tcalo_make_dead_strippable]);
-              current_asmdata.getlabel(ll,alt_data);
+              ftcb.start_internal_data_builder(fdatalist,sec_rodata,datatcb,ll);
               if node.nodetype=stringconstn then
               if node.nodetype=stringconstn then
                 varalign:=size_2_align(tstringconstnode(node).len)
                 varalign:=size_2_align(tstringconstnode(node).len)
               else
               else
@@ -838,8 +837,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));
-              datatcb.free;
+              ftcb.finish_internal_data_builder(datatcb,ll,datadef,varalign);
               { 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 }
               ftcb.queue_init(def);
               ftcb.queue_init(def);
@@ -857,7 +855,6 @@ function get_next_varsym(def: tabstractrecorddef; const SymList:TFPHashObjectLis
             begin
             begin
               if (node.nodetype in [stringconstn,ordconstn]) then
               if (node.nodetype in [stringconstn,ordconstn]) then
                 begin
                 begin
-                  current_asmdata.getlabel(ll,alt_data);
                   { convert to unicodestring stringconstn }
                   { convert to unicodestring stringconstn }
                   inserttypeconv(node,cunicodestringtype);
                   inserttypeconv(node,cunicodestringtype);
                   if (node.nodetype=stringconstn) and
                   if (node.nodetype=stringconstn) and
@@ -865,6 +862,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) }
+                     ftcb.start_internal_data_builder(fdatalist,sec_rodata,datatcb,ll);
                      datatcb:=ctai_typedconstbuilder.create([tcalo_is_lab,tcalo_make_dead_strippable]);
                      datatcb:=ctai_typedconstbuilder.create([tcalo_is_lab,tcalo_make_dead_strippable]);
                      pw:=pcompilerwidestring(tstringconstnode(node).value_str);
                      pw:=pcompilerwidestring(tstringconstnode(node).value_str);
                      { include terminating #0 }
                      { include terminating #0 }
@@ -876,8 +874,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))));
-                     datatcb.free;
+                     ftcb.finish_internal_data_builder(datatcb,ll,datadef,const_align(sizeof(pint)));
                      { 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 }
                      ftcb.queue_init(def);
                      ftcb.queue_init(def);