* renamed getdatalabel() to getglobaldatalabel

git-svn-id: branches/hlcgllvm@30336 -
This commit is contained in:
Jonas Maebe 2015-03-27 21:25:34 +00:00
parent 5e1bb8e408
commit 687bb15299
13 changed files with 30 additions and 30 deletions

View File

@ -826,7 +826,7 @@ implementation
charptrdef: tdef; charptrdef: tdef;
elesize: word; elesize: word;
begin begin
current_asmdata.getdatalabel(result.lab); current_asmdata.getglobaldatalabel(result.lab);
startlab:=result.lab; startlab:=result.lab;
result.ofs:=0; result.ofs:=0;
{ pack the data, so that we don't add unnecessary null bytes after the { pack the data, so that we don't add unnecessary null bytes after the
@ -867,7 +867,7 @@ implementation
{ results in slightly more efficient code } { results in slightly more efficient code }
emit_tai(tai_label.create(result.lab),charptrdef); emit_tai(tai_label.create(result.lab),charptrdef);
result.ofs:=0; result.ofs:=0;
current_asmdata.getdatalabel(startlab); current_asmdata.getglobaldatalabel(startlab);
end; end;
{ sanity check } { sanity check }
if result.ofs<>string_symofs then if result.ofs<>string_symofs then
@ -1001,7 +1001,7 @@ implementation
if winlike then if winlike then
begin begin
datatcb.begin_anonymous_record('$'+get_dynstring_rec_name(st_widestring,true,strlength),sizeof(pint)); datatcb.begin_anonymous_record('$'+get_dynstring_rec_name(st_widestring,true,strlength),sizeof(pint));
current_asmdata.getdatalabel(result.lab); current_asmdata.getglobaldatalabel(result.lab);
datatcb.emit_tai(Tai_const.Create_32bit(strlength*cwidechartype.size),s32inttype); datatcb.emit_tai(Tai_const.Create_32bit(strlength*cwidechartype.size),s32inttype);
{ can we optimise by placing the string constant label at the { can we optimise by placing the string constant label at the
required offset? } required offset? }
@ -1011,7 +1011,7 @@ implementation
{ yes } { yes }
datatcb.emit_tai(Tai_label.Create(result.lab),widecharpointertype); datatcb.emit_tai(Tai_label.Create(result.lab),widecharpointertype);
{ allocate a separate label for the start of the data } { allocate a separate label for the start of the data }
current_asmdata.getdatalabel(startlab); current_asmdata.getglobaldatalabel(startlab);
end end
else else
internalerror(2015031502); internalerror(2015031502);

View File

@ -173,7 +173,7 @@ interface
procedure getjumplabel(out l : TAsmLabel); procedure getjumplabel(out l : TAsmLabel);
procedure getglobaljumplabel(out l : TAsmLabel); procedure getglobaljumplabel(out l : TAsmLabel);
procedure getaddrlabel(out l : TAsmLabel); procedure getaddrlabel(out l : TAsmLabel);
procedure getdatalabel(out l : TAsmLabel); procedure getglobaldatalabel(out l : TAsmLabel);
{ generate an alternative (duplicate) symbol } { generate an alternative (duplicate) symbol }
procedure GenerateAltSymbol(p:TAsmSymbol); procedure GenerateAltSymbol(p:TAsmSymbol);
procedure ResetAltSymbols; procedure ResetAltSymbols;
@ -510,7 +510,7 @@ implementation
inc(FNextLabelNr[alt_jump]); inc(FNextLabelNr[alt_jump]);
end; end;
procedure TAsmData.getdatalabel(out l : TAsmLabel); procedure TAsmData.getglobaldatalabel(out l : TAsmLabel);
begin begin
l:=TAsmLabel.createglobal(AsmSymbolDict,name^,FNextLabelNr[alt_data],alt_data); l:=TAsmLabel.createglobal(AsmSymbolDict,name^,FNextLabelNr[alt_data],alt_data);
inc(FNextLabelNr[alt_data]); inc(FNextLabelNr[alt_data]);

View File

@ -2267,7 +2267,7 @@ unit cgcpu;
(tf_pic_uses_got in target_info.flags) then (tf_pic_uses_got in target_info.flags) then
begin begin
reference_reset(ref,4); reference_reset(ref,4);
current_asmdata.getdatalabel(l); current_asmdata.getglobaldatalabel(l);
cg.a_label(current_procinfo.aktlocaldata,l); cg.a_label(current_procinfo.aktlocaldata,l);
ref.symbol:=l; ref.symbol:=l;
ref.base:=NR_PC; ref.base:=NR_PC;

View File

@ -206,7 +206,7 @@ implementation
instr.oppostfix:=PF_D; instr.oppostfix:=PF_D;
current_asmdata.CurrAsmList.concat(instr); current_asmdata.CurrAsmList.concat(instr);
current_asmdata.getdatalabel(l1); current_asmdata.getglobaldatalabel(l1);
current_asmdata.getjumplabel(l2); current_asmdata.getjumplabel(l2);
reference_reset_symbol(href,l1,0,const_align(8)); reference_reset_symbol(href,l1,0,const_align(8));

View File

@ -955,10 +955,10 @@ implementation
begin begin
{ The pointer typecast is needed to prevent a problem with range checking { The pointer typecast is needed to prevent a problem with range checking
on when the typecast is changed to 'as' } on when the typecast is changed to 'as' }
current_asmdata.getdatalabel(TAsmLabel(pointer(def.dwarf_lab))); current_asmdata.getglobaldatalabel(TAsmLabel(pointer(def.dwarf_lab)));
current_asmdata.getdatalabel(TAsmLabel(pointer(def.dwarf_ref_lab))); current_asmdata.getglobaldatalabel(TAsmLabel(pointer(def.dwarf_ref_lab)));
if is_implicit_pointer_object_type(def) then if is_implicit_pointer_object_type(def) then
current_asmdata.getdatalabel(TAsmLabel(pointer(tobjectdef(def).dwarf_struct_lab))); current_asmdata.getglobaldatalabel(TAsmLabel(pointer(tobjectdef(def).dwarf_struct_lab)));
end; end;
end; end;
end end
@ -1763,7 +1763,7 @@ implementation
{ create a structure with two elements } { create a structure with two elements }
if not(tf_dwarf_only_local_labels in target_info.flags) then if not(tf_dwarf_only_local_labels in target_info.flags) then
current_asmdata.getdatalabel(arr) current_asmdata.getglobaldatalabel(arr)
else else
current_asmdata.getaddrlabel(arr); current_asmdata.getaddrlabel(arr);
append_entry(DW_TAG_structure_type,true,[ append_entry(DW_TAG_structure_type,true,[
@ -1899,7 +1899,7 @@ implementation
begin begin
{ create a structure with two elements } { create a structure with two elements }
if not(tf_dwarf_only_local_labels in target_info.flags) then if not(tf_dwarf_only_local_labels in target_info.flags) then
current_asmdata.getdatalabel(proc) current_asmdata.getglobaldatalabel(proc)
else else
current_asmdata.getaddrlabel(proc); current_asmdata.getaddrlabel(proc);
append_entry(DW_TAG_structure_type,true,[ append_entry(DW_TAG_structure_type,true,[
@ -3704,7 +3704,7 @@ implementation
if assigned(def.elementdef) then if assigned(def.elementdef) then
begin begin
if not(tf_dwarf_only_local_labels in target_info.flags) then if not(tf_dwarf_only_local_labels in target_info.flags) then
current_asmdata.getdatalabel(lab) current_asmdata.getglobaldatalabel(lab)
else else
current_asmdata.getaddrlabel(lab); current_asmdata.getaddrlabel(lab);
append_labelentry_ref(DW_AT_type,lab); append_labelentry_ref(DW_AT_type,lab);
@ -4016,7 +4016,7 @@ implementation
obj : tasmlabel; obj : tasmlabel;
begin begin
if not(tf_dwarf_only_local_labels in target_info.flags) then if not(tf_dwarf_only_local_labels in target_info.flags) then
current_asmdata.getdatalabel(obj) current_asmdata.getglobaldatalabel(obj)
else else
current_asmdata.getaddrlabel(obj); current_asmdata.getaddrlabel(obj);
{ implicit pointer } { implicit pointer }

View File

@ -153,7 +153,7 @@ begin
loadsigned(tfloatdef(resultdef).floattype) loadsigned(tfloatdef(resultdef).floattype)
else else
begin begin
current_asmdata.getdatalabel(l1); current_asmdata.getglobaldatalabel(l1);
current_asmdata.getjumplabel(l2); current_asmdata.getjumplabel(l2);
reference_reset_symbol(href, l1, 0, sizeof(aint)); reference_reset_symbol(href, l1, 0, sizeof(aint));
hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,left.resultdef,true); hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,left.resultdef,true);

View File

@ -95,7 +95,7 @@ implementation
b : byte; b : byte;
begin begin
location_reset_ref(location,LOC_CREFERENCE,OS_NO,const_align(maxalign)); location_reset_ref(location,LOC_CREFERENCE,OS_NO,const_align(maxalign));
current_asmdata.getdatalabel(l); current_asmdata.getglobaldatalabel(l);
maybe_new_object_file(current_asmdata.asmlists[al_typedconsts]); maybe_new_object_file(current_asmdata.asmlists[al_typedconsts]);
new_section(current_asmdata.asmlists[al_typedconsts],sec_rodata_norel,l.name,const_align(maxalign)); new_section(current_asmdata.asmlists[al_typedconsts],sec_rodata_norel,l.name,const_align(maxalign));
current_asmdata.asmlists[al_typedconsts].concat(Tai_label.Create(l)); current_asmdata.asmlists[al_typedconsts].concat(Tai_label.Create(l));
@ -162,7 +162,7 @@ implementation
{ :-(, we must generate a new entry } { :-(, we must generate a new entry }
if not(assigned(lab_real)) then if not(assigned(lab_real)) then
begin begin
current_asmdata.getdatalabel(lastlabel); current_asmdata.getglobaldatalabel(lastlabel);
entry^.Data:=lastlabel; entry^.Data:=lastlabel;
lab_real:=lastlabel; lab_real:=lastlabel;
maybe_new_object_file(current_asmdata.asmlists[al_typedconsts]); maybe_new_object_file(current_asmdata.asmlists[al_typedconsts]);
@ -358,7 +358,7 @@ implementation
end; end;
cst_shortstring: cst_shortstring:
begin begin
current_asmdata.getdatalabel(lastlabel.lab); current_asmdata.getglobaldatalabel(lastlabel.lab);
datatcb:=ctai_typedconstbuilder.create([tcalo_is_lab,tcalo_make_dead_strippable]); datatcb:=ctai_typedconstbuilder.create([tcalo_is_lab,tcalo_make_dead_strippable]);
{ truncate strings larger than 255 chars } { truncate strings larger than 255 chars }
@ -382,7 +382,7 @@ implementation
end; end;
cst_conststring: cst_conststring:
begin begin
current_asmdata.getdatalabel(lastlabel.lab); current_asmdata.getglobaldatalabel(lastlabel.lab);
datatcb:=ctai_typedconstbuilder.create([tcalo_is_lab,tcalo_make_dead_strippable]); datatcb:=ctai_typedconstbuilder.create([tcalo_is_lab,tcalo_make_dead_strippable]);
{ include terminating zero } { include terminating zero }
@ -446,7 +446,7 @@ implementation
lab: tasmlabel; lab: tasmlabel;
i: longint; i: longint;
begin begin
current_asmdata.getdatalabel(lab); current_asmdata.getglobaldatalabel(lab);
result:=lab; result:=lab;
lab_set:=lab; lab_set:=lab;
maybe_new_object_file(current_asmdata.asmlists[al_typedconsts]); maybe_new_object_file(current_asmdata.asmlists[al_typedconsts]);
@ -528,7 +528,7 @@ implementation
{ :-(, we must generate a new entry } { :-(, we must generate a new entry }
if not assigned(entry^.Data) then if not assigned(entry^.Data) then
begin begin
current_asmdata.getdatalabel(lastlabel); current_asmdata.getglobaldatalabel(lastlabel);
lab_set:=lastlabel; lab_set:=lastlabel;
entry^.Data:=lastlabel; entry^.Data:=lastlabel;
maybe_new_object_file(current_asmdata.asmlists[al_typedconsts]); maybe_new_object_file(current_asmdata.asmlists[al_typedconsts]);
@ -588,7 +588,7 @@ implementation
{ :-(, we must generate a new entry } { :-(, we must generate a new entry }
if not assigned(entry^.Data) then if not assigned(entry^.Data) then
begin begin
current_asmdata.getdatalabel(lastlabel); current_asmdata.getglobaldatalabel(lastlabel);
lab_set:=lastlabel; lab_set:=lastlabel;
entry^.Data:=lastlabel; entry^.Data:=lastlabel;
maybe_new_object_file(current_asmdata.asmlists[al_typedconsts]); maybe_new_object_file(current_asmdata.asmlists[al_typedconsts]);

View File

@ -235,7 +235,7 @@ implementation
len : byte; len : byte;
tcb : ttai_typedconstbuilder; tcb : ttai_typedconstbuilder;
begin begin
current_asmdata.getdatalabel(p^.nl); current_asmdata.getglobaldatalabel(p^.nl);
if assigned(p^.l) then if assigned(p^.l) then
writenames(list,p^.l); writenames(list,p^.l);
tcb:=ctai_typedconstbuilder.create([tcalo_is_lab]); tcb:=ctai_typedconstbuilder.create([tcalo_is_lab]);
@ -446,7 +446,7 @@ implementation
if count>0 then if count>0 then
begin begin
current_asmdata.getdatalabel(r); current_asmdata.getglobaldatalabel(r);
gendmt:=r; gendmt:=r;
al_globals.concat(cai_align.create(const_align(sizeof(pint)))); al_globals.concat(cai_align.create(const_align(sizeof(pint))));
al_globals.concat(Tai_label.Create(r)); al_globals.concat(Tai_label.Create(r));

View File

@ -152,7 +152,7 @@ implementation
end end
else else
begin begin
current_asmdata.getdatalabel(l1); current_asmdata.getglobaldatalabel(l1);
current_asmdata.getjumplabel(l2); current_asmdata.getjumplabel(l2);
reference_reset_symbol(href,l1,0,8); reference_reset_symbol(href,l1,0,8);
hregister:=cg.getintregister(current_asmdata.CurrAsmList,OS_32); hregister:=cg.getintregister(current_asmdata.CurrAsmList,OS_32);

View File

@ -392,7 +392,7 @@ implementation
if it is 1 then we add 2**64 as float. if it is 1 then we add 2**64 as float.
Since 2**64 can be represented exactly, use a single-precision Since 2**64 can be represented exactly, use a single-precision
constant to save space. } constant to save space. }
current_asmdata.getdatalabel(l1); current_asmdata.getglobaldatalabel(l1);
current_asmdata.getjumplabel(l2); current_asmdata.getjumplabel(l2);
if not(signtested) then if not(signtested) then

View File

@ -168,7 +168,7 @@ interface
{ make life of register allocator easier } { make life of register allocator easier }
location.register:=cg.getmmregister(current_asmdata.CurrAsmList,def_cgsize(resultdef)); location.register:=cg.getmmregister(current_asmdata.CurrAsmList,def_cgsize(resultdef));
current_asmdata.getdatalabel(l1); current_asmdata.getglobaldatalabel(l1);
new_section(current_asmdata.asmlists[al_typedconsts],sec_rodata_norel,l1.name,const_align(sizeof(pint))); new_section(current_asmdata.asmlists[al_typedconsts],sec_rodata_norel,l1.name,const_align(sizeof(pint)));
current_asmdata.asmlists[al_typedconsts].concat(Tai_label.Create(l1)); current_asmdata.asmlists[al_typedconsts].concat(Tai_label.Create(l1));
case def_cgsize(resultdef) of case def_cgsize(resultdef) of

View File

@ -113,7 +113,7 @@ implementation
cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList,opcgsize,OC_A,aint(max_)-aint(min_),hregister,elselabel); cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList,opcgsize,OC_A,aint(max_)-aint(min_),hregister,elselabel);
min_:=0; min_:=0;
end; end;
current_asmdata.getdatalabel(table); current_asmdata.getglobaldatalabel(table);
{ make it a 32bit register } { make it a 32bit register }
indexreg:=cg.makeregsize(current_asmdata.CurrAsmList,hregister,OS_INT); indexreg:=cg.makeregsize(current_asmdata.CurrAsmList,hregister,OS_INT);
cg.a_load_reg_reg(current_asmdata.CurrAsmList,opcgsize,OS_INT,hregister,indexreg); cg.a_load_reg_reg(current_asmdata.CurrAsmList,opcgsize,OS_INT,hregister,indexreg);

View File

@ -110,7 +110,7 @@ implementation
we load bits 0..62 and then check bit 63: we load bits 0..62 and then check bit 63:
if it is 1 then we add $80000000 000000000 if it is 1 then we add $80000000 000000000
as double } as double }
current_asmdata.getdatalabel(l1); current_asmdata.getglobaldatalabel(l1);
current_asmdata.getjumplabel(l2); current_asmdata.getjumplabel(l2);
{ Get sign bit } { Get sign bit }