* revert wrong commits

git-svn-id: trunk@15762 -
This commit is contained in:
pierre 2010-08-10 11:33:38 +00:00
parent d27278faac
commit 874e69bcf8
7 changed files with 20 additions and 46 deletions

View File

@ -388,6 +388,7 @@ interface
destructor Destroy;override; destructor Destroy;override;
constructor ppuload(t:taitype;ppufile:tcompilerppufile);override; constructor ppuload(t:taitype;ppufile:tcompilerppufile);override;
procedure ppuwrite(ppufile:tcompilerppufile);override; procedure ppuwrite(ppufile:tcompilerppufile);override;
private
{ sections should be created via new_section() } { sections should be created via new_section() }
constructor Create(Asectype:TAsmSectiontype;Aname:string;Aalign:byte;Asecorder:TasmSectionorder=secorder_default); constructor Create(Asectype:TAsmSectiontype;Aname:string;Aalign:byte;Asecorder:TasmSectionorder=secorder_default);
end; end;

View File

@ -209,8 +209,7 @@ interface
{ force the sym to be emitted as a local variable regardless of its { force the sym to be emitted as a local variable regardless of its
type; used for "absolute" local variables referring to parameters. type; used for "absolute" local variables referring to parameters.
} }
(dvf_force_local_var, (dvf_force_local_var
dvf_use_variable_parameter
); );
tdwarfvarsymflags = set of tdwarfvarsymflag; tdwarfvarsymflags = set of tdwarfvarsymflag;
@ -308,7 +307,7 @@ interface
procedure appendprocdef(list:TAsmList;def:tprocdef);override; procedure appendprocdef(list:TAsmList;def:tprocdef);override;
function get_symlist_sym_offset(symlist: ppropaccesslistitem; out sym: tabstractvarsym; out offset: pint): boolean; function get_symlist_sym_offset(symlist: ppropaccesslistitem; out sym: tabstractvarsym; out offset: pint): boolean;
procedure appendsym_var(list:TAsmList;sym:tabstractnormalvarsym); virtual; procedure appendsym_var(list:TAsmList;sym:tabstractnormalvarsym);
procedure appendsym_var_with_name_type_offset(list:TAsmList; sym:tabstractnormalvarsym; const name: string; def: tdef; offset: pint; const flags: tdwarfvarsymflags); procedure appendsym_var_with_name_type_offset(list:TAsmList; sym:tabstractnormalvarsym; const name: string; def: tdef; offset: pint; const flags: tdwarfvarsymflags);
{ used for fields and properties mapped to fields } { used for fields and properties mapped to fields }
procedure appendsym_fieldvar_with_name_offset(list:TAsmList;sym: tfieldvarsym;const name: string; def: tdef; offset: pint); procedure appendsym_fieldvar_with_name_offset(list:TAsmList;sym: tfieldvarsym;const name: string; def: tdef; offset: pint);
@ -373,7 +372,6 @@ interface
procedure appenddef_set(list:TAsmList;def: tsetdef); override; procedure appenddef_set(list:TAsmList;def: tsetdef); override;
procedure appenddef_undefined(list:TAsmList;def:tundefineddef); override; procedure appenddef_undefined(list:TAsmList;def:tundefineddef); override;
procedure appenddef_variant(list:TAsmList;def:tvariantdef); override; procedure appenddef_variant(list:TAsmList;def:tvariantdef); override;
procedure appendsym_var(list:TAsmList;sym:tabstractnormalvarsym); override;
function symname(sym:tsym): String; override; function symname(sym:tsym): String; override;
public public
@ -2311,11 +2309,11 @@ implementation
{ data continues below } { data continues below }
DW_AT_location,DW_FORM_block1,blocksize DW_AT_location,DW_FORM_block1,blocksize
]) ])
{$ifdef gdb_supports_DW_AT_variable_parameter}
else if (sym.typ=paravarsym) and else if (sym.typ=paravarsym) and
paramanager.push_addr_param(sym.varspez,sym.vardef,tprocdef(sym.owner.defowner).proccalloption) and paramanager.push_addr_param(sym.varspez,sym.vardef,tprocdef(sym.owner.defowner).proccalloption) and
not(vo_has_local_copy in sym.varoptions) and not(vo_has_local_copy in sym.varoptions) and
not is_open_string(sym.vardef) and not is_open_string(sym.vardef) then
(dvf_use_variable_parameter in flags) then
append_entry(tag,false,[ append_entry(tag,false,[
DW_AT_name,DW_FORM_string,name+#0, DW_AT_name,DW_FORM_string,name+#0,
DW_AT_variable_parameter,DW_FORM_flag,true, DW_AT_variable_parameter,DW_FORM_flag,true,
@ -2326,6 +2324,7 @@ implementation
{ data continues below } { data continues below }
DW_AT_location,DW_FORM_block1,blocksize DW_AT_location,DW_FORM_block1,blocksize
]) ])
{$endif gdb_supports_DW_AT_variable_parameter}
else else
append_entry(tag,false,[ append_entry(tag,false,[
DW_AT_name,DW_FORM_string,name+#0, DW_AT_name,DW_FORM_string,name+#0,
@ -2345,13 +2344,14 @@ implementation
that). } that). }
if (vo_is_self in sym.varoptions) then if (vo_is_self in sym.varoptions) then
append_attribute(DW_AT_artificial,DW_FORM_flag,[true]); append_attribute(DW_AT_artificial,DW_FORM_flag,[true]);
if not (dvf_use_variable_parameter in flags) and {$ifndef gdb_supports_DW_AT_variable_parameter}
(sym.typ=paravarsym) and if (sym.typ=paravarsym) and
paramanager.push_addr_param(sym.varspez,sym.vardef,tprocdef(sym.owner.defowner).proccalloption) and paramanager.push_addr_param(sym.varspez,sym.vardef,tprocdef(sym.owner.defowner).proccalloption) and
not(vo_has_local_copy in sym.varoptions) and not(vo_has_local_copy in sym.varoptions) and
not is_open_string(sym.vardef) then not is_open_string(sym.vardef) then
append_labelentry_ref(DW_AT_type,def_dwarf_ref_lab(def)) append_labelentry_ref(DW_AT_type,def_dwarf_ref_lab(def))
else else
{$endif not gdb_supports_DW_AT_variable_parameter}
append_labelentry_ref(DW_AT_type,def_dwarf_lab(def)); append_labelentry_ref(DW_AT_type,def_dwarf_lab(def));
templist.free; templist.free;
@ -3944,13 +3944,6 @@ implementation
finish_children; { struct } finish_children; { struct }
end; end;
procedure TDebugInfoDwarf3.appendsym_var(list:TAsmList;sym:tabstractnormalvarsym);
begin
appendsym_var_with_name_type_offset(list,sym,symname(sym),
sym.vardef,0,[dvf_use_variable_parameter]);
end;
function TDebugInfoDwarf3.dwarf_version: Word; function TDebugInfoDwarf3.dwarf_version: Word;
begin begin
Result:=3; Result:=3;

View File

@ -1314,7 +1314,6 @@ implementation
begin begin
result:=nil; result:=nil;
{ optimize constant expressions } { optimize constant expressions }
firstpass(left);
if (left.nodetype=ordconstn) then if (left.nodetype=ordconstn) then
begin begin
if tordconstnode(left).value.uvalue=1 then if tordconstnode(left).value.uvalue=1 then
@ -1831,7 +1830,7 @@ implementation
include(current_procinfo.flags,pi_has_label); include(current_procinfo.flags,pi_has_label);
if assigned(labsym) and labsym.nonlocal then if assigned(labsym) and labsym.nonlocal then
include(current_procinfo.flags,pi_has_interproclabel); include(current_procinfo.flags,pi_has_interproclabel);
if assigned(left) then if assigned(left) then

View File

@ -46,7 +46,7 @@ interface
fen_norecurse_true fen_norecurse_true
); );
tforeachprocmethod = (pm_preprocess,pm_postprocess,pm_simplify); tforeachprocmethod = (pm_preprocess,pm_postprocess);
foreachnodefunction = function(var n: tnode; arg: pointer): foreachnoderesult of object; foreachnodefunction = function(var n: tnode; arg: pointer): foreachnoderesult of object;
staticforeachnodefunction = function(var n: tnode; arg: pointer): foreachnoderesult; staticforeachnodefunction = function(var n: tnode; arg: pointer): foreachnoderesult;
@ -167,7 +167,7 @@ implementation
result := false; result := false;
if not assigned(n) then if not assigned(n) then
exit; exit;
if (procmethod=pm_preprocess) then if procmethod=pm_preprocess then
result:=process_children(result); result:=process_children(result);
case f(n,arg) of case f(n,arg) of
fen_norecurse_false: fen_norecurse_false:
@ -250,11 +250,7 @@ implementation
result := false; result := false;
if not assigned(n) then if not assigned(n) then
exit; exit;
// simplify needs an extra previous call to if procmethod=pm_preprocess then
// allow for cutting some branches of loop type nodes
if procmethod=pm_simplify then
f(n,pointer(puint(pm_simplify)));
if (procmethod=pm_preprocess) or (procmethod=pm_simplify) then
result:=process_children(result); result:=process_children(result);
case f(n,arg) of case f(n,arg) of
fen_norecurse_false: fen_norecurse_false:
@ -945,15 +941,6 @@ implementation
hn : tnode; hn : tnode;
begin begin
result:=fen_false; result:=fen_false;
if arg = pointer(puint(pm_simplify)) then
begin
if n.inheritsfrom (tloopnode) then
begin
dosimplify (tloopnode(n).left);
callsimplify (n, nil);
end;
exit;
end;
// do_typecheckpass(n); // do_typecheckpass(n);
@ -971,11 +958,9 @@ implementation
{ tries to simplify the given node calling the simplify method recursively } { tries to simplify the given node calling the simplify method recursively }
procedure dosimplify(var n : tnode); procedure dosimplify(var n : tnode);
begin begin
// Optimize if code first
repeat repeat
treechanged:=false; treechanged:=false;
foreachnodestatic(pm_simplify,n,@callsimplify,nil); foreachnodestatic(pm_preprocess,n,@callsimplify,nil);
until not(treechanged); until not(treechanged);
end; end;

View File

@ -165,7 +165,7 @@ unit optcse;
if tnode(plists(arg)^.nodelist[i]).isequal(n) and DFASetIn(plists(arg)^.avail,i) then if tnode(plists(arg)^.nodelist[i]).isequal(n) and DFASetIn(plists(arg)^.avail,i) then
begin begin
{ use always the first occurence } { use always the first occurence }
if plists(arg)^.equalto[i]<>pointer(-1) then if ptrint(plists(arg)^.equalto[i])<>-1 then
plists(arg)^.equalto[plists(arg)^.nodelist.count-1]:=plists(arg)^.equalto[i] plists(arg)^.equalto[plists(arg)^.nodelist.count-1]:=plists(arg)^.equalto[i]
else else
plists(arg)^.equalto[plists(arg)^.nodelist.count-1]:=pointer(i); plists(arg)^.equalto[plists(arg)^.nodelist.count-1]:=pointer(i);
@ -231,7 +231,7 @@ unit optcse;
for i:=0 to lists.nodelist.count-1 do for i:=0 to lists.nodelist.count-1 do
begin begin
{ current node used more than once? } { current node used more than once? }
if assigned(lists.refs[i]) then if ptrint(lists.refs[i])<>0 then
begin begin
if not(assigned(statements)) then if not(assigned(statements)) then
begin begin
@ -263,7 +263,7 @@ unit optcse;
{$endif csedebug} {$endif csedebug}
end end
{ current node reference to another node? } { current node reference to another node? }
else if lists.equalto[i]<>pointer(-1) then else if ptrint(lists.equalto[i])<>-1 then
begin begin
{$if defined(csedebug) or defined(csestats)} {$if defined(csedebug) or defined(csestats)}
printnode(output,tnode(lists.nodelist[i])); printnode(output,tnode(lists.nodelist[i]));
@ -281,7 +281,7 @@ unit optcse;
end; end;
{ clean up unused trees } { clean up unused trees }
for i:=0 to lists.nodelist.count-1 do for i:=0 to lists.nodelist.count-1 do
if lists.equalto[i]<>pointer(-1) then if ptrint(lists.equalto[i])<>-1 then
tnode(lists.nodelist[i]).free; tnode(lists.nodelist[i]).free;
{$ifdef csedebug} {$ifdef csedebug}
writeln('nodes: ',lists.nodelist.count); writeln('nodes: ',lists.nodelist.count);

View File

@ -1225,8 +1225,6 @@ implementation
{ avoid unnecessary warnings } { avoid unnecessary warnings }
gotvarsym.varstate:=vs_read; gotvarsym.varstate:=vs_read;
gotvarsym.refs:=1; gotvarsym.refs:=1;
{ _GLOBAL_OFFSET_TABLE_ is in libc }
current_module.linkOtherSharedLibs.add('c',link_always);
end; end;
{$endif i386} {$endif i386}

View File

@ -44,12 +44,10 @@ const
GDBExeName = 'gdbpas'; GDBExeName = 'gdbpas';
GDBIniName = '.gdbinit'; GDBIniName = '.gdbinit';
DefaultCompilerName = 'ppc386'; DefaultCompilerName = 'ppc386';
PathSep=':';
{$else} {$else}
GDBExeName = 'gdbpas.exe'; GDBExeName = 'gdbpas.exe';
GDBIniName = 'gdb.ini'; GDBIniName = 'gdb.ini';
DefaultCompilerName = 'ppc386.exe'; DefaultCompilerName = 'ppc386.exe';
PathSep=';';
{$endif not linux} {$endif not linux}
{ If you add a gdb.fpc file in a given directory } { If you add a gdb.fpc file in a given directory }
@ -74,7 +72,7 @@ begin
{ support for info functions directly : used in makefiles } { support for info functions directly : used in makefiles }
if (paramcount=1) and (pos('-i',Paramstr(1))=1) then if (paramcount=1) and (pos('-i',Paramstr(1))=1) then
begin begin
Exec(fsearch(CompilerName,Dir+PathSep+GetEnv('PATH')),Paramstr(1)); Exec(fsearch(CompilerName,GetEnv('PATH')),Paramstr(1));
exit; exit;
end; end;
@ -116,7 +114,7 @@ begin
Writeln(fpcgdbini,'end'); Writeln(fpcgdbini,'end');
Close(fpcgdbini); Close(fpcgdbini);
Exec(fsearch(GDBExeName,Dir+PathSep+GetEnv('PATH')), Exec(fsearch(GDBExeName,GetEnv('PATH')),
{$ifdef win32} {$ifdef win32}
'--nw '+ '--nw '+
{$endif win32} {$endif win32}