- 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
without a valid rg[] }
if assigned(rg[rt]) then
rg[rt].add_reg_instruction(instr,r,cg.executionweight);
rg[rt].add_reg_instruction(instr,r,executionweight);
end;
@ -1131,7 +1131,7 @@ implementation
end;
end;
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 :
begin
reference_reset_base(href,paraloc.reference.index,paraloc.reference.offset,align);
@ -2086,7 +2086,7 @@ implementation
(tcgsize2size[tosize]<>4) then
internalerror(2009112504);
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);
tg.ungettemp(list,tmpref);
end;
@ -2362,7 +2362,7 @@ implementation
procedure tcg.g_exception_reason_load(list : TAsmList; const href : treference);
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);
end;

View File

@ -555,7 +555,7 @@ unit cgcpu;
begin
if not paramanager.use_fixed_stack then
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))
end
else
@ -584,7 +584,7 @@ unit cgcpu;
(current_settings.optimizecputype in [cpu_Pentium2,cpu_Pentium3,cpu_Pentium4]) } then
begin
current_module.requires_ebx_pic_helper:=true;
cg.a_call_name_static(list,'fpc_geteipasebx');
a_call_name_static(list,'fpc_geteipasebx');
end
else
begin
@ -674,7 +674,7 @@ unit cgcpu;
else
selfoffsetfromsp:=sizeof(aint);
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;
@ -684,7 +684,7 @@ unit cgcpu;
begin
{ mov 0(%eax),%reg ; load vmt}
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;
procedure op_onregmethodaddr(op: TAsmOp; reg: tregister);
@ -707,7 +707,7 @@ unit cgcpu;
Internalerror(200006139);
{ mov vmtoffs(%eax),%eax ; method offs }
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;

View File

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

View File

@ -564,7 +564,7 @@ unit cgx86;
begin
include(current_procinfo.flags,pi_needs_got);
{ 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);
ref.relsymbol:=current_procinfo.CurrGOTLabel;
end;
@ -578,7 +578,7 @@ unit cgx86;
href.base:=current_procinfo.got;
href.refaddr:=addr_pic;
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));
ref.symbol:=nil;
add_hreg:=true;
@ -2808,7 +2808,7 @@ unit cgx86;
begin
if target_info.stackalign>sizeof(pint) then
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
current_asmdata.asmcfi.cfa_def_cfa_offset(list,localsize+sizeof(pint));
current_procinfo.final_localsize:=localsize;