mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 19:29:26 +02:00
+ some stuff to support method pointers (procedure of object) added
(declaration, parameter handling)
This commit is contained in:
parent
0e34e8a6ce
commit
fd860db6c6
@ -2668,9 +2668,10 @@ implementation
|
||||
emitpushreferenceaddr(funcretref);
|
||||
inc(pushedparasize,4);
|
||||
end;
|
||||
{ overloaded operator have no symtable }
|
||||
{ procedure variable ? }
|
||||
if (p^.right=nil) then
|
||||
begin
|
||||
{ overloaded operator have no symtable }
|
||||
{ push self }
|
||||
if assigned(p^.symtable) and
|
||||
(p^.symtable^.symtabletype=withsymtable) then
|
||||
@ -3044,8 +3045,17 @@ implementation
|
||||
must_pop:=false;
|
||||
pop_size:=0;
|
||||
end;
|
||||
|
||||
secondpass(p^.right);
|
||||
{ method pointer ? }
|
||||
if (p^.procdefinition^.options and pomethodpointer)<>0 then
|
||||
begin
|
||||
{ method pointer can't be in a register }
|
||||
inc(p^.right^.location.reference^.offset,4);
|
||||
{ push self pointer }
|
||||
exprasmlist^.concat(new(pai386,op_ref(A_PUSH,S_L,newreference(p^.right^.location.reference))));
|
||||
del_reference(p^.right^.location.reference);
|
||||
dec(p^.right^.location.reference^.offset,4);
|
||||
end;
|
||||
case p^.right^.location.loc of
|
||||
LOC_REGISTER,LOC_CREGISTER:
|
||||
begin
|
||||
@ -5715,7 +5725,11 @@ do_jmp:
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.8 1998-04-09 22:16:33 florian
|
||||
Revision 1.9 1998-04-10 21:36:55 florian
|
||||
+ some stuff to support method pointers (procedure of object) added
|
||||
(declaration, parameter handling)
|
||||
|
||||
Revision 1.8 1998/04/09 22:16:33 florian
|
||||
* problem with previous REGALLOC solved
|
||||
* improved property support
|
||||
|
||||
|
@ -1097,6 +1097,12 @@ unit pdecl;
|
||||
until false;
|
||||
dec(testcurobject);
|
||||
consume(RKLAMMER);
|
||||
if token=_OF then
|
||||
begin
|
||||
consume(_OF);
|
||||
consume(_OBJECT);
|
||||
procvardef^.options:=procvardef^.options or pomethodpointer;
|
||||
end;
|
||||
end;
|
||||
handle_procvar:=procvardef;
|
||||
end;
|
||||
@ -1730,7 +1736,11 @@ unit pdecl;
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.8 1998-04-10 15:39:48 florian
|
||||
Revision 1.9 1998-04-10 21:36:56 florian
|
||||
+ some stuff to support method pointers (procedure of object) added
|
||||
(declaration, parameter handling)
|
||||
|
||||
Revision 1.8 1998/04/10 15:39:48 florian
|
||||
* more fixes to get classes.pas compiled
|
||||
|
||||
Revision 1.7 1998/04/09 23:02:15 florian
|
||||
|
@ -225,10 +225,11 @@ unit types;
|
||||
ret_in_acc:=(def^.deftype=orddef) or
|
||||
(def^.deftype=pointerdef) or
|
||||
(def^.deftype=enumdef) or
|
||||
(def^.deftype=procvardef) or
|
||||
((def^.deftype=procvardef) and
|
||||
((pprocvardef(def)^.options and pomethodpointer)=0)) or
|
||||
(def^.deftype=classrefdef) or
|
||||
((def^.deftype=objectdef) and
|
||||
((pobjectdef(def)^.options and oois_class)<>0)
|
||||
pobjectdef(def)^.isclass
|
||||
) or
|
||||
((def^.deftype=setdef) and
|
||||
(psetdef(def)^.settype=smallset)) or
|
||||
@ -242,6 +243,8 @@ unit types;
|
||||
begin
|
||||
ret_in_param:=(def^.deftype=arraydef) or
|
||||
(def^.deftype=stringdef) or
|
||||
((def^.deftype=procvardef) and
|
||||
((pprocvardef(def)^.options and pomethodpointer)<>0)) or
|
||||
((def^.deftype=objectdef) and
|
||||
((pobjectdef(def)^.options and oois_class)=0)
|
||||
) or
|
||||
@ -259,7 +262,8 @@ unit types;
|
||||
(def^.deftype=objectdef) or
|
||||
(def^.deftype=formaldef) or
|
||||
(def^.deftype=recorddef) or
|
||||
(def^.deftype=formaldef) or
|
||||
((def^.deftype=procvardef) and
|
||||
((pprocvardef(def)^.options and pomethodpointer)<>0)) or
|
||||
((def^.deftype=setdef) and
|
||||
(psetdef(def)^.settype<>smallset));
|
||||
end;
|
||||
@ -896,7 +900,11 @@ unit types;
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.6 1998-04-10 15:39:49 florian
|
||||
Revision 1.7 1998-04-10 21:36:56 florian
|
||||
+ some stuff to support method pointers (procedure of object) added
|
||||
(declaration, parameter handling)
|
||||
|
||||
Revision 1.6 1998/04/10 15:39:49 florian
|
||||
* more fixes to get classes.pas compiled
|
||||
|
||||
Revision 1.5 1998/04/09 23:02:16 florian
|
||||
|
Loading…
Reference in New Issue
Block a user