mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 05:29:22 +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). }
|
destroyed before procsym, leaving invalid pointers). }
|
||||||
oldsymtablestack:=symtablestack;
|
oldsymtablestack:=symtablestack;
|
||||||
symtablestack:=nil;
|
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;
|
symtablestack:=oldsymtablestack;
|
||||||
st.insertdef(result);
|
st.insertdef(result);
|
||||||
result.struct:=current_procinfo.procdef.struct;
|
result.struct:=current_procinfo.procdef.struct;
|
||||||
|
@ -598,7 +598,7 @@ implementation
|
|||||||
var
|
var
|
||||||
pd: tprocdef;
|
pd: tprocdef;
|
||||||
begin
|
begin
|
||||||
pd:=cprocdef.create(main_program_level);
|
pd:=cprocdef.create(main_program_level,true);
|
||||||
pd.procsym:=ps;
|
pd.procsym:=ps;
|
||||||
ps.ProcdefList.Add(pd);
|
ps.ProcdefList.Add(pd);
|
||||||
include(pd.procoptions,po_global);
|
include(pd.procoptions,po_global);
|
||||||
|
@ -980,7 +980,7 @@ implementation
|
|||||||
break;
|
break;
|
||||||
checkstack:=checkstack^.next;
|
checkstack:=checkstack^.next;
|
||||||
end;
|
end;
|
||||||
pd:=cprocdef.create(st.symtablelevel+1);
|
pd:=cprocdef.create(st.symtablelevel+1,true);
|
||||||
pd.struct:=astruct;
|
pd.struct:=astruct;
|
||||||
pd.procsym:=aprocsym;
|
pd.procsym:=aprocsym;
|
||||||
pd.proctypeoption:=potype;
|
pd.proctypeoption:=potype;
|
||||||
|
@ -347,8 +347,8 @@ implementation
|
|||||||
{ Generate temp procdefs to search for matching read/write
|
{ Generate temp procdefs to search for matching read/write
|
||||||
procedures. the readprocdef will store all definitions }
|
procedures. the readprocdef will store all definitions }
|
||||||
paranr:=0;
|
paranr:=0;
|
||||||
readprocdef:=cprocdef.create(normal_function_level);
|
readprocdef:=cprocdef.create(normal_function_level,true);
|
||||||
writeprocdef:=cprocdef.create(normal_function_level);
|
writeprocdef:=cprocdef.create(normal_function_level,true);
|
||||||
|
|
||||||
readprocdef.struct:=astruct;
|
readprocdef.struct:=astruct;
|
||||||
writeprocdef.struct:=astruct;
|
writeprocdef.struct:=astruct;
|
||||||
|
@ -585,7 +585,7 @@ interface
|
|||||||
{ number of user visible parameters }
|
{ number of user visible parameters }
|
||||||
maxparacount,
|
maxparacount,
|
||||||
minparacount : byte;
|
minparacount : byte;
|
||||||
constructor create(dt:tdeftyp;level:byte);
|
constructor create(dt:tdeftyp;level:byte;doregister:boolean);
|
||||||
constructor ppuload(dt:tdeftyp;ppufile:tcompilerppufile);
|
constructor ppuload(dt:tdeftyp;ppufile:tcompilerppufile);
|
||||||
destructor destroy;override;
|
destructor destroy;override;
|
||||||
procedure ppuwrite(ppufile:tcompilerppufile);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
|
{ 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 }
|
a routine that has to be internally generated by the compiler }
|
||||||
synthetickind : tsynthetickind;
|
synthetickind : tsynthetickind;
|
||||||
constructor create(level:byte);virtual;
|
constructor create(level:byte;doregister:boolean);virtual;
|
||||||
constructor ppuload(ppufile:tcompilerppufile);
|
constructor ppuload(ppufile:tcompilerppufile);
|
||||||
destructor destroy;override;
|
destructor destroy;override;
|
||||||
{ do not override this routine in platform-specific subclasses,
|
{ do not override this routine in platform-specific subclasses,
|
||||||
@ -4396,9 +4396,9 @@ implementation
|
|||||||
TABSTRACTPROCDEF
|
TABSTRACTPROCDEF
|
||||||
***************************************************************************}
|
***************************************************************************}
|
||||||
|
|
||||||
constructor tabstractprocdef.create(dt:tdeftyp;level:byte);
|
constructor tabstractprocdef.create(dt:tdeftyp;level:byte;doregister:boolean);
|
||||||
begin
|
begin
|
||||||
inherited create(dt,true);
|
inherited create(dt,doregister);
|
||||||
parast:=tparasymtable.create(self,level);
|
parast:=tparasymtable.create(self,level);
|
||||||
paras:=nil;
|
paras:=nil;
|
||||||
minparacount:=0;
|
minparacount:=0;
|
||||||
@ -4755,9 +4755,9 @@ implementation
|
|||||||
if newtyp=procdef then
|
if newtyp=procdef then
|
||||||
begin
|
begin
|
||||||
if (copytyp<>pc_bareproc) then
|
if (copytyp<>pc_bareproc) then
|
||||||
result:=cprocdef.create(nestinglevel)
|
result:=cprocdef.create(nestinglevel,true)
|
||||||
else
|
else
|
||||||
result:=cprocdef.create(normal_function_level);
|
result:=cprocdef.create(normal_function_level,true);
|
||||||
tprocdef(result).visibility:=vis_public;
|
tprocdef(result).visibility:=vis_public;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -5127,9 +5127,9 @@ implementation
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
constructor tprocdef.create(level:byte);
|
constructor tprocdef.create(level:byte;doregister:boolean);
|
||||||
begin
|
begin
|
||||||
inherited create(procdef,level);
|
inherited create(procdef,level,doregister);
|
||||||
implprocdefinfo:=allocmem(sizeof(implprocdefinfo^));
|
implprocdefinfo:=allocmem(sizeof(implprocdefinfo^));
|
||||||
localst:=tlocalsymtable.create(self,parast.symtablelevel);
|
localst:=tlocalsymtable.create(self,parast.symtablelevel);
|
||||||
{$ifdef symansistr}
|
{$ifdef symansistr}
|
||||||
@ -5925,7 +5925,7 @@ implementation
|
|||||||
|
|
||||||
constructor tprocvardef.create(level:byte);
|
constructor tprocvardef.create(level:byte);
|
||||||
begin
|
begin
|
||||||
inherited create(procvardef,level);
|
inherited create(procvardef,level,true);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user