mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-30 19:40:21 +02:00
* converted a number of string data generators to the internal data builder
functionality git-svn-id: branches/hlcgllvm@30340 -
This commit is contained in:
parent
158116392c
commit
a76aba4a20
@ -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]);
|
ftcb.start_internal_data_builder(fdatalist,sec_rodata,datatcb,ll);
|
||||||
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)
|
||||||
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));
|
ftcb.finish_internal_data_builder(datatcb,ll,datadef,varalign);
|
||||||
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 }
|
||||||
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))));
|
ftcb.finish_internal_data_builder(datatcb,ll,datadef,const_align(sizeof(pint)));
|
||||||
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 }
|
||||||
ftcb.queue_init(def);
|
ftcb.queue_init(def);
|
||||||
|
Loading…
Reference in New Issue
Block a user