* @procvar is now always needed for FPC

This commit is contained in:
peter 1999-06-01 14:45:40 +00:00
parent ddc032bbdb
commit cc0511a890
10 changed files with 97 additions and 134 deletions

View File

@ -52,4 +52,6 @@ Changes in the syntax or semantic of FPC:
exceptions and exceptions need the class OOP model exceptions and exceptions need the class OOP model
18/05/99 The compiler will stop directly if there are errors in the 18/05/99 The compiler will stop directly if there are errors in the
commandline parameters commandline parameters
01/06/99 You now need really always a @ to get the address of a procedure,
or you need to use the -So switch for tp7 style procvar

View File

@ -846,11 +846,7 @@ uses
procedure ResetAsmsymbolList; procedure ResetAsmsymbolList;
begin begin
{$ifdef tp} asmsymbollist^.foreach({$ifdef fpc}@{$endif}resetasmsym);
asmsymbollist^.foreach(resetasmsym);
{$else}
asmsymbollist^.foreach(@resetasmsym);
{$endif}
end; end;
@ -900,7 +896,10 @@ uses
end. end.
{ {
$Log$ $Log$
Revision 1.48 1999-05-28 09:11:39 peter Revision 1.49 1999-06-01 14:45:41 peter
* @procvar is now always needed for FPC
Revision 1.48 1999/05/28 09:11:39 peter
* also count ref when asmlabel^.name is used * also count ref when asmlabel^.name is used
Revision 1.47 1999/05/27 19:43:55 peter Revision 1.47 1999/05/27 19:43:55 peter

View File

@ -584,7 +584,7 @@ ait_stab_function_name : ;
procedure ti386intasmlist.WriteExternals; procedure ti386intasmlist.WriteExternals;
begin begin
currentasmlist:=@self; currentasmlist:=@self;
AsmSymbolList^.foreach(writeexternal); AsmSymbolList^.foreach({$ifdef fpc}@{$endif}writeexternal);
end; end;
@ -627,7 +627,10 @@ ait_stab_function_name : ;
end. end.
{ {
$Log$ $Log$
Revision 1.44 1999-05-27 19:44:00 peter Revision 1.45 1999-06-01 14:45:43 peter
* @procvar is now always needed for FPC
Revision 1.44 1999/05/27 19:44:00 peter
* removed oldasm * removed oldasm
* plabel -> pasmlabel * plabel -> pasmlabel
* -a switches to source writing automaticly * -a switches to source writing automaticly

View File

@ -559,7 +559,7 @@ ait_stab_function_name : ;
procedure ti386nasmasmlist.WriteExternals; procedure ti386nasmasmlist.WriteExternals;
begin begin
currentasmlist:=@self; currentasmlist:=@self;
AsmSymbolList^.foreach(writeexternal); AsmSymbolList^.foreach({$ifdef fpc}@{$endif}writeexternal);
end; end;
@ -597,7 +597,10 @@ ait_stab_function_name : ;
end. end.
{ {
$Log$ $Log$
Revision 1.40 1999-05-27 19:44:02 peter Revision 1.41 1999-06-01 14:45:44 peter
* @procvar is now always needed for FPC
Revision 1.40 1999/05/27 19:44:02 peter
* removed oldasm * removed oldasm
* plabel -> pasmlabel * plabel -> pasmlabel
* -a switches to source writing automaticly * -a switches to source writing automaticly

View File

@ -203,7 +203,7 @@ implementation
root:=nil; root:=nil;
count:=0; count:=0;
{ insert all message handlers into a tree, sorted by name } { insert all message handlers into a tree, sorted by name }
_class^.publicsyms^.foreach(insertmsgstr); _class^.publicsyms^.foreach({$ifdef fpc}@{$endif}insertmsgstr);
{ write all names } { write all names }
if assigned(root) then if assigned(root) then
@ -245,7 +245,7 @@ implementation
root:=nil; root:=nil;
count:=0; count:=0;
{ insert all message handlers into a tree, sorted by name } { insert all message handlers into a tree, sorted by name }
_class^.publicsyms^.foreach(insertmsgint); _class^.publicsyms^.foreach({$ifdef fpc}@{$endif}insertmsgint);
{ now start writing of the message string table } { now start writing of the message string table }
getdatalabel(r); getdatalabel(r);
@ -471,11 +471,7 @@ implementation
{ walk through all public syms } { walk through all public syms }
_c:=_class; _c:=_class;
{$ifdef tp} p^.publicsyms^.foreach({$ifdef fpc}@{$endif}eachsym);
p^.publicsyms^.foreach(eachsym);
{$else}
p^.publicsyms^.foreach(@eachsym);
{$endif}
end; end;
var var
@ -562,7 +558,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.7 1999-05-27 19:44:30 peter Revision 1.8 1999-06-01 14:45:49 peter
* @procvar is now always needed for FPC
Revision 1.7 1999/05/27 19:44:30 peter
* removed oldasm * removed oldasm
* plabel -> pasmlabel * plabel -> pasmlabel
* -a switches to source writing automaticly * -a switches to source writing automaticly

View File

@ -410,18 +410,10 @@ implementation
for i:=1 to maxvarregs do for i:=1 to maxvarregs do
regvars[i]:=nil; regvars[i]:=nil;
parasym:=false; parasym:=false;
{$ifdef tp} symtablestack^.foreach({$ifdef fpc}@{$endif}searchregvars);
symtablestack^.foreach(searchregvars);
{$else}
symtablestack^.foreach(@searchregvars);
{$endif}
{ copy parameter into a register ? } { copy parameter into a register ? }
parasym:=true; parasym:=true;
{$ifdef tp} symtablestack^.next^.foreach({$ifdef fpc}@{$endif}searchregvars);
symtablestack^.next^.foreach(searchregvars);
{$else}
symtablestack^.next^.foreach(@searchregvars);
{$endif}
{ hold needed registers free } { hold needed registers free }
for i:=maxvarregs downto maxvarregs-p^.registers32+1 do for i:=maxvarregs downto maxvarregs-p^.registers32+1 do
regvars[i]:=nil; regvars[i]:=nil;
@ -547,7 +539,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.23 1999-05-27 19:44:43 peter Revision 1.24 1999-06-01 14:45:50 peter
* @procvar is now always needed for FPC
Revision 1.23 1999/05/27 19:44:43 peter
* removed oldasm * removed oldasm
* plabel -> pasmlabel * plabel -> pasmlabel
* -a switches to source writing automaticly * -a switches to source writing automaticly

View File

@ -100,11 +100,7 @@ unit pdecl;
reaktvarsymtable:=precdef(ptypesym(p)^.definition)^.symtable reaktvarsymtable:=precdef(ptypesym(p)^.definition)^.symtable
else else
reaktvarsymtable:=pobjectdef(ptypesym(p)^.definition)^.publicsyms; reaktvarsymtable:=pobjectdef(ptypesym(p)^.definition)^.publicsyms;
{$ifdef tp} reaktvarsymtable^.foreach({$ifdef fpc}@{$endif}testforward_type);
reaktvarsymtable^.foreach(testforward_type);
{$else}
reaktvarsymtable^.foreach(@testforward_type);
{$endif}
end; end;
end; end;
@ -2109,11 +2105,7 @@ unit pdecl;
parse_var_proc_directives(newtype); parse_var_proc_directives(newtype);
until token<>ID; until token<>ID;
typecanbeforward:=false; typecanbeforward:=false;
{$ifdef tp} symtablestack^.foreach({$ifdef fpc}@{$endif}testforward_type);
symtablestack^.foreach(testforward_type);
{$else}
symtablestack^.foreach(@testforward_type);
{$endif}
resolve_forwards; resolve_forwards;
block_type:=bt_general; block_type:=bt_general;
end; end;
@ -2224,7 +2216,10 @@ unit pdecl;
end. end.
{ {
$Log$ $Log$
Revision 1.123 1999-05-27 19:44:45 peter Revision 1.124 1999-06-01 14:45:51 peter
* @procvar is now always needed for FPC
Revision 1.123 1999/05/27 19:44:45 peter
* removed oldasm * removed oldasm
* plabel -> pasmlabel * plabel -> pasmlabel
* -a switches to source writing automaticly * -a switches to source writing automaticly

View File

@ -1878,7 +1878,7 @@
{ procedure of needs_rtti ! } { procedure of needs_rtti ! }
oldb:=binittable; oldb:=binittable;
binittable:=false; binittable:=false;
symtable^.foreach(check_rec_inittable); symtable^.foreach({$ifdef fpc}@{$endif}check_rec_inittable);
needs_inittable:=binittable; needs_inittable:=binittable;
binittable:=oldb; binittable:=oldb;
end; end;
@ -2037,13 +2037,13 @@
procedure trecdef.write_child_rtti_data; procedure trecdef.write_child_rtti_data;
begin begin
symtable^.foreach(generate_child_rtti); symtable^.foreach({$ifdef fpc}@{$endif}generate_child_rtti);
end; end;
procedure trecdef.write_child_init_data; procedure trecdef.write_child_init_data;
begin begin
symtable^.foreach(generate_child_inittable); symtable^.foreach({$ifdef fpc}@{$endif}generate_child_inittable);
end; end;
@ -2053,9 +2053,9 @@
write_rtti_name; write_rtti_name;
rttilist^.concat(new(pai_const,init_32bit(size))); rttilist^.concat(new(pai_const,init_32bit(size)));
count:=0; count:=0;
symtable^.foreach(count_fields); symtable^.foreach({$ifdef fpc}@{$endif}count_fields);
rttilist^.concat(new(pai_const,init_32bit(count))); rttilist^.concat(new(pai_const,init_32bit(count)));
symtable^.foreach(write_field_rtti); symtable^.foreach({$ifdef fpc}@{$endif}write_field_rtti);
end; end;
@ -2065,9 +2065,9 @@
write_rtti_name; write_rtti_name;
rttilist^.concat(new(pai_const,init_32bit(size))); rttilist^.concat(new(pai_const,init_32bit(size)));
count:=0; count:=0;
symtable^.foreach(count_inittable_fields); symtable^.foreach({$ifdef fpc}@{$endif}count_inittable_fields);
rttilist^.concat(new(pai_const,init_32bit(count))); rttilist^.concat(new(pai_const,init_32bit(count)));
symtable^.foreach(write_field_inittable); symtable^.foreach({$ifdef fpc}@{$endif}write_field_inittable);
end; end;
function trecdef.gettypename : string; function trecdef.gettypename : string;
@ -2637,11 +2637,7 @@ Const local_symtable_index : longint = $8001;
strpcopy(strend(StabRecString),','+tostr(i)+';'); strpcopy(strend(StabRecString),','+tostr(i)+';');
(* confuse gdb !! PM (* confuse gdb !! PM
if assigned(parast) then if assigned(parast) then
{$IfDef TP} parast^.foreach({$ifdef fpc}@{$endif}addparaname)
parast^.foreach(addparaname)
{$Else}
parast^.foreach(@addparaname)
{$EndIf}
else else
begin begin
param := para1; param := para1;
@ -3214,22 +3210,14 @@ Const local_symtable_index : longint = $8001;
strpcopy(strend(stabrecstring),'!1,020,'+childof^.numberstring+';'); strpcopy(strend(stabrecstring),'!1,020,'+childof^.numberstring+';');
{virtual table to implement yet} {virtual table to implement yet}
RecOffset := 0; RecOffset := 0;
{$ifdef tp} publicsyms^.foreach({$ifdef fpc}@{$endif}addname);
publicsyms^.foreach(addname);
{$else}
publicsyms^.foreach(@addname);
{$endif}
if (options and oo_hasvmt) <> 0 then if (options and oo_hasvmt) <> 0 then
if not assigned(childof) or ((childof^.options and oo_hasvmt) = 0) then if not assigned(childof) or ((childof^.options and oo_hasvmt) = 0) then
begin begin
strpcopy(strend(stabrecstring),'$vf'+numberstring+':'+typeglobalnumber('vtblarray') strpcopy(strend(stabrecstring),'$vf'+numberstring+':'+typeglobalnumber('vtblarray')
+','+tostr(vmt_offset*8)+';'); +','+tostr(vmt_offset*8)+';');
end; end;
{$ifdef tp} publicsyms^.foreach({$ifdef fpc}@{$endif}addprocname);
publicsyms^.foreach(addprocname);
{$else}
publicsyms^.foreach(@addprocname);
{$endif tp }
if (options and oo_hasvmt) <> 0 then if (options and oo_hasvmt) <> 0 then
begin begin
anc := @self; anc := @self;
@ -3266,9 +3254,9 @@ Const local_symtable_index : longint = $8001;
rttilist^.concat(new(pai_const,init_32bit(size))); rttilist^.concat(new(pai_const,init_32bit(size)));
count:=0; count:=0;
publicsyms^.foreach(count_inittable_fields); publicsyms^.foreach({$ifdef fpc}@{$endif}count_inittable_fields);
rttilist^.concat(new(pai_const,init_32bit(count))); rttilist^.concat(new(pai_const,init_32bit(count)));
publicsyms^.foreach(write_field_inittable); publicsyms^.foreach({$ifdef fpc}@{$endif}write_field_inittable);
end; end;
@ -3282,7 +3270,7 @@ Const local_symtable_index : longint = $8001;
{ procedure of needs_rtti ! } { procedure of needs_rtti ! }
oldb:=binittable; oldb:=binittable;
binittable:=false; binittable:=false;
publicsyms^.foreach(check_rec_inittable); publicsyms^.foreach({$ifdef fpc}@{$endif}check_rec_inittable);
needs_inittable:=binittable; needs_inittable:=binittable;
binittable:=oldb; binittable:=oldb;
end; end;
@ -3375,7 +3363,7 @@ Const local_symtable_index : longint = $8001;
procedure tobjectdef.write_child_rtti_data; procedure tobjectdef.write_child_rtti_data;
begin begin
publicsyms^.foreach(generate_published_child_rtti); publicsyms^.foreach({$ifdef fpc}@{$endif}generate_published_child_rtti);
end; end;
@ -3399,7 +3387,7 @@ Const local_symtable_index : longint = $8001;
else else
i:=0; i:=0;
count:=0; count:=0;
publicsyms^.foreach(count_published_properties); publicsyms^.foreach({$ifdef fpc}@{$endif}count_published_properties);
next_free_name_index:=i+count; next_free_name_index:=i+count;
end; end;
@ -3431,7 +3419,7 @@ Const local_symtable_index : longint = $8001;
count:=0; count:=0;
{ write it } { write it }
publicsyms^.foreach(count_published_properties); publicsyms^.foreach({$ifdef fpc}@{$endif}count_published_properties);
rttilist^.concat(new(pai_const,init_16bit(count))); rttilist^.concat(new(pai_const,init_16bit(count)));
{ write unit name } { write unit name }
@ -3445,7 +3433,7 @@ Const local_symtable_index : longint = $8001;
{ write published properties count } { write published properties count }
count:=0; count:=0;
publicsyms^.foreach(count_published_properties); publicsyms^.foreach({$ifdef fpc}@{$endif}count_published_properties);
rttilist^.concat(new(pai_const,init_16bit(count))); rttilist^.concat(new(pai_const,init_16bit(count)));
{ count is used to write nameindex } { count is used to write nameindex }
@ -3456,7 +3444,7 @@ Const local_symtable_index : longint = $8001;
else else
count:=0; count:=0;
publicsyms^.foreach(write_property_info); publicsyms^.foreach({$ifdef fpc}@{$endif}write_property_info);
end; end;
@ -3497,7 +3485,10 @@ Const local_symtable_index : longint = $8001;
{ {
$Log$ $Log$
Revision 1.124 1999-05-31 16:42:33 peter Revision 1.125 1999-06-01 14:45:56 peter
* @procvar is now always needed for FPC
Revision 1.124 1999/05/31 16:42:33 peter
* interfacedef flag for procdef if it's defined in the interface, to * interfacedef flag for procdef if it's defined in the interface, to
make a difference with 'forward;' directive forwarddef. Fixes 253 make a difference with 'forward;' directive forwarddef. Fixes 253

View File

@ -1614,11 +1614,7 @@ const localsymtablestack : psymtable = nil;
aktrecordsymtable:=@self; aktrecordsymtable:=@self;
end; end;
current_ppu^.writeentry(ibbeginsymtablebrowser); current_ppu^.writeentry(ibbeginsymtablebrowser);
{$ifdef tp} foreach({$ifdef fpc}@{$endif}write_refs);
foreach(write_refs);
{$else}
foreach(@write_refs);
{$endif}
current_ppu^.writeentry(ibendsymtablebrowser); current_ppu^.writeentry(ibendsymtablebrowser);
if symtabletype in [recordsymtable,objectsymtable, if symtabletype in [recordsymtable,objectsymtable,
parasymtable,localsymtable] then parasymtable,localsymtable] then
@ -1642,11 +1638,7 @@ const localsymtablestack : psymtable = nil;
Browserlog.AddLog('---Symtable with no name'); Browserlog.AddLog('---Symtable with no name');
end; end;
Browserlog.Ident; Browserlog.Ident;
{$ifdef tp} foreach({$ifdef fpc}@{$endif}add_to_browserlog);
foreach(add_to_browserlog);
{$else}
foreach(@add_to_browserlog);
{$endif}
browserlog.Unident; browserlog.Unident;
end; end;
end; end;
@ -1660,20 +1652,12 @@ const localsymtablestack : psymtable = nil;
{ checks, if all procsyms and methods are defined } { checks, if all procsyms and methods are defined }
procedure tsymtable.check_forwards; procedure tsymtable.check_forwards;
begin begin
{$ifdef tp} foreach({$ifdef fpc}@{$endif}check_procsym_forward);
foreach(check_procsym_forward);
{$else}
foreach(@check_procsym_forward);
{$endif}
end; end;
procedure tsymtable.checklabels; procedure tsymtable.checklabels;
begin begin
{$ifdef tp} foreach({$ifdef fpc}@{$endif}labeldefined);
foreach(labeldefined);
{$else}
foreach(@labeldefined);
{$endif}
end; end;
procedure tsymtable.set_alignment(_alignment : byte); procedure tsymtable.set_alignment(_alignment : byte);
@ -1721,30 +1705,18 @@ const localsymtablestack : psymtable = nil;
procedure tsymtable.allunitsused; procedure tsymtable.allunitsused;
begin begin
{$ifdef tp} foreach({$ifdef fpc}@{$endif}unitsymbolused);
foreach(unitsymbolused);
{$else}
foreach(@unitsymbolused);
{$endif}
end; end;
procedure tsymtable.allsymbolsused; procedure tsymtable.allsymbolsused;
begin begin
{$ifdef tp} foreach({$ifdef fpc}@{$endif}varsymbolused);
foreach(varsymbolused);
{$else}
foreach(@varsymbolused);
{$endif}
end; end;
{$ifdef CHAINPROCSYMS} {$ifdef CHAINPROCSYMS}
procedure tsymtable.chainprocsyms; procedure tsymtable.chainprocsyms;
begin begin
{$ifdef tp} foreach({$ifdef fpc}@{$endif}chainprocsym);
foreach(chainprocsym);
{$else}
foreach(@chainprocsym);
{$endif}
end; end;
{$endif CHAINPROCSYMS} {$endif CHAINPROCSYMS}
@ -1752,11 +1724,7 @@ const localsymtablestack : psymtable = nil;
procedure tsymtable.concatstabto(asmlist : paasmoutput); procedure tsymtable.concatstabto(asmlist : paasmoutput);
begin begin
asmoutput:=asmlist; asmoutput:=asmlist;
{$ifdef tp} foreach({$ifdef fpc}@{$endif}concatstab);
foreach(concatstab);
{$else}
foreach(@concatstab);
{$endif}
end; end;
{$endif} {$endif}
@ -2004,11 +1972,7 @@ const localsymtablestack : psymtable = nil;
dbx_counter := @dbx_count; dbx_counter := @dbx_count;
end; end;
asmoutput:=asmlist; asmoutput:=asmlist;
{$ifdef tp} foreach({$ifdef fpc}@{$endif}concattypestab);
foreach(concattypestab);
{$else}
foreach(@concattypestab);
{$endif}
if cs_gdb_dbx in aktglobalswitches then if cs_gdb_dbx in aktglobalswitches then
begin begin
dbx_counter := prev_dbx_count; dbx_counter := prev_dbx_count;
@ -2163,11 +2127,7 @@ const localsymtablestack : psymtable = nil;
_defaultprop:=nil; _defaultprop:=nil;
while assigned(pd) do while assigned(pd) do
begin begin
{$ifdef tp} pd^.publicsyms^.foreach({$ifdef fpc}@{$endif}testfordefaultproperty);
pd^.publicsyms^.foreach(testfordefaultproperty);
{$else}
pd^.publicsyms^.foreach(@testfordefaultproperty);
{$endif}
if assigned(_defaultprop) then if assigned(_defaultprop) then
break; break;
pd:=pd^.childof; pd:=pd^.childof;
@ -2341,7 +2301,10 @@ const localsymtablestack : psymtable = nil;
end. end.
{ {
$Log$ $Log$
Revision 1.17 1999-05-27 19:45:08 peter Revision 1.18 1999-06-01 14:45:58 peter
* @procvar is now always needed for FPC
Revision 1.17 1999/05/27 19:45:08 peter
* removed oldasm * removed oldasm
* plabel -> pasmlabel * plabel -> pasmlabel
* -a switches to source writing automaticly * -a switches to source writing automaticly

View File

@ -690,10 +690,11 @@ implementation
begin begin
{ there is an error, must be wrong type, because { there is an error, must be wrong type, because
wrong size is already checked (PFV) } wrong size is already checked (PFV) }
if ((parsing_para_level=0) or (p^.left<>nil)) and {if ((parsing_para_level=0) or (p^.left<>nil)) and
(nextprocsym=nil) then (nextprocsym=nil) then }
if parsing_para_level=0 then
begin begin
if (not assigned(lastparatype)) and (not assigned(pt^.resulttype)) then if (not assigned(lastparatype)) or (not assigned(pt^.resulttype)) then
internalerror(39393) internalerror(39393)
else else
CGMessage3(type_e_wrong_parameter_type,tostr(lastpara), CGMessage3(type_e_wrong_parameter_type,tostr(lastpara),
@ -703,13 +704,22 @@ implementation
end end
else else
begin begin
{ try to convert to procvar } if (m_tp_procvar in aktmodeswitches) then
p^.treetype:=loadn; begin
p^.resulttype:=pprocsym(p^.symtableprocentry)^.definition; { try to convert to procvar }
p^.symtableentry:=p^.symtableprocentry; p^.treetype:=loadn;
p^.is_first:=false; p^.resulttype:=pprocsym(p^.symtableprocentry)^.definition;
p^.disposetyp:=dt_nothing; p^.symtableentry:=p^.symtableprocentry;
firstpass(p); p^.is_first:=false;
p^.disposetyp:=dt_nothing;
firstpass(p);
end
else
begin
{ only return the resulttype, the check for equal will be done
in the para parsing of the previous function }
p^.resulttype:=pprocsym(p^.symtableprocentry)^.definition^.retdef;
end;
goto errorexit; goto errorexit;
end; end;
end; end;
@ -1162,7 +1172,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.49 1999-05-31 20:34:51 peter Revision 1.50 1999-06-01 14:46:00 peter
* @procvar is now always needed for FPC
Revision 1.49 1999/05/31 20:34:51 peter
* fixed hightree generation when loading highSYM * fixed hightree generation when loading highSYM
Revision 1.48 1999/05/27 19:45:13 peter Revision 1.48 1999/05/27 19:45:13 peter