mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-15 11:39:32 +02:00
Extend tlocalvarsym with the ability to not register it if needed.
git-svn-id: trunk@32375 -
This commit is contained in:
parent
a192c54e7d
commit
74c79803f7
@ -422,7 +422,7 @@ implementation
|
||||
if not assigned(srsym) then
|
||||
begin
|
||||
{ no valid default variable found, so create it }
|
||||
srsym:=clocalvarsym.create(defaultname,vs_const,def,[]);
|
||||
srsym:=clocalvarsym.create(defaultname,vs_const,def,[],true);
|
||||
srsymtable.insert(srsym);
|
||||
{ mark the staticvarsym as typedconst }
|
||||
include(tabstractvarsym(srsym).varoptions,vo_is_typed_const);
|
||||
|
@ -347,7 +347,7 @@ implementation
|
||||
begin
|
||||
if symtablestack.top.symtabletype=localsymtable then
|
||||
begin
|
||||
labelsym.jumpbuf:=clocalvarsym.create('LABEL$_'+labelsym.name,vs_value,rec_jmp_buf,[]);
|
||||
labelsym.jumpbuf:=clocalvarsym.create('LABEL$_'+labelsym.name,vs_value,rec_jmp_buf,[],true);
|
||||
symtablestack.top.insert(labelsym.jumpbuf);
|
||||
end
|
||||
else
|
||||
|
@ -1292,7 +1292,7 @@ implementation
|
||||
begin
|
||||
case symtablestack.top.symtabletype of
|
||||
localsymtable :
|
||||
vs:=clocalvarsym.create(orgpattern,vs_value,generrordef,[]);
|
||||
vs:=clocalvarsym.create(orgpattern,vs_value,generrordef,[],true);
|
||||
staticsymtable,
|
||||
globalsymtable :
|
||||
begin
|
||||
|
@ -347,7 +347,7 @@ implementation
|
||||
exit_procinfo.nestedexitlabel.defined:=true;
|
||||
exit_procinfo.nestedexitlabel.used:=true;
|
||||
|
||||
exit_procinfo.nestedexitlabel.jumpbuf:=clocalvarsym.create('LABEL$_'+exit_procinfo.nestedexitlabel.name,vs_value,rec_jmp_buf,[]);
|
||||
exit_procinfo.nestedexitlabel.jumpbuf:=clocalvarsym.create('LABEL$_'+exit_procinfo.nestedexitlabel.name,vs_value,rec_jmp_buf,[],true);
|
||||
exit_procinfo.procdef.localst.insert(exit_procinfo.nestedexitlabel);
|
||||
exit_procinfo.procdef.localst.insert(exit_procinfo.nestedexitlabel.jumpbuf);
|
||||
end;
|
||||
|
@ -282,7 +282,7 @@ implementation
|
||||
if (df_generic in pd.defoptions) or
|
||||
not paramanager.ret_in_param(pd.returndef,pd) then
|
||||
begin
|
||||
vs:=clocalvarsym.create('$result',vs_value,pd.returndef,[vo_is_funcret]);
|
||||
vs:=clocalvarsym.create('$result',vs_value,pd.returndef,[vo_is_funcret],true);
|
||||
pd.localst.insert(vs);
|
||||
pd.funcretsym:=vs;
|
||||
end;
|
||||
|
@ -940,7 +940,7 @@ implementation
|
||||
begin
|
||||
single_type(ot,[]);
|
||||
check_type_valid(ot);
|
||||
sym:=clocalvarsym.create(objrealname,vs_value,ot,[]);
|
||||
sym:=clocalvarsym.create(objrealname,vs_value,ot,[],true);
|
||||
end
|
||||
else
|
||||
begin
|
||||
@ -973,7 +973,7 @@ implementation
|
||||
{ create dummy symbol so we don't need a special
|
||||
case in ncgflw, and so that we always know the
|
||||
type }
|
||||
sym:=clocalvarsym.create('$exceptsym',vs_value,ot,[]);
|
||||
sym:=clocalvarsym.create('$exceptsym',vs_value,ot,[],true);
|
||||
end;
|
||||
excepTSymtable:=tstt_excepTSymtable.create;
|
||||
excepTSymtable.insert(sym);
|
||||
|
@ -1166,7 +1166,7 @@ implementation
|
||||
symtablestack.free;
|
||||
symtablestack:=old_symtablestack.getcopyuntil(pd.localst);
|
||||
pnestedvarsdef:=cpointerdef.getreusable(nestedvarsdef);
|
||||
nestedvars:=clocalvarsym.create('$nestedvars',vs_var,nestedvarsdef,[]);
|
||||
nestedvars:=clocalvarsym.create('$nestedvars',vs_var,nestedvarsdef,[],true);
|
||||
pd.localst.insert(nestedvars);
|
||||
pd.parentfpstruct:=nestedvars;
|
||||
pd.parentfpstructptrtype:=pnestedvarsdef;
|
||||
|
@ -249,7 +249,7 @@ interface
|
||||
end;
|
||||
|
||||
tlocalvarsym = class(tabstractnormalvarsym)
|
||||
constructor create(const n : string;vsp:tvarspez;def:tdef;vopts:tvaroptions);virtual;
|
||||
constructor create(const n : string;vsp:tvarspez;def:tdef;vopts:tvaroptions;doregister:boolean);virtual;
|
||||
constructor ppuload(ppufile:tcompilerppufile);
|
||||
{ do not override this routine in platform-specific subclasses,
|
||||
override ppuwrite_platform instead }
|
||||
@ -2084,9 +2084,9 @@ implementation
|
||||
TLOCALVARSYM
|
||||
****************************************************************************}
|
||||
|
||||
constructor tlocalvarsym.create(const n : string;vsp:tvarspez;def:tdef;vopts:tvaroptions);
|
||||
constructor tlocalvarsym.create(const n : string;vsp:tvarspez;def:tdef;vopts:tvaroptions;doregister:boolean);
|
||||
begin
|
||||
inherited create(localvarsym,n,vsp,def,vopts,true);
|
||||
inherited create(localvarsym,n,vsp,def,vopts,doregister);
|
||||
end;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user