mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-31 12:30:42 +02:00
* 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:
parent
e921d7847a
commit
b22e2ef400
@ -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)
|
||||
|
@ -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 }
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user