summaryrefslogtreecommitdiff
path: root/compiler/ncgopt.pas
diff options
context:
space:
mode:
authorpeter <peter@3ad0048d-3df7-0310-abae-a5850022a9f2>2006-03-16 08:52:22 +0000
committerpeter <peter@3ad0048d-3df7-0310-abae-a5850022a9f2>2006-03-16 08:52:22 +0000
commit31939cbbd1673c7754968db6d1b5a8051fc67f21 (patch)
tree93e97ee863f7247804eaa74ae73625e6eff9be60 /compiler/ncgopt.pas
parentaedcc2eb56d11a8220cae841209482258c0fc330 (diff)
downloadfpc-31939cbbd1673c7754968db6d1b5a8051fc67f21.tar.gz
Merged revisions 2921-2922,2925 via svnmerge from
http://svn.freepascal.org/svn/fpc/branches/linker/compiler ........ r2921 | peter | 2006-03-15 08:35:00 +0100 (Wed, 15 Mar 2006) | 2 lines * pass ObjectWriter to ObjectOuput ........ r2922 | peter | 2006-03-15 12:40:30 +0100 (Wed, 15 Mar 2006) | 2 lines * refactor asmdata ........ r2925 | peter | 2006-03-15 16:09:39 +0100 (Wed, 15 Mar 2006) | 3 lines * add cfi to asmdata * move asmlist, asmcfi, asmdata to own unit ........ git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@2932 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/ncgopt.pas')
-rw-r--r--compiler/ncgopt.pas38
1 files changed, 19 insertions, 19 deletions
diff --git a/compiler/ncgopt.pas b/compiler/ncgopt.pas
index 133fb025b3..de1c30169c 100644
--- a/compiler/ncgopt.pas
+++ b/compiler/ncgopt.pas
@@ -40,7 +40,7 @@ uses
globtype,globals,
pass_1,defutil,htypechk,
symdef,paramgr,
- aasmbase,aasmtai,
+ aasmbase,aasmtai,aasmdata,
ncnv, ncon, pass_2,
cgbase, cpubase,
tgobj, cgobj, cgutils,ncgutil;
@@ -93,12 +93,12 @@ begin
{ ti386addnode.pass_2 }
secondpass(left);
if not(tg.istemp(left.location.reference) and
- (tg.sizeoftemp(exprasmlist,left.location.reference) = 256)) and
+ (tg.sizeoftemp(current_asmdata.CurrAsmList,left.location.reference) = 256)) and
not(nf_use_strconcat in flags) then
begin
- tg.Gettemp(exprasmlist,256,tt_normal,href);
- cg.g_copyshortstring(exprasmlist,left.location.reference,href,255);
- location_freetemp(exprasmlist,left.location);
+ tg.Gettemp(current_asmdata.CurrAsmList,256,tt_normal,href);
+ cg.g_copyshortstring(current_asmdata.CurrAsmList,left.location.reference,href,255);
+ location_freetemp(current_asmdata.CurrAsmList,left.location);
{ return temp reference }
location_reset(left.location,LOC_REFERENCE,def_cgsize(resulttype.def));
left.location.reference:=href;
@@ -116,16 +116,16 @@ begin
if right.location.loc in [LOC_REFERENCE,LOC_CREFERENCE] then
begin
{ get register for the char }
- hreg := cg.getintregister(exprasmlist,OS_8);
- cg.a_load_ref_reg(exprasmlist,OS_8,OS_8,right.location.reference,hreg);
+ hreg := cg.getintregister(current_asmdata.CurrAsmList,OS_8);
+ cg.a_load_ref_reg(current_asmdata.CurrAsmList,OS_8,OS_8,right.location.reference,hreg);
{ I don't think a temp char exists, but it won't hurt (JM) }
- tg.ungetiftemp(exprasmlist,right.location.reference);
+ tg.ungetiftemp(current_asmdata.CurrAsmList,right.location.reference);
end
else hreg := right.location.register;
{ load the current string length }
- lengthreg := cg.getintregister(exprasmlist,OS_INT);
- cg.a_load_ref_reg(exprasmlist,OS_8,OS_INT,left.location.reference,lengthreg);
+ lengthreg := cg.getintregister(current_asmdata.CurrAsmList,OS_INT);
+ cg.a_load_ref_reg(current_asmdata.CurrAsmList,OS_8,OS_INT,left.location.reference,lengthreg);
{ do we have to check the length ? }
if tg.istemp(left.location.reference) then
@@ -135,12 +135,12 @@ begin
if checklength then
begin
{ is it already maximal? }
- objectlibrary.getjumplabel(l);
+ current_asmdata.getjumplabel(l);
if tg.istemp(left.location.reference) then
len:=255
else
len:=tstringdef(left.resulttype.def).len;
- cg.a_cmp_const_reg_label(exprasmlist,OS_INT,OC_EQ,len,lengthreg,l)
+ cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList,OS_INT,OC_EQ,len,lengthreg,l)
end;
{ no, so increase the length and add the new character }
@@ -155,7 +155,7 @@ begin
{ they're not free, so add the base reg to }
{ the string length (since the index can }
{ have a scalefactor) and use lengthreg as base }
- cg.a_op_reg_reg(exprasmlist,OP_ADD,OS_INT,href2.base,lengthreg);
+ cg.a_op_reg_reg(current_asmdata.CurrAsmList,OP_ADD,OS_INT,href2.base,lengthreg);
href2.base := lengthreg;
end
else
@@ -176,16 +176,16 @@ begin
begin
{ no new_reference(href2) because it's only }
{ used once (JM) }
- cg.a_load_reg_ref(exprasmlist,OS_8,OS_8,hreg,href2);
+ cg.a_load_reg_ref(current_asmdata.CurrAsmList,OS_8,OS_8,hreg,href2);
end
else
- cg.a_load_const_ref(exprasmlist,OS_8,tordconstnode(right).value,href2);
- lengthreg:=cg.makeregsize(exprasmlist,lengthreg,OS_8);
+ cg.a_load_const_ref(current_asmdata.CurrAsmList,OS_8,tordconstnode(right).value,href2);
+ lengthreg:=cg.makeregsize(current_asmdata.CurrAsmList,lengthreg,OS_8);
{ increase the string length }
- cg.a_op_const_reg(exprasmlist,OP_ADD,OS_8,1,lengthreg);
- cg.a_load_reg_ref(exprasmlist,OS_8,OS_8,lengthreg,left.location.reference);
+ cg.a_op_const_reg(current_asmdata.CurrAsmList,OP_ADD,OS_8,1,lengthreg);
+ cg.a_load_reg_ref(current_asmdata.CurrAsmList,OS_8,OS_8,lengthreg,left.location.reference);
if checklength then
- cg.a_label(exprasmlist,l);
+ cg.a_label(current_asmdata.CurrAsmList,l);
location_copy(location,left.location);
end;