* add "doregister" parameter to tsetdef.create, and don't register temporary

defs created in the scanner for evaluating compile time expressions

git-svn-id: trunk@32048 -
This commit is contained in:
Jonas Maebe 2015-10-13 15:59:12 +00:00
parent e921d7847a
commit b22e2ef400
5 changed files with 11 additions and 11 deletions

View File

@ -1658,7 +1658,7 @@ implementation
llow:=rlow;
lhigh:=rhigh;
end;
nd:=csetdef.create(tsetdef(ld).elementdef,min(llow,rlow).svalue,max(lhigh,rhigh).svalue);
nd:=csetdef.create(tsetdef(ld).elementdef,min(llow,rlow).svalue,max(lhigh,rhigh).svalue,true);
inserttypeconv(left,nd);
if (rd.typ=setdef) then
inserttypeconv(right,nd)

View File

@ -643,7 +643,7 @@ implementation
p.free;
end;
{ set the initial set type }
constp.resultdef:=csetdef.create(hdef,constsetlo.svalue,constsethi.svalue);
constp.resultdef:=csetdef.create(hdef,constsetlo.svalue,constsethi.svalue,true);
{ determine the resultdef for the tree }
typecheckpass(buildp);
{ set the new tree }

View File

@ -1213,8 +1213,8 @@ implementation
enumdef :
if (tenumdef(tt2).min>=0) and
(tenumdef(tt2).max<=255) then
// !! def:=csetdef.create(tt2,tenumdef(tt2.def).min,tenumdef(tt2.def).max))
def:=csetdef.create(tt2,tenumdef(tt2).min,tenumdef(tt2).max)
// !! def:=csetdef.create(tt2,tenumdef(tt2.def).min,tenumdef(tt2.def).max),true)
def:=csetdef.create(tt2,tenumdef(tt2).min,tenumdef(tt2).max,true)
else
Message(sym_e_ill_type_decl_set);
orddef :
@ -1222,11 +1222,11 @@ implementation
if (torddef(tt2).ordtype<>uvoid) and
(torddef(tt2).ordtype<>uwidechar) and
(torddef(tt2).low>=0) then
// !! def:=csetdef.create(tt2,torddef(tt2.def).low,torddef(tt2.def).high))
// !! def:=csetdef.create(tt2,torddef(tt2.def).low,torddef(tt2.def).high),true)
if Torddef(tt2).high>int64(high(byte)) then
message(sym_e_ill_type_decl_set)
else
def:=csetdef.create(tt2,torddef(tt2).low.svalue,torddef(tt2).high.svalue)
def:=csetdef.create(tt2,torddef(tt2).low.svalue,torddef(tt2).high.svalue,true)
else
Message(sym_e_ill_type_decl_set);
end;

View File

@ -922,7 +922,7 @@ type
uintdef:=torddef.create(u64bit,low(qword),high(qword),false);
booldef:=torddef.create(pasbool8,0,1,false);
strdef:=tstringdef.createansi(0,false);
setdef:=tsetdef.create(sintdef,0,255);
setdef:=tsetdef.create(sintdef,0,255,false);
realdef:=tfloatdef.create(s80real);
end;

View File

@ -896,7 +896,7 @@ interface
elementdefderef : tderef;
setbase,
setmax : asizeint;
constructor create(def:tdef;low, high : asizeint);virtual;
constructor create(def: tdef; low, high: asizeint; doregister: boolean);virtual;
constructor ppuload(ppufile:tcompilerppufile);
function getcopy : tstoreddef;override;
{ do not override this routine in platform-specific subclasses,
@ -3326,13 +3326,13 @@ implementation
TSETDEF
***************************************************************************}
constructor tsetdef.create(def:tdef;low, high : asizeint);
constructor tsetdef.create(def: tdef; low, high: asizeint; doregister: boolean);
var
setallocbits: aint;
packedsavesize: aint;
actual_setalloc: ShortInt;
begin
inherited create(setdef,true);
inherited create(setdef,doregister);
elementdef:=def;
setmax:=high;
actual_setalloc:=current_settings.setalloc;
@ -3377,7 +3377,7 @@ implementation
function tsetdef.getcopy : tstoreddef;
begin
result:=csetdef.create(elementdef,setbase,setmax);
result:=csetdef.create(elementdef,setbase,setmax,true);
{ the copy might have been created with a different setalloc setting }
tsetdef(result).savesize:=savesize;
end;