mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-15 04:19:30 +02:00
+ extend tprocdef with the possiblity to create it as unregistered
* for now all procdefs are created as registered Note: an additional parameter instead of an overload is used for tprocdef.create as otherwise both constructors would need to be overridden in potential descendant CPU-specific classes... git-svn-id: trunk@31593 -
This commit is contained in:
parent
84b9d9839c
commit
65c37df999
@ -2206,7 +2206,7 @@ implementation
|
||||
destroyed before procsym, leaving invalid pointers). }
|
||||
oldsymtablestack:=symtablestack;
|
||||
symtablestack:=nil;
|
||||
result:=cprocdef.create(max(normal_function_level,st.symtablelevel)+1);
|
||||
result:=cprocdef.create(max(normal_function_level,st.symtablelevel)+1,true);
|
||||
symtablestack:=oldsymtablestack;
|
||||
st.insertdef(result);
|
||||
result.struct:=current_procinfo.procdef.struct;
|
||||
|
@ -598,7 +598,7 @@ implementation
|
||||
var
|
||||
pd: tprocdef;
|
||||
begin
|
||||
pd:=cprocdef.create(main_program_level);
|
||||
pd:=cprocdef.create(main_program_level,true);
|
||||
pd.procsym:=ps;
|
||||
ps.ProcdefList.Add(pd);
|
||||
include(pd.procoptions,po_global);
|
||||
|
@ -980,7 +980,7 @@ implementation
|
||||
break;
|
||||
checkstack:=checkstack^.next;
|
||||
end;
|
||||
pd:=cprocdef.create(st.symtablelevel+1);
|
||||
pd:=cprocdef.create(st.symtablelevel+1,true);
|
||||
pd.struct:=astruct;
|
||||
pd.procsym:=aprocsym;
|
||||
pd.proctypeoption:=potype;
|
||||
|
@ -347,8 +347,8 @@ implementation
|
||||
{ Generate temp procdefs to search for matching read/write
|
||||
procedures. the readprocdef will store all definitions }
|
||||
paranr:=0;
|
||||
readprocdef:=cprocdef.create(normal_function_level);
|
||||
writeprocdef:=cprocdef.create(normal_function_level);
|
||||
readprocdef:=cprocdef.create(normal_function_level,true);
|
||||
writeprocdef:=cprocdef.create(normal_function_level,true);
|
||||
|
||||
readprocdef.struct:=astruct;
|
||||
writeprocdef.struct:=astruct;
|
||||
|
@ -585,7 +585,7 @@ interface
|
||||
{ number of user visible parameters }
|
||||
maxparacount,
|
||||
minparacount : byte;
|
||||
constructor create(dt:tdeftyp;level:byte);
|
||||
constructor create(dt:tdeftyp;level:byte;doregister:boolean);
|
||||
constructor ppuload(dt:tdeftyp;ppufile:tcompilerppufile);
|
||||
destructor destroy;override;
|
||||
procedure ppuwrite(ppufile:tcompilerppufile);override;
|
||||
@ -748,7 +748,7 @@ interface
|
||||
{ set to a value different from tsk_none in case this procdef is for
|
||||
a routine that has to be internally generated by the compiler }
|
||||
synthetickind : tsynthetickind;
|
||||
constructor create(level:byte);virtual;
|
||||
constructor create(level:byte;doregister:boolean);virtual;
|
||||
constructor ppuload(ppufile:tcompilerppufile);
|
||||
destructor destroy;override;
|
||||
{ do not override this routine in platform-specific subclasses,
|
||||
@ -4396,9 +4396,9 @@ implementation
|
||||
TABSTRACTPROCDEF
|
||||
***************************************************************************}
|
||||
|
||||
constructor tabstractprocdef.create(dt:tdeftyp;level:byte);
|
||||
constructor tabstractprocdef.create(dt:tdeftyp;level:byte;doregister:boolean);
|
||||
begin
|
||||
inherited create(dt,true);
|
||||
inherited create(dt,doregister);
|
||||
parast:=tparasymtable.create(self,level);
|
||||
paras:=nil;
|
||||
minparacount:=0;
|
||||
@ -4755,9 +4755,9 @@ implementation
|
||||
if newtyp=procdef then
|
||||
begin
|
||||
if (copytyp<>pc_bareproc) then
|
||||
result:=cprocdef.create(nestinglevel)
|
||||
result:=cprocdef.create(nestinglevel,true)
|
||||
else
|
||||
result:=cprocdef.create(normal_function_level);
|
||||
result:=cprocdef.create(normal_function_level,true);
|
||||
tprocdef(result).visibility:=vis_public;
|
||||
end
|
||||
else
|
||||
@ -5127,9 +5127,9 @@ implementation
|
||||
end;
|
||||
|
||||
|
||||
constructor tprocdef.create(level:byte);
|
||||
constructor tprocdef.create(level:byte;doregister:boolean);
|
||||
begin
|
||||
inherited create(procdef,level);
|
||||
inherited create(procdef,level,doregister);
|
||||
implprocdefinfo:=allocmem(sizeof(implprocdefinfo^));
|
||||
localst:=tlocalsymtable.create(self,parast.symtablelevel);
|
||||
{$ifdef symansistr}
|
||||
@ -5925,7 +5925,7 @@ implementation
|
||||
|
||||
constructor tprocvardef.create(level:byte);
|
||||
begin
|
||||
inherited create(procvardef,level);
|
||||
inherited create(procvardef,level,true);
|
||||
end;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user