Extend tlocalvarsym with the ability to not register it if needed.

git-svn-id: trunk@32375 -
This commit is contained in:
svenbarth 2015-11-20 11:29:21 +00:00
parent a192c54e7d
commit 74c79803f7
8 changed files with 11 additions and 11 deletions

View File

@ -422,7 +422,7 @@ implementation
if not assigned(srsym) then if not assigned(srsym) then
begin begin
{ no valid default variable found, so create it } { 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); srsymtable.insert(srsym);
{ mark the staticvarsym as typedconst } { mark the staticvarsym as typedconst }
include(tabstractvarsym(srsym).varoptions,vo_is_typed_const); include(tabstractvarsym(srsym).varoptions,vo_is_typed_const);

View File

@ -347,7 +347,7 @@ implementation
begin begin
if symtablestack.top.symtabletype=localsymtable then if symtablestack.top.symtabletype=localsymtable then
begin 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); symtablestack.top.insert(labelsym.jumpbuf);
end end
else else

View File

@ -1292,7 +1292,7 @@ implementation
begin begin
case symtablestack.top.symtabletype of case symtablestack.top.symtabletype of
localsymtable : localsymtable :
vs:=clocalvarsym.create(orgpattern,vs_value,generrordef,[]); vs:=clocalvarsym.create(orgpattern,vs_value,generrordef,[],true);
staticsymtable, staticsymtable,
globalsymtable : globalsymtable :
begin begin

View File

@ -347,7 +347,7 @@ implementation
exit_procinfo.nestedexitlabel.defined:=true; exit_procinfo.nestedexitlabel.defined:=true;
exit_procinfo.nestedexitlabel.used:=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);
exit_procinfo.procdef.localst.insert(exit_procinfo.nestedexitlabel.jumpbuf); exit_procinfo.procdef.localst.insert(exit_procinfo.nestedexitlabel.jumpbuf);
end; end;

View File

@ -282,7 +282,7 @@ implementation
if (df_generic in pd.defoptions) or if (df_generic in pd.defoptions) or
not paramanager.ret_in_param(pd.returndef,pd) then not paramanager.ret_in_param(pd.returndef,pd) then
begin 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.localst.insert(vs);
pd.funcretsym:=vs; pd.funcretsym:=vs;
end; end;

View File

@ -940,7 +940,7 @@ implementation
begin begin
single_type(ot,[]); single_type(ot,[]);
check_type_valid(ot); check_type_valid(ot);
sym:=clocalvarsym.create(objrealname,vs_value,ot,[]); sym:=clocalvarsym.create(objrealname,vs_value,ot,[],true);
end end
else else
begin begin
@ -973,7 +973,7 @@ implementation
{ create dummy symbol so we don't need a special { create dummy symbol so we don't need a special
case in ncgflw, and so that we always know the case in ncgflw, and so that we always know the
type } type }
sym:=clocalvarsym.create('$exceptsym',vs_value,ot,[]); sym:=clocalvarsym.create('$exceptsym',vs_value,ot,[],true);
end; end;
excepTSymtable:=tstt_excepTSymtable.create; excepTSymtable:=tstt_excepTSymtable.create;
excepTSymtable.insert(sym); excepTSymtable.insert(sym);

View File

@ -1166,7 +1166,7 @@ implementation
symtablestack.free; symtablestack.free;
symtablestack:=old_symtablestack.getcopyuntil(pd.localst); symtablestack:=old_symtablestack.getcopyuntil(pd.localst);
pnestedvarsdef:=cpointerdef.getreusable(nestedvarsdef); pnestedvarsdef:=cpointerdef.getreusable(nestedvarsdef);
nestedvars:=clocalvarsym.create('$nestedvars',vs_var,nestedvarsdef,[]); nestedvars:=clocalvarsym.create('$nestedvars',vs_var,nestedvarsdef,[],true);
pd.localst.insert(nestedvars); pd.localst.insert(nestedvars);
pd.parentfpstruct:=nestedvars; pd.parentfpstruct:=nestedvars;
pd.parentfpstructptrtype:=pnestedvarsdef; pd.parentfpstructptrtype:=pnestedvarsdef;

View File

@ -249,7 +249,7 @@ interface
end; end;
tlocalvarsym = class(tabstractnormalvarsym) 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); constructor ppuload(ppufile:tcompilerppufile);
{ do not override this routine in platform-specific subclasses, { do not override this routine in platform-specific subclasses,
override ppuwrite_platform instead } override ppuwrite_platform instead }
@ -2084,9 +2084,9 @@ implementation
TLOCALVARSYM 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 begin
inherited create(localvarsym,n,vsp,def,vopts,true); inherited create(localvarsym,n,vsp,def,vopts,doregister);
end; end;