فهرست منبع

+ added is_addr field for labels, if they are only used for getting the address
(e.g. for io checks) and corresponding getaddrlabel() procedure

Jonas Maebe 25 سال پیش
والد
کامیت
67ac676004
8فایلهای تغییر یافته به همراه70 افزوده شده و 19 حذف شده
  1. 24 2
      compiler/aasm.pas
  2. 8 4
      compiler/cg386cal.pas
  3. 6 2
      compiler/cg386flw.pas
  4. 6 2
      compiler/cg386inl.pas
  5. 7 3
      compiler/cg386mem.pas
  6. 6 2
      compiler/cgai386.pas
  7. 6 1
      compiler/pass_2.pas
  8. 7 3
      compiler/t_win32.pas

+ 24 - 2
compiler/aasm.pas

@@ -122,9 +122,13 @@ unit aasm;
        tasmlabel = object(tasmsymbol)
        tasmlabel = object(tasmsymbol)
          labelnr : longint;
          labelnr : longint;
          { this is set by the pai_label.init }
          { this is set by the pai_label.init }
-         is_set  : boolean;
+         is_set,
+         { is the label only there for getting an address (e.g. for i/o }
+         { checks -> true) or is it a jump target (false)               }
+         is_addr : boolean;
          constructor init;
          constructor init;
          constructor initdata;
          constructor initdata;
+         constructor initaddr;
          function name:string;virtual;
          function name:string;virtual;
        end;
        end;
 
 
@@ -361,6 +365,8 @@ type
 
 
     { make l as a new label }
     { make l as a new label }
     procedure getlabel(var l : pasmlabel);
     procedure getlabel(var l : pasmlabel);
+    { make l as a new label and flag is_addr }
+    procedure getaddrlabel(var l : pasmlabel);
     { make l as a new label and flag is_data }
     { make l as a new label and flag is_data }
     procedure getdatalabel(var l : pasmlabel);
     procedure getdatalabel(var l : pasmlabel);
     {just get a label number }
     {just get a label number }
@@ -928,6 +934,7 @@ uses
         inherited init(target_asm.labelprefix+tostr(labelnr),AB_LOCAL,AT_FUNCTION);
         inherited init(target_asm.labelprefix+tostr(labelnr),AB_LOCAL,AT_FUNCTION);
         proclocal:=true;
         proclocal:=true;
         is_set:=false;
         is_set:=false;
+        is_addr := false;
       end;
       end;
 
 
 
 
@@ -940,10 +947,16 @@ uses
         else
         else
           inherited init(target_asm.labelprefix+tostr(labelnr),AB_LOCAL,AT_DATA);
           inherited init(target_asm.labelprefix+tostr(labelnr),AB_LOCAL,AT_DATA);
         is_set:=false;
         is_set:=false;
+        is_addr := false;
         { write it always }
         { write it always }
         refs:=1;
         refs:=1;
       end;
       end;
 
 
+    constructor tasmlabel.initaddr;
+      begin;
+        init;
+        is_addr := true;
+      end;
 
 
     function tasmlabel.name:string;
     function tasmlabel.name:string;
       begin
       begin
@@ -1058,6 +1071,11 @@ uses
         asmsymbollist^.insert(l);
         asmsymbollist^.insert(l);
       end;
       end;
 
 
+    procedure getaddrlabel(var l : pasmlabel);
+      begin
+        l:=new(pasmlabel,initaddr);
+        asmsymbollist^.insert(l);
+      end;
 
 
     procedure RegenerateLabel(var l : pasmlabel);
     procedure RegenerateLabel(var l : pasmlabel);
       begin
       begin
@@ -1090,7 +1108,11 @@ uses
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.3  2000-07-13 12:08:24  michael
+  Revision 1.4  2000-07-21 15:14:01  jonas
+    + added is_addr field for labels, if they are only used for getting the address
+       (e.g. for io checks) and corresponding getaddrlabel() procedure
+
+  Revision 1.3  2000/07/13 12:08:24  michael
   + patched to 1.1.0 with former 1.09patch from peter
   + patched to 1.1.0 with former 1.09patch from peter
 
 
   Revision 1.2  2000/07/13 11:32:28  michael
   Revision 1.2  2000/07/13 11:32:28  michael

+ 8 - 4
compiler/cg386cal.pas

@@ -369,7 +369,7 @@ implementation
                  (po_iocheck in p^.procdefinition^.procoptions) and
                  (po_iocheck in p^.procdefinition^.procoptions) and
                  not(po_iocheck in aktprocsym^.definition^.procoptions) then
                  not(po_iocheck in aktprocsym^.definition^.procoptions) then
                 begin
                 begin
-                   getlabel(iolabel);
+                   getaddrlabel(iolabel);
                    emitlab(iolabel);
                    emitlab(iolabel);
                 end
                 end
               else
               else
@@ -1432,8 +1432,8 @@ implementation
 {$ifdef GDB}
 {$ifdef GDB}
           if (cs_debuginfo in aktmoduleswitches) then
           if (cs_debuginfo in aktmoduleswitches) then
             begin
             begin
-              getlabel(startlabel);
-              getlabel(endlabel);
+              getaddrlabel(startlabel);
+              getaddrlabel(endlabel);
               emitlab(startlabel);
               emitlab(startlabel);
               p^.inlineprocsym^.definition^.localst^.symtabletype:=inlinelocalsymtable;
               p^.inlineprocsym^.definition^.localst^.symtabletype:=inlinelocalsymtable;
               p^.inlineprocsym^.definition^.parast^.symtabletype:=inlineparasymtable;
               p^.inlineprocsym^.definition^.parast^.symtabletype:=inlineparasymtable;
@@ -1511,7 +1511,11 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.3  2000-07-13 12:08:24  michael
+  Revision 1.4  2000-07-21 15:14:01  jonas
+    + added is_addr field for labels, if they are only used for getting the address
+       (e.g. for io checks) and corresponding getaddrlabel() procedure
+
+  Revision 1.3  2000/07/13 12:08:24  michael
   + patched to 1.1.0 with former 1.09patch from peter
   + patched to 1.1.0 with former 1.09patch from peter
 
 
   Revision 1.2  2000/07/13 11:32:32  michael
   Revision 1.2  2000/07/13 11:32:32  michael

+ 6 - 2
compiler/cg386flw.pas

@@ -600,7 +600,7 @@ do_jmp:
                 end
                 end
               else
               else
                 begin
                 begin
-                   getlabel(a);
+                   getaddrlabel(a);
                    emitlab(a);
                    emitlab(a);
                    emit_const(A_PUSH,S_L,0);
                    emit_const(A_PUSH,S_L,0);
                    emit_sym(A_PUSH,S_L,a);
                    emit_sym(A_PUSH,S_L,a);
@@ -1234,7 +1234,11 @@ do_jmp:
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.2  2000-07-13 11:32:33  michael
+  Revision 1.3  2000-07-21 15:14:02  jonas
+    + added is_addr field for labels, if they are only used for getting the address
+       (e.g. for io checks) and corresponding getaddrlabel() procedure
+
+  Revision 1.2  2000/07/13 11:32:33  michael
   + removed logs
   + removed logs
 
 
 }
 }

+ 6 - 2
compiler/cg386inl.pas

@@ -231,7 +231,7 @@ implementation
            if (cs_check_io in aktlocalswitches) and
            if (cs_check_io in aktlocalswitches) and
               not(po_iocheck in aktprocsym^.definition^.procoptions) then
               not(po_iocheck in aktprocsym^.definition^.procoptions) then
              begin
              begin
-                getlabel(iolabel);
+                getaddrlabel(iolabel);
                 emitlab(iolabel);
                 emitlab(iolabel);
              end
              end
            else
            else
@@ -1528,7 +1528,11 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.2  2000-07-13 11:32:34  michael
+  Revision 1.3  2000-07-21 15:14:02  jonas
+    + added is_addr field for labels, if they are only used for getting the address
+       (e.g. for io checks) and corresponding getaddrlabel() procedure
+
+  Revision 1.2  2000/07/13 11:32:34  michael
   + removed logs
   + removed logs
 
 
 }
 }

+ 7 - 3
compiler/cg386mem.pas

@@ -894,8 +894,8 @@ implementation
                   if (cs_debuginfo in aktmoduleswitches) then
                   if (cs_debuginfo in aktmoduleswitches) then
                     begin
                     begin
                       inc(withlevel);
                       inc(withlevel);
-                      getlabel(withstartlabel);
-                      getlabel(withendlabel);
+                      getaddrlabel(withstartlabel);
+                      getaddrlabel(withendlabel);
                       emitlab(withstartlabel);
                       emitlab(withstartlabel);
                       withdebuglist^.concat(new(pai_stabs,init(strpnew(
                       withdebuglist^.concat(new(pai_stabs,init(strpnew(
                          '"with'+tostr(withlevel)+':'+tostr(symtablestack^.getnewtypecount)+
                          '"with'+tostr(withlevel)+':'+tostr(symtablestack^.getnewtypecount)+
@@ -951,7 +951,11 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.2  2000-07-13 11:32:35  michael
+  Revision 1.3  2000-07-21 15:14:02  jonas
+    + added is_addr field for labels, if they are only used for getting the address
+       (e.g. for io checks) and corresponding getaddrlabel() procedure
+
+  Revision 1.2  2000/07/13 11:32:35  michael
   + removed logs
   + removed logs
 
 
 }
 }

+ 6 - 2
compiler/cgai386.pas

@@ -2647,7 +2647,7 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
       case target_info.target of
       case target_info.target of
          target_i386_linux:
          target_i386_linux:
            begin
            begin
-              getlabel(pl);
+              getaddrlabel(pl);
               emitcall('mcount');
               emitcall('mcount');
               exprasmlist^.insert(new(paicpu,op_sym_ofs_reg(A_MOV,S_L,pl,0,R_EDX)));
               exprasmlist^.insert(new(paicpu,op_sym_ofs_reg(A_MOV,S_L,pl,0,R_EDX)));
               exprasmlist^.insert(new(pai_section,init(sec_code)));
               exprasmlist^.insert(new(pai_section,init(sec_code)));
@@ -3969,7 +3969,11 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.3  2000-07-13 12:08:25  michael
+  Revision 1.4  2000-07-21 15:14:02  jonas
+    + added is_addr field for labels, if they are only used for getting the address
+       (e.g. for io checks) and corresponding getaddrlabel() procedure
+
+  Revision 1.3  2000/07/13 12:08:25  michael
   + patched to 1.1.0 with former 1.09patch from peter
   + patched to 1.1.0 with former 1.09patch from peter
 
 
   Revision 1.2  2000/07/13 11:32:37  michael
   Revision 1.2  2000/07/13 11:32:37  michael

+ 6 - 1
compiler/pass_2.pas

@@ -593,6 +593,7 @@ implementation
                      with linux and windows
                      with linux and windows
                    }
                    }
                    (*
                    (*
+
                    if assigned(aktprocsym) then
                    if assigned(aktprocsym) then
                      begin
                      begin
                        if not(assigned(procinfo^._class)) and
                        if not(assigned(procinfo^._class)) and
@@ -844,7 +845,11 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.2  2000-07-13 11:32:44  michael
+  Revision 1.3  2000-07-21 15:14:02  jonas
+    + added is_addr field for labels, if they are only used for getting the address
+       (e.g. for io checks) and corresponding getaddrlabel() procedure
+
+  Revision 1.2  2000/07/13 11:32:44  michael
   + removed logs
   + removed logs
 
 
 }
 }

+ 7 - 3
compiler/t_win32.pas

@@ -182,8 +182,8 @@ unit t_win32;
            { Get labels for the sections }
            { Get labels for the sections }
              getdatalabel(lhead);
              getdatalabel(lhead);
              getdatalabel(lname);
              getdatalabel(lname);
-             getlabel(lidata4);
-             getlabel(lidata5);
+             getaddrlabel(lidata4);
+             getaddrlabel(lidata5);
            { create header for this importmodule }
            { create header for this importmodule }
              importssection^.concat(new(pai_cut,init_begin));
              importssection^.concat(new(pai_cut,init_begin));
              importssection^.concat(new(pai_section,init(sec_idata2)));
              importssection^.concat(new(pai_section,init(sec_idata2)));
@@ -1303,7 +1303,11 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.2  2000-07-13 11:32:50  michael
+  Revision 1.3  2000-07-21 15:14:02  jonas
+    + added is_addr field for labels, if they are only used for getting the address
+       (e.g. for io checks) and corresponding getaddrlabel() procedure
+
+  Revision 1.2  2000/07/13 11:32:50  michael
   + removed logs
   + removed logs
 
 
 }
 }