mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 16:09:27 +02:00
- removed most special handling of self (the self parameter has had the
correct type since quite a while) o exceptions: o objects/records (self is a "var" parameter there, and sometimes we want to load it as a pointer to an object instead o Objective-C class methods, where self has to be id (to have a signature compatible with what Objective-C compilers generate), but when loading it we want a classrefdef of the current class for type check and method resolving git-svn-id: trunk@30949 -
This commit is contained in:
parent
fa9ba26cb4
commit
822b943d08
@ -333,27 +333,24 @@ implementation
|
|||||||
{ and behaves as if its address escapes its parent block }
|
{ and behaves as if its address escapes its parent block }
|
||||||
make_not_regable(self,[ra_addr_taken]);
|
make_not_regable(self,[ra_addr_taken]);
|
||||||
end;
|
end;
|
||||||
{ fix self type which is declared as voidpointer in the
|
resultdef:=tabstractvarsym(symtableentry).vardef;
|
||||||
definition }
|
{ self for objects is passed as var-parameter on the caller
|
||||||
if vo_is_self in tabstractvarsym(symtableentry).varoptions then
|
side, but on the callee-side we use it as a pointer ->
|
||||||
|
adjust }
|
||||||
|
if (vo_is_self in tabstractvarsym(symtableentry).varoptions) then
|
||||||
begin
|
begin
|
||||||
resultdef:=tprocdef(symtableentry.owner.defowner).struct;
|
if (is_object(resultdef) or is_record(resultdef)) and
|
||||||
if is_objectpascal_helper(resultdef) then
|
(loadnf_load_self_pointer in loadnodeflags) then
|
||||||
resultdef:=tobjectdef(resultdef).extendeddef;
|
resultdef:=getpointerdef(resultdef)
|
||||||
if (po_classmethod in tprocdef(symtableentry.owner.defowner).procoptions) or
|
else if (resultdef=objc_idtype) and
|
||||||
(po_staticmethod in tprocdef(symtableentry.owner.defowner).procoptions) then
|
(po_classmethod in tprocdef(symtableentry.owner.defowner).procoptions) then
|
||||||
resultdef:=cclassrefdef.create(resultdef)
|
resultdef:=cclassrefdef.create(tprocdef(symtableentry.owner.defowner).struct)
|
||||||
else if (is_object(resultdef) or is_record(resultdef)) and
|
|
||||||
(loadnf_load_self_pointer in loadnodeflags) then
|
|
||||||
resultdef:=getpointerdef(resultdef);
|
|
||||||
end
|
end
|
||||||
else if vo_is_vmt in tabstractvarsym(symtableentry).varoptions then
|
else if vo_is_vmt in tabstractvarsym(symtableentry).varoptions then
|
||||||
begin
|
begin
|
||||||
resultdef:=tprocdef(symtableentry.owner.defowner).struct;
|
resultdef:=tprocdef(symtableentry.owner.defowner).struct;
|
||||||
resultdef:=cclassrefdef.create(resultdef);
|
resultdef:=cclassrefdef.create(resultdef);
|
||||||
end
|
end;
|
||||||
else
|
|
||||||
resultdef:=tabstractvarsym(symtableentry).vardef;
|
|
||||||
end;
|
end;
|
||||||
procsym :
|
procsym :
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user