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
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);

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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;