* removed obsolete newst defines

This commit is contained in:
peter 2001-09-30 21:26:42 +00:00
parent 0d27041955
commit f709d48789

View File

@ -209,10 +209,7 @@ unit cgobj;
uses uses
strings,globals,globtype,options,{files,}gdb,systems, strings,globals,globtype,options,{files,}gdb,systems,
ppu,verbose,types,{tgobj,}tgcpu,symdef,symsym,cga ppu,verbose,types,{tgobj,}tgcpu,symdef,symsym,cga;
{$IFDEF NEWST}
,symbols,defs,symtablt
{$ENDIF NEWST};
const const
max_scratch_regs = high(scratch_regs) - low(scratch_regs) + 1; max_scratch_regs = high(scratch_regs) - low(scratch_regs) + 1;
@ -466,27 +463,6 @@ unit cgobj;
begin begin
(* (*
{$IFDEF NEWST}
if (typeof(p^)=typeof(Tvarsym)) and
assigned(pvarsym(p)^.definition) and
not((typeof((pvarsym(p)^.definition^))=typeof(Tobjectdef)) and
(oo_is_class in pobjectdef(pvarsym(p)^.definition)^.options)) and
pvarsym(p)^.definition^.needs_inittable then
begin
procinfo^.flags:=procinfo^.flags or pi_needs_implicit_finally;
reset_reference(hr);
if typeof((tsym(p)^.owner^))=typeof(Tprocsymtable) then
begin
hr.base:=procinfo^.framepointer;
hr.offset:=-pvarsym(p)^.address;
end
else
begin
hr.symbol:=newasmsymbol(pvarsym(p)^.mangledname);
end;
g_initialize(list,pvarsym(p)^.definition,hr,false);
end;
{$ELSE}
if (tsym(p)^.typ=varsym) and if (tsym(p)^.typ=varsym) and
assigned(pvarsym(p)^.vartype.def) and assigned(pvarsym(p)^.vartype.def) and
not((pvarsym(p)^.vartype.def^.deftype=objectdef) and not((pvarsym(p)^.vartype.def^.deftype=objectdef) and
@ -506,7 +482,6 @@ unit cgobj;
end; end;
g_initialize(list,pvarsym(p)^.vartype.def,hr,false); g_initialize(list,pvarsym(p)^.vartype.def,hr,false);
end; end;
{$ENDIF NEWST}
*) *)
runerror(211); runerror(211);
end; end;
@ -520,25 +495,6 @@ unit cgobj;
begin begin
(* (*
{$IFDEF NEWST}
if (typeof((tsym(p)^))=typeof(Tparamsym)) and
not((typeof((Pparamsym(p)^.definition^))=typeof(Tobjectdef)) and
(oo_is_class in pobjectdef(pvarsym(p)^.definition)^.options)) and
Pparamsym(p)^.definition^.needs_inittable and
((Pparamsym(p)^.varspez=vs_value)) then
begin
procinfo^.flags:=procinfo^.flags or pi_needs_implicit_finally;
reset_reference(hr);
hr.symbol:=pvarsym(p)^.definition^.get_inittable_label;
a_param_ref_addr(list,hr,2);
reset_reference(hr);
hr.base:=procinfo^.framepointer;
hr.offset:=pvarsym(p)^.address+procinfo^.para_offset;
a_param_ref_addr(list,hr,1);
reset_reference(hr);
a_call_name(list,'FPC_ADDREF',0);
end;
{$ELSE}
if (tsym(p)^.typ=varsym) and if (tsym(p)^.typ=varsym) and
not((pvarsym(p)^.vartype.def^.deftype=objectdef) and not((pvarsym(p)^.vartype.def^.deftype=objectdef) and
pobjectdef(pvarsym(p)^.vartype.def)^.is_class) and pobjectdef(pvarsym(p)^.vartype.def)^.is_class) and
@ -556,7 +512,6 @@ unit cgobj;
reset_reference(hr); reset_reference(hr);
a_call_name(list,'FPC_ADDREF',0); a_call_name(list,'FPC_ADDREF',0);
end; end;
{$ENDIF NEWST}
*) *)
runerror(211); runerror(211);
end; end;
@ -570,36 +525,6 @@ unit cgobj;
begin begin
(* (*
{$IFDEF NEWST}
if (typeof((tsym(p)^))=typeof(Tvarsym)) and
assigned(pvarsym(p)^.definition) and
not((typeof((pvarsym(p)^.definition^))=typeof(Tobjectdef)) and
(oo_is_class in pobjectdef(pvarsym(p)^.definition)^.options)) and
pvarsym(p)^.definition^.needs_inittable then
begin
{ not all kind of parameters need to be finalized }
if (typeof((tsym(p)^.owner^))=typeof(Tprocsymtable)) and
((pparamsym(p)^.varspez=vs_var) or
(Pparamsym(p)^.varspez=vs_const) { and
(dont_copy_const_param(pvarsym(p)^.definition)) } ) then
exit;
procinfo^.flags:=procinfo^.flags or pi_needs_implicit_finally;
reset_reference(hr);
if typeof((tsym(p)^.owner^))=typeof(Tprocsymtable) then
begin
hr.base:=procinfo^.framepointer;
hr.offset:=-pvarsym(p)^.address;
end
else if typeof((tsym(p)^.owner^))=typeof(Tprocsymtable) then
begin
hr.base:=procinfo^.framepointer;
hr.offset:=pvarsym(p)^.address+procinfo^.para_offset;
end
else
hr.symbol:=newasmsymbol(pvarsym(p)^.mangledname);
g_finalize(list,pvarsym(p)^.definition,hr,false);
end;
{$ELSE}
if (tsym(p)^.typ=varsym) and if (tsym(p)^.typ=varsym) and
assigned(pvarsym(p)^.vartype.def) and assigned(pvarsym(p)^.vartype.def) and
not((pvarsym(p)^.vartype.def^.deftype=objectdef) and not((pvarsym(p)^.vartype.def^.deftype=objectdef) and
@ -630,7 +555,6 @@ unit cgobj;
end; end;
g_finalize(list,pvarsym(p)^.vartype.def,hr,false); g_finalize(list,pvarsym(p)^.vartype.def,hr,false);
end; end;
{$ENDIF NEWST}
*) *)
runerror(211); runerror(211);
end; end;
@ -649,13 +573,11 @@ unit cgobj;
{ wrappers for the methods, because TP doesn't know procedures } { wrappers for the methods, because TP doesn't know procedures }
{ of objects } { of objects }
{$IFNDEF NEWST}
procedure _copyvalueparas(s : tnamedindexitem);{$ifndef FPC}far;{$endif} procedure _copyvalueparas(s : tnamedindexitem);{$ifndef FPC}far;{$endif}
begin begin
cg^.g_copyvalueparas(_list,s); cg^.g_copyvalueparas(_list,s);
end; end;
{$ENDIF NEWST}
*) *)
procedure tcg.g_finalizetempansistrings(list : taasmoutput); procedure tcg.g_finalizetempansistrings(list : taasmoutput);
@ -687,24 +609,6 @@ unit cgobj;
end; end;
(* (*
{$IFDEF NEWST}
procedure _initialize_local(s:tnamedindexitem);{$IFNDEF FPC}far;{$ENDIF}
begin
if typeof(s^)=typeof(Tparamsym) then
cg^.g_incr_data(_list,tsym(s))
else
cg^.g_initialize_data(_list,tsym(s));
end;
procedure _finalize_data(s : tnamedindexitem);{$ifndef FPC}far;{$endif}
begin
if typeof(s^)=typeof(Tvarsym) then
cg^.g_finalize_data(_list,s);
end;
{$ELSE}
procedure _finalize_data(s : tnamedindexitem);{$ifndef FPC}far;{$endif} procedure _finalize_data(s : tnamedindexitem);{$ifndef FPC}far;{$endif}
begin begin
@ -722,7 +626,6 @@ unit cgobj;
begin begin
cg^.g_initialize_data(_list,tsym(s)); cg^.g_initialize_data(_list,tsym(s));
end; end;
{$ENDIF NEWST}
*) *)
{ generates the entry code for a procedure } { generates the entry code for a procedure }
@ -732,14 +635,6 @@ unit cgobj;
inlined : boolean); inlined : boolean);
{$IFDEF NEWST}
procedure _copyvalueparas(s:Pparamsym);{$ifndef FPC}far;{$endif}
begin
cg^.g_copyvalueparas(_list,s);
end;
{$ENDIF NEWST}
(* (*
var var
hs : string; hs : string;
@ -765,11 +660,7 @@ unit cgobj;
list^.insert(new(pai_align,init(4))); list^.insert(new(pai_align,init(4)));
end; end;
{ save registers on cdecl } { save registers on cdecl }
{$IFDEF NEWST}
if (posavestdregs in aktprocdef^.options) then
{$ELSE}
if (po_savestdregs in aktprocsym^.definition^.procoptions) then if (po_savestdregs in aktprocsym^.definition^.procoptions) then
{$ENDIF NEWST}
begin begin
for r:=firstreg to lastreg do for r:=firstreg to lastreg do
begin begin
@ -791,39 +682,20 @@ unit cgobj;
begin begin
CGMessage(cg_d_stackframe_omited); CGMessage(cg_d_stackframe_omited);
nostackframe:=true; nostackframe:=true;
{$IFDEF NEWST}
if (aktprocdef^.proctype in [potype_unitinit,potype_proginit,potype_unitfinalize]) then
parasize:=0
else
parasize:=aktprocdef^.localst^.paramdatasize+procinfo^.para_offset-pointersize;
{$ELSE}
if (aktprocsym^.definition^.proctypeoption in [potype_unitinit,potype_proginit,potype_unitfinalize]) then if (aktprocsym^.definition^.proctypeoption in [potype_unitinit,potype_proginit,potype_unitfinalize]) then
parasize:=0 parasize:=0
else else
parasize:=aktprocsym^.definition^.parast^.datasize+procinfo^.para_offset-pointersize; parasize:=aktprocsym^.definition^.parast^.datasize+procinfo^.para_offset-pointersize;
{$ENDIF NEWST}
end end
else else
begin begin
{$IFDEF NEWST}
if (aktprocdef^.proctype in [potype_unitinit,potype_proginit,potype_unitfinalize]) then
parasize:=0
else
parasize:=aktprocdef^.localst^.paramdatasize+procinfo^.para_offset-pointersize*2;
{$ELSE}
if (aktprocsym^.definition^.proctypeoption in [potype_unitinit,potype_proginit,potype_unitfinalize]) then if (aktprocsym^.definition^.proctypeoption in [potype_unitinit,potype_proginit,potype_unitfinalize]) then
parasize:=0 parasize:=0
else else
parasize:=aktprocsym^.definition^.parast^.datasize+procinfo^.para_offset-pointersize*2; parasize:=aktprocsym^.definition^.parast^.datasize+procinfo^.para_offset-pointersize*2;
{$ENDIF}
nostackframe:=false; nostackframe:=false;
{$IFDEF NEWST}
if (pointerrupt in aktprocdef^.options) then
g_interrupt_stackframe_entry(list);
{$ELSE}
if (po_interrupt in aktprocsym^.definition^.procoptions) then if (po_interrupt in aktprocsym^.definition^.procoptions) then
g_interrupt_stackframe_entry(list); g_interrupt_stackframe_entry(list);
{$ENDIF NEWST}
g_stackframe_entry(list,stackframe); g_stackframe_entry(list,stackframe);
@ -834,11 +706,7 @@ unit cgobj;
if cs_profile in aktmoduleswitches then if cs_profile in aktmoduleswitches then
g_profilecode(@initcode); g_profilecode(@initcode);
{$IFDEF NEWST}
if (not inlined) and (aktprocdef^.proctype in [potype_unitinit]) then
{$ELSE}
if (not inlined) and (aktprocsym^.definition^.proctypeoption in [potype_unitinit]) then if (not inlined) and (aktprocsym^.definition^.proctypeoption in [potype_unitinit]) then
{$ENDIF NEWST}
begin begin
{ needs the target a console flags ? } { needs the target a console flags ? }
@ -889,18 +757,6 @@ unit cgobj;
list^.insert(new(pai_force_line,init)); list^.insert(new(pai_force_line,init));
{$endif GDB} {$endif GDB}
{$IFDEF NEWST}
{ initialize return value }
if assigned(procinfo^.retdef) and
is_ansistring(procinfo^.retdef) or
is_widestring(procinfo^.retdef) then
begin
reset_reference(hr);
hr.offset:=procinfo^.return_offset;
hr.base:=procinfo^.framepointer;
a_load_const_ref(list,OS_32,0,hr);
end;
{$ELSE}
{ initialize return value } { initialize return value }
if assigned(procinfo^.returntype.def) and if assigned(procinfo^.returntype.def) and
is_ansistring(procinfo^.returntype.def) or is_ansistring(procinfo^.returntype.def) or
@ -911,42 +767,21 @@ unit cgobj;
hr.base:=procinfo^.framepointer; hr.base:=procinfo^.framepointer;
a_load_const_ref(list,OS_32,0,hr); a_load_const_ref(list,OS_32,0,hr);
end; end;
{$ENDIF}
_list:=list; _list:=list;
{ generate copies of call by value parameters } { generate copies of call by value parameters }
{$IFDEF NEWST}
if (poassembler in aktprocdef^.options) then
aktprocdef^.parameters^.foreach(@_copyvalueparas);
{$ELSE}
if (po_assembler in aktprocsym^.definition^.procoptions) then if (po_assembler in aktprocsym^.definition^.procoptions) then
aktprocsym^.definition^.parast^.foreach({$ifdef FPC}@{$endif FPC}_copyvalueparas); aktprocsym^.definition^.parast^.foreach({$ifdef FPCPROCVAR}@{$endif}_copyvalueparas);
{$ENDIF NEWST}
{$IFDEF NEWST}
{ initialisizes local data } { initialisizes local data }
aktprocdef^.localst^.foreach({$ifdef FPC}@{$endif FPC}_initialize_local); aktprocsym^.definition^.localst^.foreach({$ifdef FPCPROCVAR}@{$endif}_initialize_data);
{$ELSE}
{ initialisizes local data }
aktprocsym^.definition^.localst^.foreach({$ifdef FPC}@{$endif FPC}_initialize_data);
{ add a reference to all call by value/const parameters } { add a reference to all call by value/const parameters }
aktprocsym^.definition^.parast^.foreach({$ifdef FPC}@{$endif FPC}_incr_data); aktprocsym^.definition^.parast^.foreach({$ifdef FPCPROCVAR}@{$endif}_incr_data);
{$ENDIF NEWST}
{$IFDEF NEWST}
if (cs_profile in aktmoduleswitches) or
(typeof(aktprocdef^.owner^)=typeof(Tglobalsymtable)) or
(typeof(aktprocdef^.owner^)=typeof(Timplsymtable)) or
(assigned(procinfo^._class) and
(typeof(procinfo^._class^.owner^)=typeof(Tglobalsymtable)) or
(typeof(procinfo^._class^.owner^)=typeof(Timplsymtable))) then
make_global:=true;
{$ELSE}
if (cs_profile in aktmoduleswitches) or if (cs_profile in aktmoduleswitches) or
(aktprocsym^.definition^.owner^.symtabletype=globalsymtable) or (aktprocsym^.definition^.owner^.symtabletype=globalsymtable) or
(assigned(procinfo^._class) and (procinfo^._class^.owner^.symtabletype=globalsymtable)) then (assigned(procinfo^._class) and (procinfo^._class^.owner^.symtabletype=globalsymtable)) then
make_global:=true; make_global:=true;
{$ENDIF NEWST}
if not inlined then if not inlined then
begin begin
hs:=proc_names.get; hs:=proc_names.get;
@ -1008,17 +843,9 @@ unit cgobj;
list^.insert(new(pai_label,init(aktexitlabel))); list^.insert(new(pai_label,init(aktexitlabel)));
{ call the destructor help procedure } { call the destructor help procedure }
{$IFDEF NEWST}
if (aktprocdef^.proctype=potype_destructor) then
{$ELSE}
if (aktprocsym^.definition^.proctypeoption=potype_destructor) then if (aktprocsym^.definition^.proctypeoption=potype_destructor) then
{$ENDIF}
begin begin
{$IFDEF NEWST}
if oo_is_class in procinfo^._class^.options then
{$ELSE NEWST}
if procinfo^._class^.is_class then if procinfo^._class^.is_class then
{$ENDIF}
a_call_name(list,'FPC_DISPOSE_CLASS',0) a_call_name(list,'FPC_DISPOSE_CLASS',0)
else else
begin begin
@ -1053,17 +880,11 @@ unit cgobj;
_list:=list; _list:=list;
{ finalize local data } { finalize local data }
{$IFDEF NEWST} aktprocsym^.definition^.localst^.foreach({$ifdef FPCPROCVAR}@{$endif}_finalize_data);
aktprocdef^.localst^.foreach({$ifndef TP}@{$endif}_finalize_data);
{$ELSE}
aktprocsym^.definition^.localst^.foreach({$ifndef TP}@{$endif}_finalize_data);
{$ENDIF}
{$IFNDEF NEWST}
{ finalize paras data } { finalize paras data }
if assigned(aktprocsym^.definition^.parast) then if assigned(aktprocsym^.definition^.parast) then
aktprocsym^.definition^.parast^.foreach({$ifndef TP}@{$endif}_finalize_data); aktprocsym^.definition^.parast^.foreach({$ifdef FPCPROCVAR}@{$endif}_finalize_data);
{$ENDIF NEWST}
{ do we need to handle exceptions because of ansi/widestrings ? } { do we need to handle exceptions because of ansi/widestrings ? }
if (procinfo^.flags and pi_needs_implicit_finally)<>0 then if (procinfo^.flags and pi_needs_implicit_finally)<>0 then
@ -1076,19 +897,6 @@ unit cgobj;
a_cmp_const_reg_label(list,OS_32,OC_EQ,0,accumulator,noreraiselabel); a_cmp_const_reg_label(list,OS_32,OC_EQ,0,accumulator,noreraiselabel);
a_reg_dealloc(list,accumulator); a_reg_dealloc(list,accumulator);
{$IFDEF NEWST}
{ must be the return value finalized before reraising the exception? }
if (procinfo^.retdef<>tdef(voiddef)) and
(procinfo^.retdef^.needs_inittable) and
((typeof(procinfo^.retdef^)<>typeof(Tobjectdef)) or
not(oo_is_class in pobjectdef(procinfo^.retdef)^.options)) then
begin
reset_reference(hr);
hr.offset:=procinfo^.return_offset;
hr.base:=procinfo^.framepointer;
g_finalize(list,procinfo^.retdef,hr,not (dp_ret_in_acc in procinfo^.retdef^.properties));
end;
{$ELSE}
{ must be the return value finalized before reraising the exception? } { must be the return value finalized before reraising the exception? }
if (procinfo^.returntype.def<>tdef(voiddef)) and if (procinfo^.returntype.def<>tdef(voiddef)) and
(procinfo^.returntype.def^.needs_inittable) and (procinfo^.returntype.def^.needs_inittable) and
@ -1100,29 +908,18 @@ unit cgobj;
hr.base:=procinfo^.framepointer; hr.base:=procinfo^.framepointer;
g_finalize(list,procinfo^.returntype.def,hr,ret_in_param(procinfo^.returntype.def)); g_finalize(list,procinfo^.returntype.def,hr,ret_in_param(procinfo^.returntype.def));
end; end;
{$ENDIF}
a_call_name(list,'FPC_RERAISE',0); a_call_name(list,'FPC_RERAISE',0);
a_label(list,noreraiselabel); a_label(list,noreraiselabel);
end; end;
{ call __EXIT for main program } { call __EXIT for main program }
{$IFDEF NEWST}
if (not DLLsource) and (not inlined) and (aktprocdef^.proctype=potype_proginit) then
a_call_name(list,'FPC_DO_EXIT',0);
{$ELSE}
if (not DLLsource) and (not inlined) and (aktprocsym^.definition^.proctypeoption=potype_proginit) then if (not DLLsource) and (not inlined) and (aktprocsym^.definition^.proctypeoption=potype_proginit) then
a_call_name(list,'FPC_DO_EXIT',0); a_call_name(list,'FPC_DO_EXIT',0);
{$ENDIF NEWST}
{ handle return value } { handle return value }
{$IFDEF NEWST}
if not(poassembler in aktprocdef^.options) then
if (aktprocdef^.proctype<>potype_constructor) then
{$ELSE}
if not(po_assembler in aktprocsym^.definition^.procoptions) then if not(po_assembler in aktprocsym^.definition^.procoptions) then
if (aktprocsym^.definition^.proctypeoption<>potype_constructor) then if (aktprocsym^.definition^.proctypeoption<>potype_constructor) then
{$ENDIF NEWST}
{ handle_return_value(inlined) } { handle_return_value(inlined) }
else else
begin begin
@ -1166,19 +963,11 @@ unit cgobj;
{ at last, the return is generated } { at last, the return is generated }
if not inlined then if not inlined then
{$IFDEF NEWST}
if pointerrupt in aktprocdef^.options then
{$ELSE}
if po_interrupt in aktprocsym^.definition^.procoptions then if po_interrupt in aktprocsym^.definition^.procoptions then
{$ENDIF NEWST}
g_interrupt_stackframe_exit(list) g_interrupt_stackframe_exit(list)
else else
g_return_from_proc(list,parasize); g_return_from_proc(list,parasize);
{$IFDEF NEWST}
list^.concat(new(pai_symbol_end,initname(aktprocdef^.mangledname)));
{$ELSE NEWST}
list^.concat(new(pai_symbol_end,initname(aktprocsym^.definition^.mangledname))); list^.concat(new(pai_symbol_end,initname(aktprocsym^.definition^.mangledname)));
{$ENDIF NEWST}
{$ifdef GDB} {$ifdef GDB}
if (cs_debuginfo in aktmoduleswitches) and not inlined then if (cs_debuginfo in aktmoduleswitches) and not inlined then
@ -1491,7 +1280,10 @@ finalization
end. end.
{ {
$Log$ $Log$
Revision 1.3 2001-09-30 16:17:17 jonas Revision 1.4 2001-09-30 21:26:42 peter
* removed obsolete newst defines
Revision 1.3 2001/09/30 16:17:17 jonas
* made most constant and mem handling processor independent * made most constant and mem handling processor independent
Revision 1.2 2001/09/28 20:39:32 jonas Revision 1.2 2001/09/28 20:39:32 jonas