mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 09:47:52 +02:00
compiler: use current_structdef instead of current_objectdef in more places
git-svn-id: trunk@16658 -
This commit is contained in:
parent
ff2292aafa
commit
dc5f5c3f63
@ -577,7 +577,7 @@ implementation
|
||||
if current_procinfo=tprocinfo(procinfo) then
|
||||
begin
|
||||
current_procinfo:=nil;
|
||||
current_objectdef:=nil;
|
||||
current_structdef:=nil;
|
||||
current_genericdef:=nil;
|
||||
current_specializedef:=nil;
|
||||
end;
|
||||
@ -659,7 +659,7 @@ implementation
|
||||
if current_procinfo=tprocinfo(procinfo) then
|
||||
begin
|
||||
current_procinfo:=nil;
|
||||
current_objectdef:=nil;
|
||||
current_structdef:=nil;
|
||||
current_genericdef:=nil;
|
||||
current_specializedef:=nil;
|
||||
end;
|
||||
|
@ -166,12 +166,12 @@ implementation
|
||||
if (df_generic in left.resultdef.defoptions) then
|
||||
begin
|
||||
defaultresultdef:=true;
|
||||
if assigned(current_objectdef) then
|
||||
if assigned(current_structdef) then
|
||||
begin
|
||||
if assigned(current_objectdef.genericdef) then
|
||||
if current_objectdef.genericdef=left.resultdef then
|
||||
if assigned(current_structdef.genericdef) then
|
||||
if current_structdef.genericdef=left.resultdef then
|
||||
begin
|
||||
resultdef:=tclassrefdef.create(current_objectdef);
|
||||
resultdef:=tclassrefdef.create(current_structdef);
|
||||
defaultresultdef:=false;
|
||||
end
|
||||
else
|
||||
|
@ -731,11 +731,11 @@ implementation
|
||||
var
|
||||
i : longint;
|
||||
def : tdef;
|
||||
old_current_objectdef : tobjectdef;
|
||||
old_current_structdef : tabstractrecorddef;
|
||||
overridesclasshelper : boolean;
|
||||
begin
|
||||
old_current_objectdef:=current_objectdef;
|
||||
current_objectdef:=_class;
|
||||
old_current_structdef:=current_structdef;
|
||||
current_structdef:=_class;
|
||||
|
||||
_class.resetvmtentries;
|
||||
|
||||
@ -770,7 +770,7 @@ implementation
|
||||
intf_allocate_vtbls;
|
||||
end;
|
||||
|
||||
current_objectdef:=old_current_objectdef;
|
||||
current_structdef:=old_current_structdef;
|
||||
end;
|
||||
|
||||
|
||||
|
@ -536,7 +536,7 @@ implementation
|
||||
{ call fail helper and exit normal }
|
||||
if is_class(current_structdef) then
|
||||
begin
|
||||
srsym:=search_struct_member(current_objectdef,'FREEINSTANCE');
|
||||
srsym:=search_struct_member(current_structdef,'FREEINSTANCE');
|
||||
if assigned(srsym) and
|
||||
(srsym.typ=procsym) then
|
||||
begin
|
||||
|
@ -60,7 +60,7 @@ implementation
|
||||
current_module:=nil;
|
||||
current_asmdata:=nil;
|
||||
current_procinfo:=nil;
|
||||
current_objectdef:=nil;
|
||||
current_structdef:=nil;
|
||||
current_genericdef:=nil;
|
||||
current_specializedef:=nil;
|
||||
|
||||
@ -134,7 +134,7 @@ implementation
|
||||
current_module:=nil;
|
||||
current_procinfo:=nil;
|
||||
current_asmdata:=nil;
|
||||
current_objectdef:=nil;
|
||||
current_structdef:=nil;
|
||||
current_genericdef:=nil;
|
||||
current_specializedef:=nil;
|
||||
|
||||
@ -293,7 +293,7 @@ implementation
|
||||
{ parsing a procedure or declaration should be finished }
|
||||
if assigned(current_procinfo) then
|
||||
internalerror(200811121);
|
||||
if assigned(current_objectdef) then
|
||||
if assigned(current_structdef) then
|
||||
internalerror(200811122);
|
||||
inc(compile_level);
|
||||
parser_current_file:=filename;
|
||||
|
@ -298,7 +298,7 @@ implementation
|
||||
if is_class(current_structdef) then
|
||||
begin
|
||||
include(current_procinfo.flags,pi_needs_implicit_finally);
|
||||
srsym:=search_struct_member(current_objectdef,'NEWINSTANCE');
|
||||
srsym:=search_struct_member(current_structdef,'NEWINSTANCE');
|
||||
if assigned(srsym) and
|
||||
(srsym.typ=procsym) then
|
||||
begin
|
||||
@ -363,7 +363,7 @@ implementation
|
||||
if (current_procinfo.procdef.proctypeoption=potype_destructor) and
|
||||
is_class(current_structdef) then
|
||||
begin
|
||||
srsym:=search_struct_member(current_objectdef,'BEFOREDESTRUCTION');
|
||||
srsym:=search_struct_member(current_structdef,'BEFOREDESTRUCTION');
|
||||
if assigned(srsym) and
|
||||
(srsym.typ=procsym) then
|
||||
begin
|
||||
@ -410,7 +410,7 @@ implementation
|
||||
begin
|
||||
if is_class(current_structdef) then
|
||||
begin
|
||||
srsym:=search_struct_member(current_objectdef,'FREEINSTANCE');
|
||||
srsym:=search_struct_member(current_structdef,'FREEINSTANCE');
|
||||
if assigned(srsym) and
|
||||
(srsym.typ=procsym) then
|
||||
begin
|
||||
@ -435,7 +435,7 @@ implementation
|
||||
if is_object(current_structdef) then
|
||||
begin
|
||||
{ finalize object data, but only if not in inherited call }
|
||||
if is_managed_type(current_objectdef) then
|
||||
if is_managed_type(current_structdef) then
|
||||
begin
|
||||
addstatement(newstatement,cifnode.create(
|
||||
caddnode.create(unequaln,
|
||||
@ -615,7 +615,7 @@ implementation
|
||||
{ call AfterConstruction for classes }
|
||||
if is_class(current_structdef) then
|
||||
begin
|
||||
srsym:=search_struct_member(current_objectdef,'AFTERCONSTRUCTION');
|
||||
srsym:=search_struct_member(current_structdef,'AFTERCONSTRUCTION');
|
||||
if assigned(srsym) and
|
||||
(srsym.typ=procsym) then
|
||||
begin
|
||||
|
@ -696,7 +696,7 @@ end;
|
||||
Function TOperand.SetupSelf:boolean;
|
||||
Begin
|
||||
SetupSelf:=false;
|
||||
if assigned(current_objectdef) then
|
||||
if assigned(current_structdef) then
|
||||
SetupSelf:=setupvar('self',false)
|
||||
else
|
||||
Message(asmr_e_cannot_use_SELF_outside_a_method);
|
||||
@ -1307,7 +1307,7 @@ Begin
|
||||
base:=Copy(s,1,i-1);
|
||||
delete(s,1,i);
|
||||
if base='SELF' then
|
||||
st:=current_objectdef.symtable
|
||||
st:=current_structdef.symtable
|
||||
else
|
||||
begin
|
||||
asmsearchsym(base,sym,srsymtable);
|
||||
|
@ -641,8 +641,8 @@ interface
|
||||
end;
|
||||
|
||||
var
|
||||
current_structdef: tabstractrecorddef;
|
||||
current_objectdef : tobjectdef absolute current_structdef; { used for private functions check !! }
|
||||
current_structdef: tabstractrecorddef; { used for private functions check !! }
|
||||
current_objectdef : tobjectdef absolute current_structdef;
|
||||
current_genericdef : tobjectdef; { used to reject declaration of generic class inside generic class }
|
||||
current_specializedef : tobjectdef; { used to implement usage of generic class in itself }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user