Forráskód Böngészése

* revert wrong commits

git-svn-id: trunk@15762 -
pierre 15 éve
szülő
commit
874e69bcf8

+ 1 - 0
compiler/aasmtai.pas

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

+ 8 - 15
compiler/dbgdwarf.pas

@@ -209,8 +209,7 @@ interface
         { force the sym to be emitted as a local variable regardless of its
           type; used for "absolute" local variables referring to parameters.
         }
-        (dvf_force_local_var,
-         dvf_use_variable_parameter
+        (dvf_force_local_var
         );
       tdwarfvarsymflags = set of tdwarfvarsymflag;
 
@@ -308,7 +307,7 @@ interface
         procedure appendprocdef(list:TAsmList;def:tprocdef);override;
 
         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);
         { 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);
@@ -373,7 +372,6 @@ interface
         procedure appenddef_set(list:TAsmList;def: tsetdef); override;
         procedure appenddef_undefined(list:TAsmList;def:tundefineddef); override;
         procedure appenddef_variant(list:TAsmList;def:tvariantdef); override;
-        procedure appendsym_var(list:TAsmList;sym:tabstractnormalvarsym); override;
 
         function symname(sym:tsym): String; override;
       public
@@ -2311,11 +2309,11 @@ implementation
             { data continues below }
             DW_AT_location,DW_FORM_block1,blocksize
             ])
+{$ifdef gdb_supports_DW_AT_variable_parameter}
         else if (sym.typ=paravarsym) 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 is_open_string(sym.vardef) and
-            (dvf_use_variable_parameter in flags) then
+            not is_open_string(sym.vardef) then
           append_entry(tag,false,[
             DW_AT_name,DW_FORM_string,name+#0,
             DW_AT_variable_parameter,DW_FORM_flag,true,
@@ -2326,6 +2324,7 @@ implementation
             { data continues below }
             DW_AT_location,DW_FORM_block1,blocksize
             ])
+{$endif gdb_supports_DW_AT_variable_parameter}
         else
           append_entry(tag,false,[
             DW_AT_name,DW_FORM_string,name+#0,
@@ -2345,13 +2344,14 @@ implementation
           that).  }
         if (vo_is_self in sym.varoptions) then
           append_attribute(DW_AT_artificial,DW_FORM_flag,[true]);
-        if  not (dvf_use_variable_parameter in flags) and
-            (sym.typ=paravarsym) and
+{$ifndef gdb_supports_DW_AT_variable_parameter}
+        if (sym.typ=paravarsym) 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 is_open_string(sym.vardef) then
           append_labelentry_ref(DW_AT_type,def_dwarf_ref_lab(def))
         else
+{$endif not gdb_supports_DW_AT_variable_parameter}
           append_labelentry_ref(DW_AT_type,def_dwarf_lab(def));
 
         templist.free;
@@ -3944,13 +3944,6 @@ implementation
         finish_children; { struct }
       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;
       begin
         Result:=3;

+ 1 - 2
compiler/nflw.pas

@@ -1314,7 +1314,6 @@ implementation
       begin
         result:=nil;
         { optimize constant expressions }
-        firstpass(left);
         if (left.nodetype=ordconstn) then
           begin
              if tordconstnode(left).value.uvalue=1 then
@@ -1831,7 +1830,7 @@ implementation
 
         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);
 
         if assigned(left) then

+ 4 - 19
compiler/nutils.pas

@@ -46,7 +46,7 @@ interface
       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;
     staticforeachnodefunction = function(var n: tnode; arg: pointer): foreachnoderesult;
@@ -167,7 +167,7 @@ implementation
       result := false;
       if not assigned(n) then
         exit;
-      if (procmethod=pm_preprocess) then
+      if procmethod=pm_preprocess then
         result:=process_children(result);
       case f(n,arg) of
         fen_norecurse_false:
@@ -250,11 +250,7 @@ implementation
       result := false;
       if not assigned(n) then
         exit;
-      // simplify needs an extra previous call to
-      // 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
+      if procmethod=pm_preprocess then
         result:=process_children(result);
       case f(n,arg) of
         fen_norecurse_false:
@@ -945,15 +941,6 @@ implementation
         hn : tnode;
       begin
         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);
 
@@ -971,11 +958,9 @@ implementation
     { tries to simplify the given node calling the simplify method recursively }
     procedure dosimplify(var n : tnode);
       begin
-        // Optimize if code first
-
         repeat
           treechanged:=false;
-          foreachnodestatic(pm_simplify,n,@callsimplify,nil);
+          foreachnodestatic(pm_preprocess,n,@callsimplify,nil);
         until not(treechanged);
       end;
 

+ 4 - 4
compiler/optcse.pas

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

+ 0 - 2
compiler/pmodules.pas

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

+ 2 - 4
compiler/utils/gppc386.pp

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