- Remove references to global variable 'cg' from methods of tcg and some of its descendants.

git-svn-id: trunk@26665 -
This commit is contained in:
sergei 2014-02-03 12:27:48 +00:00
parent 7104157a57
commit 0d3f36eebf
4 changed files with 15 additions and 15 deletions

View File

@ -759,7 +759,7 @@ implementation
No IE can be generated, because the VMT is written No IE can be generated, because the VMT is written
without a valid rg[] } without a valid rg[] }
if assigned(rg[rt]) then if assigned(rg[rt]) then
rg[rt].add_reg_instruction(instr,r,cg.executionweight); rg[rt].add_reg_instruction(instr,r,executionweight);
end; end;
@ -1131,7 +1131,7 @@ implementation
end; end;
end; end;
LOC_FPUREGISTER : LOC_FPUREGISTER :
cg.a_loadfpu_reg_ref(list,paraloc.size,paraloc.size,paraloc.register,ref); a_loadfpu_reg_ref(list,paraloc.size,paraloc.size,paraloc.register,ref);
LOC_REFERENCE : LOC_REFERENCE :
begin begin
reference_reset_base(href,paraloc.reference.index,paraloc.reference.offset,align); reference_reset_base(href,paraloc.reference.index,paraloc.reference.offset,align);
@ -2086,7 +2086,7 @@ implementation
(tcgsize2size[tosize]<>4) then (tcgsize2size[tosize]<>4) then
internalerror(2009112504); internalerror(2009112504);
tg.gettemp(list,8,8,tt_normal,tmpref); tg.gettemp(list,8,8,tt_normal,tmpref);
cg.a_loadmm_reg_ref(list,fromsize,fromsize,mmreg,tmpref,shuffle); a_loadmm_reg_ref(list,fromsize,fromsize,mmreg,tmpref,shuffle);
a_load_ref_reg(list,tosize,tosize,tmpref,intreg); a_load_ref_reg(list,tosize,tosize,tmpref,intreg);
tg.ungettemp(list,tmpref); tg.ungettemp(list,tmpref);
end; end;
@ -2362,7 +2362,7 @@ implementation
procedure tcg.g_exception_reason_load(list : TAsmList; const href : treference); procedure tcg.g_exception_reason_load(list : TAsmList; const href : treference);
begin begin
cg.a_reg_alloc(list,NR_FUNCTION_RESULT_REG); a_reg_alloc(list,NR_FUNCTION_RESULT_REG);
a_load_ref_reg(list, OS_INT, OS_INT, href, NR_FUNCTION_RESULT_REG); a_load_ref_reg(list, OS_INT, OS_INT, href, NR_FUNCTION_RESULT_REG);
end; end;

View File

@ -555,7 +555,7 @@ unit cgcpu;
begin begin
if not paramanager.use_fixed_stack then if not paramanager.use_fixed_stack then
begin begin
cg.a_reg_alloc(list,NR_FUNCTION_RESULT_REG); a_reg_alloc(list,NR_FUNCTION_RESULT_REG);
list.concat(Taicpu.op_reg(A_POP,tcgsize2opsize[OS_INT],NR_FUNCTION_RESULT_REG)) list.concat(Taicpu.op_reg(A_POP,tcgsize2opsize[OS_INT],NR_FUNCTION_RESULT_REG))
end end
else else
@ -584,7 +584,7 @@ unit cgcpu;
(current_settings.optimizecputype in [cpu_Pentium2,cpu_Pentium3,cpu_Pentium4]) } then (current_settings.optimizecputype in [cpu_Pentium2,cpu_Pentium3,cpu_Pentium4]) } then
begin begin
current_module.requires_ebx_pic_helper:=true; current_module.requires_ebx_pic_helper:=true;
cg.a_call_name_static(list,'fpc_geteipasebx'); a_call_name_static(list,'fpc_geteipasebx');
end end
else else
begin begin
@ -674,7 +674,7 @@ unit cgcpu;
else else
selfoffsetfromsp:=sizeof(aint); selfoffsetfromsp:=sizeof(aint);
reference_reset_base(href,NR_ESP,selfoffsetfromsp+offs,4); reference_reset_base(href,NR_ESP,selfoffsetfromsp+offs,4);
cg.a_load_ref_reg(list,OS_ADDR,OS_ADDR,href,NR_EAX); a_load_ref_reg(list,OS_ADDR,OS_ADDR,href,NR_EAX);
end; end;
end; end;
@ -684,7 +684,7 @@ unit cgcpu;
begin begin
{ mov 0(%eax),%reg ; load vmt} { mov 0(%eax),%reg ; load vmt}
reference_reset_base(href,NR_EAX,0,4); reference_reset_base(href,NR_EAX,0,4);
cg.a_load_ref_reg(list,OS_ADDR,OS_ADDR,href,reg); a_load_ref_reg(list,OS_ADDR,OS_ADDR,href,reg);
end; end;
procedure op_onregmethodaddr(op: TAsmOp; reg: tregister); procedure op_onregmethodaddr(op: TAsmOp; reg: tregister);
@ -707,7 +707,7 @@ unit cgcpu;
Internalerror(200006139); Internalerror(200006139);
{ mov vmtoffs(%eax),%eax ; method offs } { mov vmtoffs(%eax),%eax ; method offs }
reference_reset_base(href,NR_EAX,tobjectdef(procdef.struct).vmtmethodoffset(procdef.extnumber),4); reference_reset_base(href,NR_EAX,tobjectdef(procdef.struct).vmtmethodoffset(procdef.extnumber),4);
cg.a_load_ref_reg(list,OS_ADDR,OS_ADDR,href,NR_EAX); a_load_ref_reg(list,OS_ADDR,OS_ADDR,href,NR_EAX);
end; end;

View File

@ -1565,8 +1565,8 @@ begin
{ generate a loop } { generate a loop }
if len > 4 then if len > 4 then
begin begin
countreg := cg.GetIntRegister(list, OS_INT); countreg := GetIntRegister(list, OS_INT);
tmpreg1 := cg.GetIntRegister(list, OS_INT); tmpreg1 := GetIntRegister(list, OS_INT);
a_load_const_reg(list, OS_INT, len, countreg); a_load_const_reg(list, OS_INT, len, countreg);
current_asmdata.getjumplabel(lab); current_asmdata.getjumplabel(lab);
a_label(list, lab); a_label(list, lab);
@ -1580,7 +1580,7 @@ begin
else else
begin begin
{ unrolled loop } { unrolled loop }
tmpreg1 := cg.GetIntRegister(list, OS_INT); tmpreg1 := GetIntRegister(list, OS_INT);
for i := 1 to len do for i := 1 to len do
begin begin
list.concat(taicpu.op_reg_ref(A_LBU, tmpreg1, src)); list.concat(taicpu.op_reg_ref(A_LBU, tmpreg1, src));

View File

@ -564,7 +564,7 @@ unit cgx86;
begin begin
include(current_procinfo.flags,pi_needs_got); include(current_procinfo.flags,pi_needs_got);
{ make a copy of the got register, hreg can get modified } { make a copy of the got register, hreg can get modified }
hreg:=cg.getaddressregister(list); hreg:=getaddressregister(list);
a_load_reg_reg(list,OS_ADDR,OS_ADDR,current_procinfo.got,hreg); a_load_reg_reg(list,OS_ADDR,OS_ADDR,current_procinfo.got,hreg);
ref.relsymbol:=current_procinfo.CurrGOTLabel; ref.relsymbol:=current_procinfo.CurrGOTLabel;
end; end;
@ -578,7 +578,7 @@ unit cgx86;
href.base:=current_procinfo.got; href.base:=current_procinfo.got;
href.refaddr:=addr_pic; href.refaddr:=addr_pic;
include(current_procinfo.flags,pi_needs_got); include(current_procinfo.flags,pi_needs_got);
hreg:=cg.getaddressregister(list); hreg:=getaddressregister(list);
list.concat(taicpu.op_ref_reg(A_MOV,S_L,href,hreg)); list.concat(taicpu.op_ref_reg(A_MOV,S_L,href,hreg));
ref.symbol:=nil; ref.symbol:=nil;
add_hreg:=true; add_hreg:=true;
@ -2808,7 +2808,7 @@ unit cgx86;
begin begin
if target_info.stackalign>sizeof(pint) then if target_info.stackalign>sizeof(pint) then
localsize := align(localsize+stackmisalignment,target_info.stackalign)-stackmisalignment; localsize := align(localsize+stackmisalignment,target_info.stackalign)-stackmisalignment;
cg.g_stackpointer_alloc(list,localsize); g_stackpointer_alloc(list,localsize);
if current_procinfo.framepointer=NR_STACK_POINTER_REG then if current_procinfo.framepointer=NR_STACK_POINTER_REG then
current_asmdata.asmcfi.cfa_def_cfa_offset(list,localsize+sizeof(pint)); current_asmdata.asmcfi.cfa_def_cfa_offset(list,localsize+sizeof(pint));
current_procinfo.final_localsize:=localsize; current_procinfo.final_localsize:=localsize;