mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-19 13:29:29 +02:00
* second part bug report 1996 fix, testrange in cordconstnode
only called if option is set (also make parsing a tiny faster)
This commit is contained in:
parent
edb02a1409
commit
6c2bede5a8
@ -277,23 +277,23 @@ implementation
|
|||||||
muln :
|
muln :
|
||||||
t:=genintconstnode(lv*rv);
|
t:=genintconstnode(lv*rv);
|
||||||
xorn :
|
xorn :
|
||||||
t:=cordconstnode.create(lv xor rv,left.resulttype);
|
t:=cordconstnode.create(lv xor rv,left.resulttype,true);
|
||||||
orn :
|
orn :
|
||||||
t:=cordconstnode.create(lv or rv,left.resulttype);
|
t:=cordconstnode.create(lv or rv,left.resulttype,true);
|
||||||
andn :
|
andn :
|
||||||
t:=cordconstnode.create(lv and rv,left.resulttype);
|
t:=cordconstnode.create(lv and rv,left.resulttype,true);
|
||||||
ltn :
|
ltn :
|
||||||
t:=cordconstnode.create(ord(lv<rv),booltype);
|
t:=cordconstnode.create(ord(lv<rv),booltype,true);
|
||||||
lten :
|
lten :
|
||||||
t:=cordconstnode.create(ord(lv<=rv),booltype);
|
t:=cordconstnode.create(ord(lv<=rv),booltype,true);
|
||||||
gtn :
|
gtn :
|
||||||
t:=cordconstnode.create(ord(lv>rv),booltype);
|
t:=cordconstnode.create(ord(lv>rv),booltype,true);
|
||||||
gten :
|
gten :
|
||||||
t:=cordconstnode.create(ord(lv>=rv),booltype);
|
t:=cordconstnode.create(ord(lv>=rv),booltype,true);
|
||||||
equaln :
|
equaln :
|
||||||
t:=cordconstnode.create(ord(lv=rv),booltype);
|
t:=cordconstnode.create(ord(lv=rv),booltype,true);
|
||||||
unequaln :
|
unequaln :
|
||||||
t:=cordconstnode.create(ord(lv<>rv),booltype);
|
t:=cordconstnode.create(ord(lv<>rv),booltype,true);
|
||||||
slashn :
|
slashn :
|
||||||
begin
|
begin
|
||||||
{ int/int becomes a real }
|
{ int/int becomes a real }
|
||||||
@ -350,17 +350,17 @@ implementation
|
|||||||
t:=crealconstnode.create(lvd/rvd,pbestrealtype^);
|
t:=crealconstnode.create(lvd/rvd,pbestrealtype^);
|
||||||
end;
|
end;
|
||||||
ltn :
|
ltn :
|
||||||
t:=cordconstnode.create(ord(lvd<rvd),booltype);
|
t:=cordconstnode.create(ord(lvd<rvd),booltype,true);
|
||||||
lten :
|
lten :
|
||||||
t:=cordconstnode.create(ord(lvd<=rvd),booltype);
|
t:=cordconstnode.create(ord(lvd<=rvd),booltype,true);
|
||||||
gtn :
|
gtn :
|
||||||
t:=cordconstnode.create(ord(lvd>rvd),booltype);
|
t:=cordconstnode.create(ord(lvd>rvd),booltype,true);
|
||||||
gten :
|
gten :
|
||||||
t:=cordconstnode.create(ord(lvd>=rvd),booltype);
|
t:=cordconstnode.create(ord(lvd>=rvd),booltype,true);
|
||||||
equaln :
|
equaln :
|
||||||
t:=cordconstnode.create(ord(lvd=rvd),booltype);
|
t:=cordconstnode.create(ord(lvd=rvd),booltype,true);
|
||||||
unequaln :
|
unequaln :
|
||||||
t:=cordconstnode.create(ord(lvd<>rvd),booltype);
|
t:=cordconstnode.create(ord(lvd<>rvd),booltype,true);
|
||||||
else
|
else
|
||||||
CGMessage(type_e_mismatch);
|
CGMessage(type_e_mismatch);
|
||||||
end;
|
end;
|
||||||
@ -389,17 +389,17 @@ implementation
|
|||||||
t:=cstringconstnode.createwstr(ws1);
|
t:=cstringconstnode.createwstr(ws1);
|
||||||
end;
|
end;
|
||||||
ltn :
|
ltn :
|
||||||
t:=cordconstnode.create(byte(comparewidestrings(ws1,ws2)<0),booltype);
|
t:=cordconstnode.create(byte(comparewidestrings(ws1,ws2)<0),booltype,true);
|
||||||
lten :
|
lten :
|
||||||
t:=cordconstnode.create(byte(comparewidestrings(ws1,ws2)<=0),booltype);
|
t:=cordconstnode.create(byte(comparewidestrings(ws1,ws2)<=0),booltype,true);
|
||||||
gtn :
|
gtn :
|
||||||
t:=cordconstnode.create(byte(comparewidestrings(ws1,ws2)>0),booltype);
|
t:=cordconstnode.create(byte(comparewidestrings(ws1,ws2)>0),booltype,true);
|
||||||
gten :
|
gten :
|
||||||
t:=cordconstnode.create(byte(comparewidestrings(ws1,ws2)>=0),booltype);
|
t:=cordconstnode.create(byte(comparewidestrings(ws1,ws2)>=0),booltype,true);
|
||||||
equaln :
|
equaln :
|
||||||
t:=cordconstnode.create(byte(comparewidestrings(ws1,ws2)=0),booltype);
|
t:=cordconstnode.create(byte(comparewidestrings(ws1,ws2)=0),booltype,true);
|
||||||
unequaln :
|
unequaln :
|
||||||
t:=cordconstnode.create(byte(comparewidestrings(ws1,ws2)<>0),booltype);
|
t:=cordconstnode.create(byte(comparewidestrings(ws1,ws2)<>0),booltype,true);
|
||||||
end;
|
end;
|
||||||
donewidestring(ws1);
|
donewidestring(ws1);
|
||||||
donewidestring(ws2);
|
donewidestring(ws2);
|
||||||
@ -453,17 +453,17 @@ implementation
|
|||||||
addn :
|
addn :
|
||||||
t:=cstringconstnode.createpchar(concatansistrings(s1,s2,l1,l2),l1+l2);
|
t:=cstringconstnode.createpchar(concatansistrings(s1,s2,l1,l2),l1+l2);
|
||||||
ltn :
|
ltn :
|
||||||
t:=cordconstnode.create(byte(compareansistrings(s1,s2,l1,l2)<0),booltype);
|
t:=cordconstnode.create(byte(compareansistrings(s1,s2,l1,l2)<0),booltype,true);
|
||||||
lten :
|
lten :
|
||||||
t:=cordconstnode.create(byte(compareansistrings(s1,s2,l1,l2)<=0),booltype);
|
t:=cordconstnode.create(byte(compareansistrings(s1,s2,l1,l2)<=0),booltype,true);
|
||||||
gtn :
|
gtn :
|
||||||
t:=cordconstnode.create(byte(compareansistrings(s1,s2,l1,l2)>0),booltype);
|
t:=cordconstnode.create(byte(compareansistrings(s1,s2,l1,l2)>0),booltype,true);
|
||||||
gten :
|
gten :
|
||||||
t:=cordconstnode.create(byte(compareansistrings(s1,s2,l1,l2)>=0),booltype);
|
t:=cordconstnode.create(byte(compareansistrings(s1,s2,l1,l2)>=0),booltype,true);
|
||||||
equaln :
|
equaln :
|
||||||
t:=cordconstnode.create(byte(compareansistrings(s1,s2,l1,l2)=0),booltype);
|
t:=cordconstnode.create(byte(compareansistrings(s1,s2,l1,l2)=0),booltype,true);
|
||||||
unequaln :
|
unequaln :
|
||||||
t:=cordconstnode.create(byte(compareansistrings(s1,s2,l1,l2)<>0),booltype);
|
t:=cordconstnode.create(byte(compareansistrings(s1,s2,l1,l2)<>0),booltype,true);
|
||||||
end;
|
end;
|
||||||
ansistringdispose(s1,l1);
|
ansistringdispose(s1,l1);
|
||||||
ansistringdispose(s2,l2);
|
ansistringdispose(s2,l2);
|
||||||
@ -527,7 +527,7 @@ implementation
|
|||||||
b:=false;
|
b:=false;
|
||||||
break;
|
break;
|
||||||
end;
|
end;
|
||||||
t:=cordconstnode.create(ord(b),booltype);
|
t:=cordconstnode.create(ord(b),booltype,true);
|
||||||
end;
|
end;
|
||||||
equaln :
|
equaln :
|
||||||
begin
|
begin
|
||||||
@ -538,7 +538,7 @@ implementation
|
|||||||
b:=false;
|
b:=false;
|
||||||
break;
|
break;
|
||||||
end;
|
end;
|
||||||
t:=cordconstnode.create(ord(b),booltype);
|
t:=cordconstnode.create(ord(b),booltype,true);
|
||||||
end;
|
end;
|
||||||
lten :
|
lten :
|
||||||
begin
|
begin
|
||||||
@ -550,7 +550,7 @@ implementation
|
|||||||
b := false;
|
b := false;
|
||||||
break
|
break
|
||||||
end;
|
end;
|
||||||
t := cordconstnode.create(ord(b),booltype);
|
t := cordconstnode.create(ord(b),booltype,true);
|
||||||
end;
|
end;
|
||||||
gten :
|
gten :
|
||||||
begin
|
begin
|
||||||
@ -562,7 +562,7 @@ implementation
|
|||||||
b := false;
|
b := false;
|
||||||
break
|
break
|
||||||
end;
|
end;
|
||||||
t := cordconstnode.create(ord(b),booltype);
|
t := cordconstnode.create(ord(b),booltype,true);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -591,22 +591,22 @@ implementation
|
|||||||
unequaln :
|
unequaln :
|
||||||
begin
|
begin
|
||||||
b:=tsetconstnode(right).value_set^ <> tsetconstnode(left).value_set^;
|
b:=tsetconstnode(right).value_set^ <> tsetconstnode(left).value_set^;
|
||||||
t:=cordconstnode.create(byte(b),booltype);
|
t:=cordconstnode.create(byte(b),booltype,true);
|
||||||
end;
|
end;
|
||||||
equaln :
|
equaln :
|
||||||
begin
|
begin
|
||||||
b:=tsetconstnode(right).value_set^ = tsetconstnode(left).value_set^;
|
b:=tsetconstnode(right).value_set^ = tsetconstnode(left).value_set^;
|
||||||
t:=cordconstnode.create(byte(b),booltype);
|
t:=cordconstnode.create(byte(b),booltype,true);
|
||||||
end;
|
end;
|
||||||
lten :
|
lten :
|
||||||
begin
|
begin
|
||||||
b:=tsetconstnode(left).value_set^ <= tsetconstnode(right).value_set^;
|
b:=tsetconstnode(left).value_set^ <= tsetconstnode(right).value_set^;
|
||||||
t:=cordconstnode.create(byte(b),booltype);
|
t:=cordconstnode.create(byte(b),booltype,true);
|
||||||
end;
|
end;
|
||||||
gten :
|
gten :
|
||||||
begin
|
begin
|
||||||
b:=tsetconstnode(left).value_set^ >= tsetconstnode(right).value_set^;
|
b:=tsetconstnode(left).value_set^ >= tsetconstnode(right).value_set^;
|
||||||
t:=cordconstnode.create(byte(b),booltype);
|
t:=cordconstnode.create(byte(b),booltype,true);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{$endif}
|
{$endif}
|
||||||
@ -1077,7 +1077,8 @@ implementation
|
|||||||
CGMessage(type_e_mismatch);
|
CGMessage(type_e_mismatch);
|
||||||
if (rd.deftype=pointerdef) and
|
if (rd.deftype=pointerdef) and
|
||||||
(tpointerdef(rd).pointertype.def.size>1) then
|
(tpointerdef(rd).pointertype.def.size>1) then
|
||||||
left:=caddnode.create(muln,left,cordconstnode.create(tpointerdef(rd).pointertype.def.size,s32bittype));
|
left:=caddnode.create(muln,left,
|
||||||
|
cordconstnode.create(tpointerdef(rd).pointertype.def.size,s32bittype,true));
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
CGMessage(type_e_mismatch);
|
CGMessage(type_e_mismatch);
|
||||||
@ -1098,7 +1099,8 @@ implementation
|
|||||||
CGMessage(type_e_mismatch);
|
CGMessage(type_e_mismatch);
|
||||||
if (ld.deftype=pointerdef) and
|
if (ld.deftype=pointerdef) and
|
||||||
(tpointerdef(ld).pointertype.def.size>1) then
|
(tpointerdef(ld).pointertype.def.size>1) then
|
||||||
right:=caddnode.create(muln,right,cordconstnode.create(tpointerdef(ld).pointertype.def.size,s32bittype));
|
right:=caddnode.create(muln,right,
|
||||||
|
cordconstnode.create(tpointerdef(ld).pointertype.def.size,s32bittype,true));
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
CGMessage(type_e_mismatch);
|
CGMessage(type_e_mismatch);
|
||||||
@ -1190,7 +1192,7 @@ implementation
|
|||||||
{ compare the length with 0 }
|
{ compare the length with 0 }
|
||||||
result := caddnode.create(nodetype,
|
result := caddnode.create(nodetype,
|
||||||
cinlinenode.create(in_length_x,false,left),
|
cinlinenode.create(in_length_x,false,left),
|
||||||
cordconstnode.create(0,s32bittype))
|
cordconstnode.create(0,s32bittype,false))
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
{ compare the pointer with nil (for ansistrings etc), }
|
{ compare the pointer with nil (for ansistrings etc), }
|
||||||
@ -1214,7 +1216,7 @@ implementation
|
|||||||
ccallparanode.create(right,ccallparanode.create(left,nil)));
|
ccallparanode.create(right,ccallparanode.create(left,nil)));
|
||||||
{ and compare its result with 0 according to the original operator }
|
{ and compare its result with 0 according to the original operator }
|
||||||
result := caddnode.create(nodetype,result,
|
result := caddnode.create(nodetype,result,
|
||||||
cordconstnode.create(0,s32bittype));
|
cordconstnode.create(0,s32bittype,false));
|
||||||
left := nil;
|
left := nil;
|
||||||
right := nil;
|
right := nil;
|
||||||
firstpass(result);
|
firstpass(result);
|
||||||
@ -1409,7 +1411,7 @@ implementation
|
|||||||
|
|
||||||
{ otherwise, create the parameters for the helper }
|
{ otherwise, create the parameters for the helper }
|
||||||
right := ccallparanode.create(
|
right := ccallparanode.create(
|
||||||
cordconstnode.create(ord(cs_check_overflow in aktlocalswitches),booltype),
|
cordconstnode.create(ord(cs_check_overflow in aktlocalswitches),booltype,true),
|
||||||
ccallparanode.create(right,ccallparanode.create(left,nil)));
|
ccallparanode.create(right,ccallparanode.create(left,nil)));
|
||||||
left := nil;
|
left := nil;
|
||||||
if torddef(resulttype.def).typ = s64bit then
|
if torddef(resulttype.def).typ = s64bit then
|
||||||
@ -1812,7 +1814,11 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.63 2002-09-04 19:32:56 jonas
|
Revision 1.64 2002-09-07 12:16:05 carl
|
||||||
|
* second part bug report 1996 fix, testrange in cordconstnode
|
||||||
|
only called if option is set (also make parsing a tiny faster)
|
||||||
|
|
||||||
|
Revision 1.63 2002/09/04 19:32:56 jonas
|
||||||
* changed some ctypeconvnode/toggleflag(nf_explizit) combo's to
|
* changed some ctypeconvnode/toggleflag(nf_explizit) combo's to
|
||||||
ctypeconvnode.create_explicit() statements
|
ctypeconvnode.create_explicit() statements
|
||||||
|
|
||||||
|
@ -642,7 +642,7 @@ implementation
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
hightree:=caddnode.create(subn,geninlinenode(in_length_x,false,left.getcopy),
|
hightree:=caddnode.create(subn,geninlinenode(in_length_x,false,left.getcopy),
|
||||||
cordconstnode.create(1,s32bittype));
|
cordconstnode.create(1,s32bittype,false));
|
||||||
loadconst:=false;
|
loadconst:=false;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -651,7 +651,7 @@ implementation
|
|||||||
len:=0;
|
len:=0;
|
||||||
end;
|
end;
|
||||||
if loadconst then
|
if loadconst then
|
||||||
hightree:=cordconstnode.create(len,s32bittype)
|
hightree:=cordconstnode.create(len,s32bittype,true)
|
||||||
else
|
else
|
||||||
hightree:=ctypeconvnode.create(hightree,s32bittype);
|
hightree:=ctypeconvnode.create(hightree,s32bittype);
|
||||||
firstpass(hightree);
|
firstpass(hightree);
|
||||||
@ -2595,7 +2595,11 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.96 2002-09-05 14:53:41 peter
|
Revision 1.97 2002-09-07 12:16:05 carl
|
||||||
|
* second part bug report 1996 fix, testrange in cordconstnode
|
||||||
|
only called if option is set (also make parsing a tiny faster)
|
||||||
|
|
||||||
|
Revision 1.96 2002/09/05 14:53:41 peter
|
||||||
* fixed old callnode.det_resulttype code
|
* fixed old callnode.det_resulttype code
|
||||||
* old ncal code is default again
|
* old ncal code is default again
|
||||||
|
|
||||||
|
@ -593,7 +593,7 @@ implementation
|
|||||||
result := ccallnode.createinternres(
|
result := ccallnode.createinternres(
|
||||||
'fpc_'+tstringdef(left.resulttype.def).stringtypname+
|
'fpc_'+tstringdef(left.resulttype.def).stringtypname+
|
||||||
'_to_chararray',ccallparanode.create(left,ccallparanode.create(
|
'_to_chararray',ccallparanode.create(left,ccallparanode.create(
|
||||||
cordconstnode.create(arrsize,s32bittype),nil)),resulttype);
|
cordconstnode.create(arrsize,s32bittype,true),nil)),resulttype);
|
||||||
left := nil;
|
left := nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -702,11 +702,11 @@ implementation
|
|||||||
left.toggleflag(nf_explizit);
|
left.toggleflag(nf_explizit);
|
||||||
if (target_info.endian = endian_little) then
|
if (target_info.endian = endian_little) then
|
||||||
left := caddnode.create(orn,
|
left := caddnode.create(orn,
|
||||||
cshlshrnode.create(shln,left,cordconstnode.create(8,s32bittype)),
|
cshlshrnode.create(shln,left,cordconstnode.create(8,s32bittype,false)),
|
||||||
cordconstnode.create(1,s32bittype))
|
cordconstnode.create(1,s32bittype,false))
|
||||||
else
|
else
|
||||||
left := caddnode.create(orn,left,
|
left := caddnode.create(orn,left,
|
||||||
cordconstnode.create(1 shl 8,s32bittype));
|
cordconstnode.create(1 shl 8,s32bittype,false));
|
||||||
left := ctypeconvnode.create(left,u16bittype);
|
left := ctypeconvnode.create(left,u16bittype);
|
||||||
left.toggleflag(nf_explizit);
|
left.toggleflag(nf_explizit);
|
||||||
resulttypepass(left);
|
resulttypepass(left);
|
||||||
@ -743,14 +743,16 @@ implementation
|
|||||||
(torddef(left.resulttype.def).typ=uwidechar) then
|
(torddef(left.resulttype.def).typ=uwidechar) then
|
||||||
begin
|
begin
|
||||||
hp:=cordconstnode.create(
|
hp:=cordconstnode.create(
|
||||||
ord(unicode2asciichar(tcompilerwidechar(tordconstnode(left).value))),cchartype);
|
ord(unicode2asciichar(tcompilerwidechar(tordconstnode(left).value))),
|
||||||
|
cchartype,true);
|
||||||
result:=hp;
|
result:=hp;
|
||||||
end
|
end
|
||||||
else if (torddef(resulttype.def).typ=uwidechar) and
|
else if (torddef(resulttype.def).typ=uwidechar) and
|
||||||
(torddef(left.resulttype.def).typ=uchar) then
|
(torddef(left.resulttype.def).typ=uchar) then
|
||||||
begin
|
begin
|
||||||
hp:=cordconstnode.create(
|
hp:=cordconstnode.create(
|
||||||
asciichar2unicode(chr(tordconstnode(left).value)),cwidechartype);
|
asciichar2unicode(chr(tordconstnode(left).value)),
|
||||||
|
cwidechartype,true);
|
||||||
result:=hp;
|
result:=hp;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -1065,7 +1067,8 @@ implementation
|
|||||||
begin
|
begin
|
||||||
if left.nodetype=ordconstn then
|
if left.nodetype=ordconstn then
|
||||||
begin
|
begin
|
||||||
hp:=cordconstnode.create(tordconstnode(left).value,resulttype);
|
hp:=cordconstnode.create(tordconstnode(left).value,
|
||||||
|
resulttype,true);
|
||||||
result:=hp;
|
result:=hp;
|
||||||
exit;
|
exit;
|
||||||
end
|
end
|
||||||
@ -1083,7 +1086,8 @@ implementation
|
|||||||
begin
|
begin
|
||||||
if left.nodetype=ordconstn then
|
if left.nodetype=ordconstn then
|
||||||
begin
|
begin
|
||||||
hp:=cordconstnode.create(tordconstnode(left).value,resulttype);
|
hp:=cordconstnode.create(tordconstnode(left).value,
|
||||||
|
resulttype,true);
|
||||||
result:=hp;
|
result:=hp;
|
||||||
exit;
|
exit;
|
||||||
end
|
end
|
||||||
@ -1097,7 +1101,7 @@ implementation
|
|||||||
{ nil to ordinal node }
|
{ nil to ordinal node }
|
||||||
else if (left.nodetype=niln) and is_ordinal(resulttype.def) then
|
else if (left.nodetype=niln) and is_ordinal(resulttype.def) then
|
||||||
begin
|
begin
|
||||||
hp:=cordconstnode.create(0,resulttype);
|
hp:=cordconstnode.create(0,resulttype,true);
|
||||||
result:=hp;
|
result:=hp;
|
||||||
exit;
|
exit;
|
||||||
end
|
end
|
||||||
@ -1106,7 +1110,8 @@ implementation
|
|||||||
else if is_ordinal(resulttype.def) and
|
else if is_ordinal(resulttype.def) and
|
||||||
(left.nodetype=pointerconstn) then
|
(left.nodetype=pointerconstn) then
|
||||||
begin
|
begin
|
||||||
hp:=cordconstnode.create(tpointerconstnode(left).value,resulttype);
|
hp:=cordconstnode.create(tpointerconstnode(left).value,
|
||||||
|
resulttype,true);
|
||||||
result:=hp;
|
result:=hp;
|
||||||
exit;
|
exit;
|
||||||
end
|
end
|
||||||
@ -1143,7 +1148,8 @@ implementation
|
|||||||
begin
|
begin
|
||||||
if left.nodetype=ordconstn then
|
if left.nodetype=ordconstn then
|
||||||
begin
|
begin
|
||||||
hp:=cordconstnode.create(tordconstnode(left).value,resulttype);
|
hp:=cordconstnode.create(tordconstnode(left).value,
|
||||||
|
resulttype,true);
|
||||||
result:=hp;
|
result:=hp;
|
||||||
exit;
|
exit;
|
||||||
end
|
end
|
||||||
@ -1161,7 +1167,8 @@ implementation
|
|||||||
begin
|
begin
|
||||||
if left.nodetype=ordconstn then
|
if left.nodetype=ordconstn then
|
||||||
begin
|
begin
|
||||||
hp:=cordconstnode.create(tordconstnode(left).value,resulttype);
|
hp:=cordconstnode.create(tordconstnode(left).value,
|
||||||
|
resulttype,true);
|
||||||
result:=hp;
|
result:=hp;
|
||||||
exit;
|
exit;
|
||||||
end
|
end
|
||||||
@ -1179,7 +1186,8 @@ implementation
|
|||||||
begin
|
begin
|
||||||
if left.nodetype=ordconstn then
|
if left.nodetype=ordconstn then
|
||||||
begin
|
begin
|
||||||
hp:=cordconstnode.create(tordconstnode(left).value,resulttype);
|
hp:=cordconstnode.create(tordconstnode(left).value,
|
||||||
|
resulttype,true);
|
||||||
result:=hp;
|
result:=hp;
|
||||||
exit;
|
exit;
|
||||||
end
|
end
|
||||||
@ -1196,7 +1204,8 @@ implementation
|
|||||||
begin
|
begin
|
||||||
if left.nodetype=ordconstn then
|
if left.nodetype=ordconstn then
|
||||||
begin
|
begin
|
||||||
hp:=cordconstnode.create(tordconstnode(left).value,resulttype);
|
hp:=cordconstnode.create(tordconstnode(left).value,
|
||||||
|
resulttype,true);
|
||||||
result:=hp;
|
result:=hp;
|
||||||
exit;
|
exit;
|
||||||
end
|
end
|
||||||
@ -1215,7 +1224,8 @@ implementation
|
|||||||
begin
|
begin
|
||||||
if left.nodetype=pointerconstn then
|
if left.nodetype=pointerconstn then
|
||||||
begin
|
begin
|
||||||
hp:=cordconstnode.create(tpointerconstnode(left).value,resulttype);
|
hp:=cordconstnode.create(tpointerconstnode(left).value,
|
||||||
|
resulttype,true);
|
||||||
result:=hp;
|
result:=hp;
|
||||||
exit;
|
exit;
|
||||||
end
|
end
|
||||||
@ -2027,7 +2037,11 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.77 2002-09-05 05:56:07 jonas
|
Revision 1.78 2002-09-07 12:16:04 carl
|
||||||
|
* second part bug report 1996 fix, testrange in cordconstnode
|
||||||
|
only called if option is set (also make parsing a tiny faster)
|
||||||
|
|
||||||
|
Revision 1.77 2002/09/05 05:56:07 jonas
|
||||||
- reverted my last commit, it was completely bogus :(
|
- reverted my last commit, it was completely bogus :(
|
||||||
|
|
||||||
Revision 1.75 2002/09/02 19:24:42 peter
|
Revision 1.75 2002/09/02 19:24:42 peter
|
||||||
|
@ -51,7 +51,12 @@ interface
|
|||||||
tordconstnode = class(tnode)
|
tordconstnode = class(tnode)
|
||||||
restype : ttype;
|
restype : ttype;
|
||||||
value : TConstExprInt;
|
value : TConstExprInt;
|
||||||
constructor create(v : tconstexprint;const t:ttype);virtual;
|
rangecheck : boolean;
|
||||||
|
{ create an ordinal constant node of the specified type and value.
|
||||||
|
_rangecheck determines if the value of the ordinal should be checked
|
||||||
|
against the ranges of the type definition.
|
||||||
|
}
|
||||||
|
constructor create(v : tconstexprint;const t:ttype; _rangecheck : boolean);virtual;
|
||||||
constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
|
constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
|
||||||
procedure ppuwrite(ppufile:tcompilerppufile);override;
|
procedure ppuwrite(ppufile:tcompilerppufile);override;
|
||||||
procedure derefimpl;override;
|
procedure derefimpl;override;
|
||||||
@ -180,11 +185,11 @@ implementation
|
|||||||
{ maxcardinal }
|
{ maxcardinal }
|
||||||
i2 := i+i+1;
|
i2 := i+i+1;
|
||||||
if (v<=i) and (v>=-i-1) then
|
if (v<=i) and (v>=-i-1) then
|
||||||
genintconstnode:=cordconstnode.create(v,s32bittype)
|
genintconstnode:=cordconstnode.create(v,s32bittype,true)
|
||||||
else if (v > i) and (v <= i2) then
|
else if (v > i) and (v <= i2) then
|
||||||
genintconstnode:=cordconstnode.create(v,u32bittype)
|
genintconstnode:=cordconstnode.create(v,u32bittype,true)
|
||||||
else
|
else
|
||||||
genintconstnode:=cordconstnode.create(v,cs64bittype);
|
genintconstnode:=cordconstnode.create(v,cs64bittype,true);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -193,7 +198,7 @@ implementation
|
|||||||
htype : ttype;
|
htype : ttype;
|
||||||
begin
|
begin
|
||||||
htype.setdef(v.definition);
|
htype.setdef(v.definition);
|
||||||
genenumnode:=cordconstnode.create(v.value,htype);
|
genenumnode:=cordconstnode.create(v.value,htype,true);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -312,15 +317,15 @@ implementation
|
|||||||
p1:=cstringconstnode.createpchar(pc,len);
|
p1:=cstringconstnode.createpchar(pc,len);
|
||||||
end;
|
end;
|
||||||
constchar :
|
constchar :
|
||||||
p1:=cordconstnode.create(p.valueord,cchartype);
|
p1:=cordconstnode.create(p.valueord,cchartype,true);
|
||||||
constreal :
|
constreal :
|
||||||
p1:=crealconstnode.create(pbestreal(p.valueptr)^,pbestrealtype^);
|
p1:=crealconstnode.create(pbestreal(p.valueptr)^,pbestrealtype^);
|
||||||
constbool :
|
constbool :
|
||||||
p1:=cordconstnode.create(p.valueord,booltype);
|
p1:=cordconstnode.create(p.valueord,booltype,true);
|
||||||
constset :
|
constset :
|
||||||
p1:=csetconstnode.create(pconstset(p.valueptr),p.consttype);
|
p1:=csetconstnode.create(pconstset(p.valueptr),p.consttype);
|
||||||
constord :
|
constord :
|
||||||
p1:=cordconstnode.create(p.valueord,p.consttype);
|
p1:=cordconstnode.create(p.valueord,p.consttype,true);
|
||||||
constpointer :
|
constpointer :
|
||||||
p1:=cpointerconstnode.create(p.valueordptr,p.consttype);
|
p1:=cpointerconstnode.create(p.valueordptr,p.consttype);
|
||||||
constnil :
|
constnil :
|
||||||
@ -410,12 +415,13 @@ implementation
|
|||||||
TORDCONSTNODE
|
TORDCONSTNODE
|
||||||
*****************************************************************************}
|
*****************************************************************************}
|
||||||
|
|
||||||
constructor tordconstnode.create(v : tconstexprint;const t:ttype);
|
constructor tordconstnode.create(v : tconstexprint;const t:ttype;_rangecheck : boolean);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
inherited create(ordconstn);
|
inherited create(ordconstn);
|
||||||
value:=v;
|
value:=v;
|
||||||
restype:=t;
|
restype:=t;
|
||||||
|
rangecheck := _rangecheck;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -424,6 +430,10 @@ implementation
|
|||||||
inherited ppuload(t,ppufile);
|
inherited ppuload(t,ppufile);
|
||||||
ppufile.gettype(restype);
|
ppufile.gettype(restype);
|
||||||
value:=ppufile.getexprint;
|
value:=ppufile.getexprint;
|
||||||
|
{ normally, the value is already compiled, so we don't need
|
||||||
|
to do once again a range check
|
||||||
|
}
|
||||||
|
rangecheck := false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -458,6 +468,8 @@ implementation
|
|||||||
begin
|
begin
|
||||||
result:=nil;
|
result:=nil;
|
||||||
resulttype:=restype;
|
resulttype:=restype;
|
||||||
|
{ only do range checking when explicitly asked for it }
|
||||||
|
if rangecheck then
|
||||||
testrange(resulttype.def,value,false);
|
testrange(resulttype.def,value,false);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -912,7 +924,11 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.40 2002-08-22 11:21:44 florian
|
Revision 1.41 2002-09-07 12:16:04 carl
|
||||||
|
* second part bug report 1996 fix, testrange in cordconstnode
|
||||||
|
only called if option is set (also make parsing a tiny faster)
|
||||||
|
|
||||||
|
Revision 1.40 2002/08/22 11:21:44 florian
|
||||||
+ register32 is now written by tnode.dowrite
|
+ register32 is now written by tnode.dowrite
|
||||||
* fixed write of value of tconstnode
|
* fixed write of value of tconstnode
|
||||||
|
|
||||||
|
@ -497,7 +497,7 @@ implementation
|
|||||||
end;
|
end;
|
||||||
if not is_constboolnode(condition) then
|
if not is_constboolnode(condition) then
|
||||||
aktstate.store_fact(condition,
|
aktstate.store_fact(condition,
|
||||||
cordconstnode.create(byte(checknegate),booltype))
|
cordconstnode.create(byte(checknegate),booltype,true))
|
||||||
else
|
else
|
||||||
condition.destroy;
|
condition.destroy;
|
||||||
end;
|
end;
|
||||||
@ -1405,7 +1405,11 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.50 2002-09-01 18:47:00 peter
|
Revision 1.51 2002-09-07 12:16:04 carl
|
||||||
|
* second part bug report 1996 fix, testrange in cordconstnode
|
||||||
|
only called if option is set (also make parsing a tiny faster)
|
||||||
|
|
||||||
|
Revision 1.50 2002/09/01 18:47:00 peter
|
||||||
* assignn check in exitnode changed to use a separate boolean as the
|
* assignn check in exitnode changed to use a separate boolean as the
|
||||||
assignn can be changed to a calln
|
assignn can be changed to a calln
|
||||||
|
|
||||||
|
@ -207,23 +207,26 @@ implementation
|
|||||||
begin
|
begin
|
||||||
{ insert realtype parameter }
|
{ insert realtype parameter }
|
||||||
newparas.right := ccallparanode.create(cordconstnode.create(
|
newparas.right := ccallparanode.create(cordconstnode.create(
|
||||||
ord(tfloatdef(source.left.resulttype.def).typ),s32bittype),newparas.right);
|
ord(tfloatdef(source.left.resulttype.def).typ),s32bittype,true),
|
||||||
|
newparas.right);
|
||||||
{ if necessary, insert a fraction parameter }
|
{ if necessary, insert a fraction parameter }
|
||||||
if not assigned(fracpara) then
|
if not assigned(fracpara) then
|
||||||
begin
|
begin
|
||||||
tcallparanode(newparas.right).right := ccallparanode.create(
|
tcallparanode(newparas.right).right := ccallparanode.create(
|
||||||
cordconstnode.create(-1,s32bittype),tcallparanode(newparas.right).right);
|
cordconstnode.create(-1,s32bittype,false),
|
||||||
|
tcallparanode(newparas.right).right);
|
||||||
fracpara := tcallparanode(tcallparanode(newparas.right).right);
|
fracpara := tcallparanode(tcallparanode(newparas.right).right);
|
||||||
end;
|
end;
|
||||||
{ if necessary, insert a length para }
|
{ if necessary, insert a length para }
|
||||||
if not assigned(lenpara) then
|
if not assigned(lenpara) then
|
||||||
fracpara.right := ccallparanode.create(cordconstnode.create(-32767,s32bittype),
|
fracpara.right := ccallparanode.create(
|
||||||
|
cordconstnode.create(-32767,s32bittype,false),
|
||||||
fracpara.right);
|
fracpara.right);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
{ for a normal parameter, insert a only length parameter if one is missing }
|
{ for a normal parameter, insert a only length parameter if one is missing }
|
||||||
if not assigned(lenpara) then
|
if not assigned(lenpara) then
|
||||||
newparas.right := ccallparanode.create(cordconstnode.create(-1,s32bittype),
|
newparas.right := ccallparanode.create(cordconstnode.create(-1,s32bittype,false),
|
||||||
newparas.right);
|
newparas.right);
|
||||||
|
|
||||||
{ remove the parameters from the original node so they won't get disposed, }
|
{ remove the parameters from the original node so they won't get disposed, }
|
||||||
@ -270,7 +273,7 @@ implementation
|
|||||||
{ parameter is gets lifted out of its original tcallparanode (see round }
|
{ parameter is gets lifted out of its original tcallparanode (see round }
|
||||||
{ line 1306 of ncal.pas), so recreate a tcallparanode here (JM) }
|
{ line 1306 of ncal.pas), so recreate a tcallparanode here (JM) }
|
||||||
left := ccallparanode.create(cordconstnode.create(
|
left := ccallparanode.create(cordconstnode.create(
|
||||||
tfiledef(left.resulttype.def).typedfiletype.def.size,s32bittype),
|
tfiledef(left.resulttype.def).typedfiletype.def.size,s32bittype,true),
|
||||||
ccallparanode.create(left,nil));
|
ccallparanode.create(left,nil));
|
||||||
{ create the correct call }
|
{ create the correct call }
|
||||||
if inlinenumber=in_reset_typedfile then
|
if inlinenumber=in_reset_typedfile then
|
||||||
@ -449,7 +452,7 @@ implementation
|
|||||||
begin
|
begin
|
||||||
{ add the typesize to the filepara }
|
{ add the typesize to the filepara }
|
||||||
filepara.right := ccallparanode.create(cordconstnode.create(
|
filepara.right := ccallparanode.create(cordconstnode.create(
|
||||||
tfiledef(filepara.resulttype.def).typedfiletype.def.size,s32bittype),nil);
|
tfiledef(filepara.resulttype.def).typedfiletype.def.size,s32bittype,true),nil);
|
||||||
|
|
||||||
{ check for "no parameters" (you need at least one extra para for typed files) }
|
{ check for "no parameters" (you need at least one extra para for typed files) }
|
||||||
if not assigned(para) then
|
if not assigned(para) then
|
||||||
@ -690,7 +693,8 @@ implementation
|
|||||||
if not is_real then
|
if not is_real then
|
||||||
begin
|
begin
|
||||||
if not assigned(lenpara) then
|
if not assigned(lenpara) then
|
||||||
lenpara := ccallparanode.create(cordconstnode.create(0,s32bittype),nil)
|
lenpara := ccallparanode.create(
|
||||||
|
cordconstnode.create(0,s32bittype,false),nil)
|
||||||
else
|
else
|
||||||
{ make sure we don't pass the successive }
|
{ make sure we don't pass the successive }
|
||||||
{ parameters too. We also already have a }
|
{ parameters too. We also already have a }
|
||||||
@ -702,18 +706,18 @@ implementation
|
|||||||
begin
|
begin
|
||||||
if not assigned(lenpara) then
|
if not assigned(lenpara) then
|
||||||
lenpara := ccallparanode.create(
|
lenpara := ccallparanode.create(
|
||||||
cordconstnode.create(-32767,s32bittype),nil);
|
cordconstnode.create(-32767,s32bittype,false),nil);
|
||||||
{ also create a default fracpara if necessary }
|
{ also create a default fracpara if necessary }
|
||||||
if not assigned(fracpara) then
|
if not assigned(fracpara) then
|
||||||
fracpara := ccallparanode.create(
|
fracpara := ccallparanode.create(
|
||||||
cordconstnode.create(-1,s32bittype),nil);
|
cordconstnode.create(-1,s32bittype,false),nil);
|
||||||
{ add it to the lenpara }
|
{ add it to the lenpara }
|
||||||
lenpara.right := fracpara;
|
lenpara.right := fracpara;
|
||||||
{ and add the realtype para (this also removes the link }
|
{ and add the realtype para (this also removes the link }
|
||||||
{ to any parameters coming after it) }
|
{ to any parameters coming after it) }
|
||||||
fracpara.right := ccallparanode.create(
|
fracpara.right := ccallparanode.create(
|
||||||
cordconstnode.create(ord(tfloatdef(para.left.resulttype.def).typ),
|
cordconstnode.create(ord(tfloatdef(para.left.resulttype.def).typ),
|
||||||
s32bittype),nil);
|
s32bittype,true),nil);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -955,7 +959,7 @@ implementation
|
|||||||
suffix := 'sint_';
|
suffix := 'sint_';
|
||||||
{ we also need a destsize para in this case }
|
{ we also need a destsize para in this case }
|
||||||
sizepara := ccallparanode.create(cordconstnode.create
|
sizepara := ccallparanode.create(cordconstnode.create
|
||||||
(destpara.resulttype.def.size,s32bittype),nil);
|
(destpara.resulttype.def.size,s32bittype,true),nil);
|
||||||
end;
|
end;
|
||||||
u8bit,u16bit,u32bit:
|
u8bit,u16bit,u32bit:
|
||||||
suffix := 'uint_';
|
suffix := 'uint_';
|
||||||
@ -1061,7 +1065,7 @@ implementation
|
|||||||
else
|
else
|
||||||
if not is_signed(t.def) then
|
if not is_signed(t.def) then
|
||||||
v := cardinal(v);
|
v := cardinal(v);
|
||||||
hp:=cordconstnode.create(v,t);
|
hp:=cordconstnode.create(v,t,true);
|
||||||
resulttypepass(hp);
|
resulttypepass(hp);
|
||||||
{ fix high(qword) }
|
{ fix high(qword) }
|
||||||
if not is_signed(t.def) and
|
if not is_signed(t.def) and
|
||||||
@ -1169,13 +1173,13 @@ implementation
|
|||||||
if (vr>=2147483648.0) or (vr<=-2147483649.0) then
|
if (vr>=2147483648.0) or (vr<=-2147483649.0) then
|
||||||
begin
|
begin
|
||||||
CGMessage(parser_e_range_check_error);
|
CGMessage(parser_e_range_check_error);
|
||||||
hp:=cordconstnode.create(1,s32bittype)
|
hp:=cordconstnode.create(1,s32bittype,false)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
hp:=cordconstnode.create(trunc(vr),s32bittype)
|
hp:=cordconstnode.create(trunc(vr),s32bittype,true)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
hp:=cordconstnode.create(trunc(vl),s32bittype);
|
hp:=cordconstnode.create(trunc(vl),s32bittype,true);
|
||||||
end;
|
end;
|
||||||
in_const_round :
|
in_const_round :
|
||||||
begin
|
begin
|
||||||
@ -1184,13 +1188,13 @@ implementation
|
|||||||
if (vr>=2147483647.5) or (vr<=-2147483648.5) then
|
if (vr>=2147483647.5) or (vr<=-2147483648.5) then
|
||||||
begin
|
begin
|
||||||
CGMessage(parser_e_range_check_error);
|
CGMessage(parser_e_range_check_error);
|
||||||
hp:=cordconstnode.create(1,s32bittype)
|
hp:=cordconstnode.create(1,s32bittype,false)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
hp:=cordconstnode.create(round(vr),s32bittype)
|
hp:=cordconstnode.create(round(vr),s32bittype,true)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
hp:=cordconstnode.create(round(vl),s32bittype);
|
hp:=cordconstnode.create(round(vl),s32bittype,true);
|
||||||
end;
|
end;
|
||||||
in_const_frac :
|
in_const_frac :
|
||||||
begin
|
begin
|
||||||
@ -1211,35 +1215,35 @@ implementation
|
|||||||
if isreal then
|
if isreal then
|
||||||
hp:=crealconstnode.create(abs(vr),pbestrealtype^)
|
hp:=crealconstnode.create(abs(vr),pbestrealtype^)
|
||||||
else
|
else
|
||||||
hp:=cordconstnode.create(abs(vl),left.resulttype);
|
hp:=cordconstnode.create(abs(vl),left.resulttype,true);
|
||||||
end;
|
end;
|
||||||
in_const_sqr :
|
in_const_sqr :
|
||||||
begin
|
begin
|
||||||
if isreal then
|
if isreal then
|
||||||
hp:=crealconstnode.create(sqr(vr),pbestrealtype^)
|
hp:=crealconstnode.create(sqr(vr),pbestrealtype^)
|
||||||
else
|
else
|
||||||
hp:=cordconstnode.create(sqr(vl),left.resulttype);
|
hp:=cordconstnode.create(sqr(vl),left.resulttype,true);
|
||||||
end;
|
end;
|
||||||
in_const_odd :
|
in_const_odd :
|
||||||
begin
|
begin
|
||||||
if isreal then
|
if isreal then
|
||||||
CGMessage1(type_e_integer_expr_expected,left.resulttype.def.typename)
|
CGMessage1(type_e_integer_expr_expected,left.resulttype.def.typename)
|
||||||
else
|
else
|
||||||
hp:=cordconstnode.create(byte(odd(vl)),booltype);
|
hp:=cordconstnode.create(byte(odd(vl)),booltype,true);
|
||||||
end;
|
end;
|
||||||
in_const_swap_word :
|
in_const_swap_word :
|
||||||
begin
|
begin
|
||||||
if isreal then
|
if isreal then
|
||||||
CGMessage1(type_e_integer_expr_expected,left.resulttype.def.typename)
|
CGMessage1(type_e_integer_expr_expected,left.resulttype.def.typename)
|
||||||
else
|
else
|
||||||
hp:=cordconstnode.create((vl and $ff) shl 8+(vl shr 8),left.resulttype);
|
hp:=cordconstnode.create((vl and $ff) shl 8+(vl shr 8),left.resulttype,true);
|
||||||
end;
|
end;
|
||||||
in_const_swap_long :
|
in_const_swap_long :
|
||||||
begin
|
begin
|
||||||
if isreal then
|
if isreal then
|
||||||
CGMessage(type_e_mismatch)
|
CGMessage(type_e_mismatch)
|
||||||
else
|
else
|
||||||
hp:=cordconstnode.create((vl and $ffff) shl 16+(vl shr 16),left.resulttype);
|
hp:=cordconstnode.create((vl and $ffff) shl 16+(vl shr 16),left.resulttype,true);
|
||||||
end;
|
end;
|
||||||
in_const_ptr :
|
in_const_ptr :
|
||||||
begin
|
begin
|
||||||
@ -1339,17 +1343,17 @@ implementation
|
|||||||
begin
|
begin
|
||||||
case inlinenumber of
|
case inlinenumber of
|
||||||
in_lo_word :
|
in_lo_word :
|
||||||
hp:=cordconstnode.create(tordconstnode(left).value and $ff,left.resulttype);
|
hp:=cordconstnode.create(tordconstnode(left).value and $ff,left.resulttype,true);
|
||||||
in_hi_word :
|
in_hi_word :
|
||||||
hp:=cordconstnode.create(tordconstnode(left).value shr 8,left.resulttype);
|
hp:=cordconstnode.create(tordconstnode(left).value shr 8,left.resulttype,true);
|
||||||
in_lo_long :
|
in_lo_long :
|
||||||
hp:=cordconstnode.create(tordconstnode(left).value and $ffff,left.resulttype);
|
hp:=cordconstnode.create(tordconstnode(left).value and $ffff,left.resulttype,true);
|
||||||
in_hi_long :
|
in_hi_long :
|
||||||
hp:=cordconstnode.create(tordconstnode(left).value shr 16,left.resulttype);
|
hp:=cordconstnode.create(tordconstnode(left).value shr 16,left.resulttype,true);
|
||||||
in_lo_qword :
|
in_lo_qword :
|
||||||
hp:=cordconstnode.create(tordconstnode(left).value and $ffffffff,left.resulttype);
|
hp:=cordconstnode.create(tordconstnode(left).value and $ffffffff,left.resulttype,true);
|
||||||
in_hi_qword :
|
in_hi_qword :
|
||||||
hp:=cordconstnode.create(tordconstnode(left).value shr 32,left.resulttype);
|
hp:=cordconstnode.create(tordconstnode(left).value shr 32,left.resulttype,true);
|
||||||
end;
|
end;
|
||||||
result:=hp;
|
result:=hp;
|
||||||
goto myexit;
|
goto myexit;
|
||||||
@ -1387,7 +1391,8 @@ implementation
|
|||||||
begin
|
begin
|
||||||
if (left.nodetype=ordconstn) then
|
if (left.nodetype=ordconstn) then
|
||||||
begin
|
begin
|
||||||
hp:=cordconstnode.create(tordconstnode(left).value,s32bittype);
|
hp:=cordconstnode.create(
|
||||||
|
tordconstnode(left).value,s32bittype,true);
|
||||||
result:=hp;
|
result:=hp;
|
||||||
goto myexit;
|
goto myexit;
|
||||||
end;
|
end;
|
||||||
@ -1475,7 +1480,8 @@ implementation
|
|||||||
{ evaluates length of constant strings direct }
|
{ evaluates length of constant strings direct }
|
||||||
if (left.nodetype=stringconstn) then
|
if (left.nodetype=stringconstn) then
|
||||||
begin
|
begin
|
||||||
hp:=cordconstnode.create(tstringconstnode(left).len,s32bittype);
|
hp:=cordconstnode.create(
|
||||||
|
tstringconstnode(left).len,s32bittype,true);
|
||||||
result:=hp;
|
result:=hp;
|
||||||
goto myexit;
|
goto myexit;
|
||||||
end;
|
end;
|
||||||
@ -1486,7 +1492,7 @@ implementation
|
|||||||
if is_char(left.resulttype.def) or
|
if is_char(left.resulttype.def) or
|
||||||
is_widechar(left.resulttype.def) then
|
is_widechar(left.resulttype.def) then
|
||||||
begin
|
begin
|
||||||
hp:=cordconstnode.create(1,s32bittype);
|
hp:=cordconstnode.create(1,s32bittype,false);
|
||||||
result:=hp;
|
result:=hp;
|
||||||
goto myexit;
|
goto myexit;
|
||||||
end
|
end
|
||||||
@ -1500,7 +1506,7 @@ implementation
|
|||||||
begin
|
begin
|
||||||
srsym:=searchsymonlyin(tloadnode(left).symtable,'high'+tvarsym(tloadnode(left).symtableentry).name);
|
srsym:=searchsymonlyin(tloadnode(left).symtable,'high'+tvarsym(tloadnode(left).symtableentry).name);
|
||||||
hp:=caddnode.create(addn,cloadnode.create(srsym,tloadnode(left).symtable),
|
hp:=caddnode.create(addn,cloadnode.create(srsym,tloadnode(left).symtable),
|
||||||
cordconstnode.create(1,s32bittype));
|
cordconstnode.create(1,s32bittype,false));
|
||||||
result:=hp;
|
result:=hp;
|
||||||
goto myexit;
|
goto myexit;
|
||||||
end
|
end
|
||||||
@ -1509,7 +1515,7 @@ implementation
|
|||||||
begin
|
begin
|
||||||
hp:=cordconstnode.create(tarraydef(left.resulttype.def).highrange-
|
hp:=cordconstnode.create(tarraydef(left.resulttype.def).highrange-
|
||||||
tarraydef(left.resulttype.def).lowrange+1,
|
tarraydef(left.resulttype.def).lowrange+1,
|
||||||
s32bittype);
|
s32bittype,true);
|
||||||
result:=hp;
|
result:=hp;
|
||||||
goto myexit;
|
goto myexit;
|
||||||
end
|
end
|
||||||
@ -1571,7 +1577,7 @@ implementation
|
|||||||
in_seg_x :
|
in_seg_x :
|
||||||
begin
|
begin
|
||||||
set_varstate(left,false);
|
set_varstate(left,false);
|
||||||
hp:=cordconstnode.create(0,s32bittype);
|
hp:=cordconstnode.create(0,s32bittype,false);
|
||||||
result:=hp;
|
result:=hp;
|
||||||
goto myexit;
|
goto myexit;
|
||||||
end;
|
end;
|
||||||
@ -1594,9 +1600,9 @@ implementation
|
|||||||
if left.nodetype=ordconstn then
|
if left.nodetype=ordconstn then
|
||||||
begin
|
begin
|
||||||
if inlinenumber=in_succ_x then
|
if inlinenumber=in_succ_x then
|
||||||
hp:=cordconstnode.create(tordconstnode(left).value+1,left.resulttype)
|
hp:=cordconstnode.create(tordconstnode(left).value+1,left.resulttype,false)
|
||||||
else
|
else
|
||||||
hp:=cordconstnode.create(tordconstnode(left).value-1,left.resulttype);
|
hp:=cordconstnode.create(tordconstnode(left).value-1,left.resulttype,false);
|
||||||
result:=hp;
|
result:=hp;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -1669,7 +1675,8 @@ implementation
|
|||||||
resulttype:=voidtype;
|
resulttype:=voidtype;
|
||||||
{ now we know the type of buffer }
|
{ now we know the type of buffer }
|
||||||
srsym:=searchsymonlyin(systemunit,'SETTEXTBUF');
|
srsym:=searchsymonlyin(systemunit,'SETTEXTBUF');
|
||||||
hp:=ccallparanode.create(cordconstnode.create(tcallparanode(left).left.resulttype.def.size,s32bittype),left);
|
hp:=ccallparanode.create(cordconstnode.create(
|
||||||
|
tcallparanode(left).left.resulttype.def.size,s32bittype,true),left);
|
||||||
hp:=ccallnode.create(hp,tprocsym(srsym),systemunit,nil);
|
hp:=ccallnode.create(hp,tprocsym(srsym),systemunit,nil);
|
||||||
left:=nil;
|
left:=nil;
|
||||||
result:=hp;
|
result:=hp;
|
||||||
@ -1731,7 +1738,8 @@ implementation
|
|||||||
begin
|
begin
|
||||||
if inlinenumber=in_low_x then
|
if inlinenumber=in_low_x then
|
||||||
begin
|
begin
|
||||||
result:=cordconstnode.create(tarraydef(left.resulttype.def).lowrange,tarraydef(left.resulttype.def).rangetype);
|
result:=cordconstnode.create(tarraydef(
|
||||||
|
left.resulttype.def).lowrange,tarraydef(left.resulttype.def).rangetype,true);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@ -1756,7 +1764,8 @@ implementation
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
result:=cordconstnode.create(tarraydef(left.resulttype.def).highrange,tarraydef(left.resulttype.def).rangetype);
|
result:=cordconstnode.create(tarraydef(
|
||||||
|
left.resulttype.def).highrange,tarraydef(left.resulttype.def).rangetype,true);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
resulttypepass(result);
|
resulttypepass(result);
|
||||||
@ -1765,7 +1774,7 @@ implementation
|
|||||||
begin
|
begin
|
||||||
if inlinenumber=in_low_x then
|
if inlinenumber=in_low_x then
|
||||||
begin
|
begin
|
||||||
hp:=cordconstnode.create(0,u8bittype);
|
hp:=cordconstnode.create(0,u8bittype,false);
|
||||||
resulttypepass(hp);
|
resulttypepass(hp);
|
||||||
result:=hp;
|
result:=hp;
|
||||||
end
|
end
|
||||||
@ -1780,7 +1789,7 @@ implementation
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
hp:=cordconstnode.create(tstringdef(left.resulttype.def).len,u8bittype);
|
hp:=cordconstnode.create(tstringdef(left.resulttype.def).len,u8bittype,true);
|
||||||
resulttypepass(hp);
|
resulttypepass(hp);
|
||||||
result:=hp;
|
result:=hp;
|
||||||
end;
|
end;
|
||||||
@ -1983,7 +1992,7 @@ implementation
|
|||||||
end;
|
end;
|
||||||
if shiftconst <> 0 then
|
if shiftconst <> 0 then
|
||||||
result := ctypeconvnode.create(cshlshrnode.create(shrn,left,
|
result := ctypeconvnode.create(cshlshrnode.create(shrn,left,
|
||||||
cordconstnode.create(shiftconst,u32bittype)),resulttype)
|
cordconstnode.create(shiftconst,u32bittype,false)),resulttype)
|
||||||
else
|
else
|
||||||
result := ctypeconvnode.create(left,resulttype);
|
result := ctypeconvnode.create(left,resulttype);
|
||||||
left := nil;
|
left := nil;
|
||||||
@ -1996,10 +2005,11 @@ implementation
|
|||||||
begin
|
begin
|
||||||
srsym:=searchsymonlyin(tloadnode(left).symtable,'high'+tvarsym(tloadnode(left).symtableentry).name);
|
srsym:=searchsymonlyin(tloadnode(left).symtable,'high'+tvarsym(tloadnode(left).symtableentry).name);
|
||||||
hp:=caddnode.create(addn,cloadnode.create(srsym,tloadnode(left).symtable),
|
hp:=caddnode.create(addn,cloadnode.create(srsym,tloadnode(left).symtable),
|
||||||
cordconstnode.create(1,s32bittype));
|
cordconstnode.create(1,s32bittype,false));
|
||||||
if (left.resulttype.def.deftype=arraydef) and
|
if (left.resulttype.def.deftype=arraydef) and
|
||||||
(tarraydef(left.resulttype.def).elesize<>1) then
|
(tarraydef(left.resulttype.def).elesize<>1) then
|
||||||
hp:=caddnode.create(muln,hp,cordconstnode.create(tarraydef(left.resulttype.def).elesize,s32bittype));
|
hp:=caddnode.create(muln,hp,cordconstnode.create(tarraydef(
|
||||||
|
left.resulttype.def).elesize,s32bittype,true));
|
||||||
firstpass(hp);
|
firstpass(hp);
|
||||||
result:=hp;
|
result:=hp;
|
||||||
end
|
end
|
||||||
@ -2106,7 +2116,7 @@ implementation
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
{ no, create constant 1 }
|
{ no, create constant 1 }
|
||||||
hpp := cordconstnode.create(1,s32bittype);
|
hpp := cordconstnode.create(1,s32bittype,false);
|
||||||
{ addition/substraction depending on inc/dec }
|
{ addition/substraction depending on inc/dec }
|
||||||
if inlinenumber = in_inc_x then
|
if inlinenumber = in_inc_x then
|
||||||
hp := caddnode.create(addn,tcallparanode(left).left.getcopy,hpp)
|
hp := caddnode.create(addn,tcallparanode(left).left.getcopy,hpp)
|
||||||
@ -2366,7 +2376,11 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.85 2002-09-02 19:24:42 peter
|
Revision 1.86 2002-09-07 12:16:04 carl
|
||||||
|
* second part bug report 1996 fix, testrange in cordconstnode
|
||||||
|
only called if option is set (also make parsing a tiny faster)
|
||||||
|
|
||||||
|
Revision 1.85 2002/09/02 19:24:42 peter
|
||||||
* array of char support for Str()
|
* array of char support for Str()
|
||||||
|
|
||||||
Revision 1.84 2002/08/19 19:36:43 peter
|
Revision 1.84 2002/08/19 19:36:43 peter
|
||||||
|
@ -257,9 +257,9 @@ implementation
|
|||||||
left := caddnode.create(addn,left,
|
left := caddnode.create(addn,left,
|
||||||
caddnode.create(andn,
|
caddnode.create(andn,
|
||||||
cshlshrnode.create(sarn,left.getcopy,
|
cshlshrnode.create(sarn,left.getcopy,
|
||||||
cordconstnode.create(shiftval,s32bittype)),
|
cordconstnode.create(shiftval,s32bittype,false)),
|
||||||
cordconstnode.create(tordconstnode(right).value-1,
|
cordconstnode.create(tordconstnode(right).value-1,
|
||||||
right.resulttype)));
|
right.resulttype,false)));
|
||||||
newtype := sarn;
|
newtype := sarn;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -630,7 +630,7 @@ implementation
|
|||||||
else
|
else
|
||||||
CGMessage(type_e_mismatch);
|
CGMessage(type_e_mismatch);
|
||||||
end;
|
end;
|
||||||
t:=cordconstnode.create(v,left.resulttype);
|
t:=cordconstnode.create(v,left.resulttype,true);
|
||||||
result:=t;
|
result:=t;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
@ -747,7 +747,11 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.41 2002-09-03 16:26:26 daniel
|
Revision 1.42 2002-09-07 12:16:04 carl
|
||||||
|
* second part bug report 1996 fix, testrange in cordconstnode
|
||||||
|
only called if option is set (also make parsing a tiny faster)
|
||||||
|
|
||||||
|
Revision 1.41 2002/09/03 16:26:26 daniel
|
||||||
* Make Tprocdef.defs protected
|
* Make Tprocdef.defs protected
|
||||||
|
|
||||||
Revision 1.40 2002/08/25 11:32:33 peter
|
Revision 1.40 2002/08/25 11:32:33 peter
|
||||||
|
@ -272,7 +272,7 @@ implementation
|
|||||||
(tsetconstnode(right).value_set^ = [])) then
|
(tsetconstnode(right).value_set^ = [])) then
|
||||||
{$endif oldset}
|
{$endif oldset}
|
||||||
begin
|
begin
|
||||||
t:=cordconstnode.create(0,booltype);
|
t:=cordconstnode.create(0,booltype,false);
|
||||||
resulttypepass(t);
|
resulttypepass(t);
|
||||||
result:=t;
|
result:=t;
|
||||||
exit;
|
exit;
|
||||||
@ -282,9 +282,11 @@ implementation
|
|||||||
if (left.nodetype=ordconstn) and (right.nodetype=setconstn) then
|
if (left.nodetype=ordconstn) and (right.nodetype=setconstn) then
|
||||||
begin
|
begin
|
||||||
{$ifdef oldset}
|
{$ifdef oldset}
|
||||||
t:=cordconstnode.create(byte(tordconstnode(left).value in byteset(tsetconstnode(right).value_set^)),booltype);
|
t:=cordconstnode.create(byte(tordconstnode(left).value in byteset(tsetconstnode(right).value_set^)),
|
||||||
|
booltype,true);
|
||||||
{$else}
|
{$else}
|
||||||
t:=cordconstnode.create(byte(tordconstnode(left).value in Tsetconstnode(right).value_set^),booltype);
|
t:=cordconstnode.create(byte(tordconstnode(left).value in Tsetconstnode(right).value_set^),
|
||||||
|
booltype,true);
|
||||||
{$endif}
|
{$endif}
|
||||||
resulttypepass(t);
|
resulttypepass(t);
|
||||||
result:=t;
|
result:=t;
|
||||||
@ -689,7 +691,11 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.32 2002-08-19 19:36:44 peter
|
Revision 1.33 2002-09-07 12:16:03 carl
|
||||||
|
* second part bug report 1996 fix, testrange in cordconstnode
|
||||||
|
only called if option is set (also make parsing a tiny faster)
|
||||||
|
|
||||||
|
Revision 1.32 2002/08/19 19:36:44 peter
|
||||||
* More fixes for cross unit inlining, all tnodes are now implemented
|
* More fixes for cross unit inlining, all tnodes are now implemented
|
||||||
* Moved pocall_internconst to po_internconst because it is not a
|
* Moved pocall_internconst to po_internconst because it is not a
|
||||||
calling type at all and it conflicted when inlining of these small
|
calling type at all and it conflicted when inlining of these small
|
||||||
|
@ -317,7 +317,7 @@ implementation
|
|||||||
statement_syssym:=geninlinenode(in_sizeof_x,false,p1)
|
statement_syssym:=geninlinenode(in_sizeof_x,false,p1)
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
statement_syssym:=cordconstnode.create(p1.resulttype.def.size,s32bittype);
|
statement_syssym:=cordconstnode.create(p1.resulttype.def.size,s32bittype,true);
|
||||||
{ p1 not needed !}
|
{ p1 not needed !}
|
||||||
p1.destroy;
|
p1.destroy;
|
||||||
end;
|
end;
|
||||||
@ -741,7 +741,7 @@ implementation
|
|||||||
sl_subscript :
|
sl_subscript :
|
||||||
p1:=csubscriptnode.create(plist^.sym,p1);
|
p1:=csubscriptnode.create(plist^.sym,p1);
|
||||||
sl_vec :
|
sl_vec :
|
||||||
p1:=cvecnode.create(p1,cordconstnode.create(plist^.value,s32bittype));
|
p1:=cvecnode.create(p1,cordconstnode.create(plist^.value,s32bittype,true));
|
||||||
else
|
else
|
||||||
internalerror(200110205);
|
internalerror(200110205);
|
||||||
end;
|
end;
|
||||||
@ -769,7 +769,7 @@ implementation
|
|||||||
{ indexed property }
|
{ indexed property }
|
||||||
if (ppo_indexed in tpropertysym(sym).propoptions) then
|
if (ppo_indexed in tpropertysym(sym).propoptions) then
|
||||||
begin
|
begin
|
||||||
p2:=cordconstnode.create(tpropertysym(sym).index,tpropertysym(sym).indextype);
|
p2:=cordconstnode.create(tpropertysym(sym).index,tpropertysym(sym).indextype,true);
|
||||||
paras:=ccallparanode.create(p2,paras);
|
paras:=ccallparanode.create(p2,paras);
|
||||||
end;
|
end;
|
||||||
{ we need only a write property if a := follows }
|
{ we need only a write property if a := follows }
|
||||||
@ -1179,12 +1179,12 @@ implementation
|
|||||||
{ do a very dirty trick to bootstrap this code }
|
{ do a very dirty trick to bootstrap this code }
|
||||||
if (tconstsym(srsym).valueord>=-(int64(2147483647)+int64(1))) and
|
if (tconstsym(srsym).valueord>=-(int64(2147483647)+int64(1))) and
|
||||||
(tconstsym(srsym).valueord<=2147483647) then
|
(tconstsym(srsym).valueord<=2147483647) then
|
||||||
p1:=cordconstnode.create(tconstsym(srsym).valueord,s32bittype)
|
p1:=cordconstnode.create(tconstsym(srsym).valueord,s32bittype,true)
|
||||||
else if (tconstsym(srsym).valueord > maxlongint) and
|
else if (tconstsym(srsym).valueord > maxlongint) and
|
||||||
(tconstsym(srsym).valueord <= int64(maxlongint)+int64(maxlongint)+1) then
|
(tconstsym(srsym).valueord <= int64(maxlongint)+int64(maxlongint)+1) then
|
||||||
p1:=cordconstnode.create(tconstsym(srsym).valueord,u32bittype)
|
p1:=cordconstnode.create(tconstsym(srsym).valueord,u32bittype,true)
|
||||||
else
|
else
|
||||||
p1:=cordconstnode.create(tconstsym(srsym).valueord,cs64bittype);
|
p1:=cordconstnode.create(tconstsym(srsym).valueord,cs64bittype,true);
|
||||||
end;
|
end;
|
||||||
conststring :
|
conststring :
|
||||||
begin
|
begin
|
||||||
@ -1197,15 +1197,15 @@ implementation
|
|||||||
p1:=cstringconstnode.createpchar(pc,len);
|
p1:=cstringconstnode.createpchar(pc,len);
|
||||||
end;
|
end;
|
||||||
constchar :
|
constchar :
|
||||||
p1:=cordconstnode.create(tconstsym(srsym).valueord,cchartype);
|
p1:=cordconstnode.create(tconstsym(srsym).valueord,cchartype,true);
|
||||||
constreal :
|
constreal :
|
||||||
p1:=crealconstnode.create(pbestreal(tconstsym(srsym).valueptr)^,pbestrealtype^);
|
p1:=crealconstnode.create(pbestreal(tconstsym(srsym).valueptr)^,pbestrealtype^);
|
||||||
constbool :
|
constbool :
|
||||||
p1:=cordconstnode.create(tconstsym(srsym).valueord,booltype);
|
p1:=cordconstnode.create(tconstsym(srsym).valueord,booltype,true);
|
||||||
constset :
|
constset :
|
||||||
p1:=csetconstnode.create(pconstset(tconstsym(srsym).valueptr),tconstsym(srsym).consttype);
|
p1:=csetconstnode.create(pconstset(tconstsym(srsym).valueptr),tconstsym(srsym).consttype);
|
||||||
constord :
|
constord :
|
||||||
p1:=cordconstnode.create(tconstsym(srsym).valueord,tconstsym(srsym).consttype);
|
p1:=cordconstnode.create(tconstsym(srsym).valueord,tconstsym(srsym).consttype,true);
|
||||||
constpointer :
|
constpointer :
|
||||||
p1:=cpointerconstnode.create(tconstsym(srsym).valueordptr,tconstsym(srsym).consttype);
|
p1:=cpointerconstnode.create(tconstsym(srsym).valueordptr,tconstsym(srsym).consttype);
|
||||||
constnil :
|
constnil :
|
||||||
@ -1468,7 +1468,7 @@ implementation
|
|||||||
if (token=_COLON) then
|
if (token=_COLON) then
|
||||||
begin
|
begin
|
||||||
consume(_COLON);
|
consume(_COLON);
|
||||||
p3:=caddnode.create(muln,cordconstnode.create($10,s32bittype),p2);
|
p3:=caddnode.create(muln,cordconstnode.create($10,s32bittype,false),p2);
|
||||||
p2:=comp_expr(true);
|
p2:=comp_expr(true);
|
||||||
p2:=caddnode.create(addn,p2,p3);
|
p2:=caddnode.create(addn,p2,p3);
|
||||||
p1:=cvecnode.create(p1,p2);
|
p1:=cvecnode.create(p1,p2);
|
||||||
@ -1784,7 +1784,7 @@ implementation
|
|||||||
Message(cg_e_invalid_integer);
|
Message(cg_e_invalid_integer);
|
||||||
consume(_INTCONST);
|
consume(_INTCONST);
|
||||||
l:=1;
|
l:=1;
|
||||||
p1:=cordconstnode.create(l,s32bittype);
|
p1:=cordconstnode.create(l,s32bittype,true);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@ -1795,13 +1795,13 @@ implementation
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
consume(_INTCONST);
|
consume(_INTCONST);
|
||||||
p1:=cordconstnode.create(ic,cs64bittype);
|
p1:=cordconstnode.create(ic,cs64bittype,true);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
consume(_INTCONST);
|
consume(_INTCONST);
|
||||||
p1:=cordconstnode.create(l,s32bittype)
|
p1:=cordconstnode.create(l,s32bittype,true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -1811,9 +1811,9 @@ implementation
|
|||||||
{ (longint is easier to perform calculations with) (JM) }
|
{ (longint is easier to perform calculations with) (JM) }
|
||||||
if card <= $7fffffff then
|
if card <= $7fffffff then
|
||||||
{ no sign extension necessary, so not longint typecast (JM) }
|
{ no sign extension necessary, so not longint typecast (JM) }
|
||||||
p1:=cordconstnode.create(card,s32bittype)
|
p1:=cordconstnode.create(card,s32bittype,true)
|
||||||
else
|
else
|
||||||
p1:=cordconstnode.create(card,u32bittype)
|
p1:=cordconstnode.create(card,u32bittype,true)
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1878,7 +1878,7 @@ implementation
|
|||||||
|
|
||||||
_CCHAR :
|
_CCHAR :
|
||||||
begin
|
begin
|
||||||
p1:=cordconstnode.create(ord(pattern[1]),cchartype);
|
p1:=cordconstnode.create(ord(pattern[1]),cchartype,true);
|
||||||
consume(_CCHAR);
|
consume(_CCHAR);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1890,7 +1890,7 @@ implementation
|
|||||||
|
|
||||||
_CWCHAR:
|
_CWCHAR:
|
||||||
begin
|
begin
|
||||||
p1:=cordconstnode.create(ord(getcharwidestring(patternw,0)),cwidechartype);
|
p1:=cordconstnode.create(ord(getcharwidestring(patternw,0)),cwidechartype,true);
|
||||||
consume(_CWCHAR);
|
consume(_CWCHAR);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1967,13 +1967,13 @@ implementation
|
|||||||
_TRUE :
|
_TRUE :
|
||||||
begin
|
begin
|
||||||
consume(_TRUE);
|
consume(_TRUE);
|
||||||
p1:=cordconstnode.create(1,booltype);
|
p1:=cordconstnode.create(1,booltype,false);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
_FALSE :
|
_FALSE :
|
||||||
begin
|
begin
|
||||||
consume(_FALSE);
|
consume(_FALSE);
|
||||||
p1:=cordconstnode.create(0,booltype);
|
p1:=cordconstnode.create(0,booltype,false);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
_NIL :
|
_NIL :
|
||||||
@ -2248,7 +2248,11 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.78 2002-09-03 16:26:27 daniel
|
Revision 1.79 2002-09-07 12:16:03 carl
|
||||||
|
* second part bug report 1996 fix, testrange in cordconstnode
|
||||||
|
only called if option is set (also make parsing a tiny faster)
|
||||||
|
|
||||||
|
Revision 1.78 2002/09/03 16:26:27 daniel
|
||||||
* Make Tprocdef.defs protected
|
* Make Tprocdef.defs protected
|
||||||
|
|
||||||
Revision 1.77 2002/08/18 20:06:24 peter
|
Revision 1.77 2002/08/18 20:06:24 peter
|
||||||
|
@ -221,7 +221,7 @@ implementation
|
|||||||
|
|
||||||
{ create call to fpc_getmem }
|
{ create call to fpc_getmem }
|
||||||
para := ccallparanode.create(cordconstnode.create
|
para := ccallparanode.create(cordconstnode.create
|
||||||
(tpointerdef(p.resulttype.def).pointertype.def.size,s32bittype),nil);
|
(tpointerdef(p.resulttype.def).pointertype.def.size,s32bittype,true),nil);
|
||||||
addstatement(newstatement,cassignmentnode.create(
|
addstatement(newstatement,cassignmentnode.create(
|
||||||
ctemprefnode.create(temp),
|
ctemprefnode.create(temp),
|
||||||
ccallnode.createintern('fpc_getmem',para)));
|
ccallnode.createintern('fpc_getmem',para)));
|
||||||
@ -305,7 +305,7 @@ implementation
|
|||||||
|
|
||||||
{ create call to fpc_getmem }
|
{ create call to fpc_getmem }
|
||||||
para := ccallparanode.create(cordconstnode.create
|
para := ccallparanode.create(cordconstnode.create
|
||||||
(tpointerdef(p1.resulttype.def).pointertype.def.size,s32bittype),nil);
|
(tpointerdef(p1.resulttype.def).pointertype.def.size,s32bittype,true),nil);
|
||||||
addstatement(newstatement,cassignmentnode.create(
|
addstatement(newstatement,cassignmentnode.create(
|
||||||
ctemprefnode.create(temp),
|
ctemprefnode.create(temp),
|
||||||
ccallnode.createintern('fpc_getmem',para)));
|
ccallnode.createintern('fpc_getmem',para)));
|
||||||
@ -480,7 +480,7 @@ implementation
|
|||||||
npara:=ccallparanode.create(caddrnode.create
|
npara:=ccallparanode.create(caddrnode.create
|
||||||
(ctemprefnode.create(temp)),
|
(ctemprefnode.create(temp)),
|
||||||
ccallparanode.create(cordconstnode.create
|
ccallparanode.create(cordconstnode.create
|
||||||
(counter,s32bittype),
|
(counter,s32bittype,true),
|
||||||
ccallparanode.create(caddrnode.create
|
ccallparanode.create(caddrnode.create
|
||||||
(crttinode.create(tstoreddef(destppn.resulttype.def),initrtti)),
|
(crttinode.create(tstoreddef(destppn.resulttype.def),initrtti)),
|
||||||
ccallparanode.create(ctypeconvnode.create_explicit(destppn,voidpointertype),nil))));
|
ccallparanode.create(ctypeconvnode.create_explicit(destppn,voidpointertype),nil))));
|
||||||
@ -536,7 +536,7 @@ implementation
|
|||||||
end;
|
end;
|
||||||
{ create call to fpc_finalize_array }
|
{ create call to fpc_finalize_array }
|
||||||
npara:=ccallparanode.create(cordconstnode.create
|
npara:=ccallparanode.create(cordconstnode.create
|
||||||
(destppn.left.resulttype.def.size,s32bittype),
|
(destppn.left.resulttype.def.size,s32bittype,true),
|
||||||
ccallparanode.create(ctypeconvnode.create
|
ccallparanode.create(ctypeconvnode.create
|
||||||
(ppn.left,s32bittype),
|
(ppn.left,s32bittype),
|
||||||
ccallparanode.create(caddrnode.create
|
ccallparanode.create(caddrnode.create
|
||||||
@ -565,7 +565,11 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.6 2002-07-20 11:57:56 florian
|
Revision 1.7 2002-09-07 12:16:03 carl
|
||||||
|
* second part bug report 1996 fix, testrange in cordconstnode
|
||||||
|
only called if option is set (also make parsing a tiny faster)
|
||||||
|
|
||||||
|
Revision 1.6 2002/07/20 11:57:56 florian
|
||||||
* types.pas renamed to defbase.pas because D6 contains a types
|
* types.pas renamed to defbase.pas because D6 contains a types
|
||||||
unit so this would conflicts if D6 programms are compiled
|
unit so this would conflicts if D6 programms are compiled
|
||||||
+ Willamette/SSE2 instructions to assembler added
|
+ Willamette/SSE2 instructions to assembler added
|
||||||
|
@ -196,7 +196,7 @@ implementation
|
|||||||
CGMessage(type_e_ordinal_expr_expected);
|
CGMessage(type_e_ordinal_expr_expected);
|
||||||
{ create a correct tree }
|
{ create a correct tree }
|
||||||
caseexpr.free;
|
caseexpr.free;
|
||||||
caseexpr:=cordconstnode.create(0,u32bittype);
|
caseexpr:=cordconstnode.create(0,u32bittype,false);
|
||||||
{ set error flag so no rangechecks are done }
|
{ set error flag so no rangechecks are done }
|
||||||
casedeferror:=true;
|
casedeferror:=true;
|
||||||
end;
|
end;
|
||||||
@ -1146,7 +1146,11 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.75 2002-09-02 18:40:52 peter
|
Revision 1.76 2002-09-07 12:16:03 carl
|
||||||
|
* second part bug report 1996 fix, testrange in cordconstnode
|
||||||
|
only called if option is set (also make parsing a tiny faster)
|
||||||
|
|
||||||
|
Revision 1.75 2002/09/02 18:40:52 peter
|
||||||
* fixed parsing of register names with lowercase
|
* fixed parsing of register names with lowercase
|
||||||
|
|
||||||
Revision 1.74 2002/09/01 14:43:12 peter
|
Revision 1.74 2002/09/01 14:43:12 peter
|
||||||
|
Loading…
Reference in New Issue
Block a user