Browse Source

+ 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 years ago
parent
commit
67ac676004

+ 24 - 2
compiler/aasm.pas

@@ -122,9 +122,13 @@ unit aasm;
        tasmlabel = object(tasmsymbol)
          labelnr : longint;
          { 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 initdata;
+         constructor initaddr;
          function name:string;virtual;
        end;
 
@@ -361,6 +365,8 @@ type
 
     { make l as a new label }
     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 }
     procedure getdatalabel(var l : pasmlabel);
     {just get a label number }
@@ -928,6 +934,7 @@ uses
         inherited init(target_asm.labelprefix+tostr(labelnr),AB_LOCAL,AT_FUNCTION);
         proclocal:=true;
         is_set:=false;
+        is_addr := false;
       end;
 
 
@@ -940,10 +947,16 @@ uses
         else
           inherited init(target_asm.labelprefix+tostr(labelnr),AB_LOCAL,AT_DATA);
         is_set:=false;
+        is_addr := false;
         { write it always }
         refs:=1;
       end;
 
+    constructor tasmlabel.initaddr;
+      begin;
+        init;
+        is_addr := true;
+      end;
 
     function tasmlabel.name:string;
       begin
@@ -1058,6 +1071,11 @@ uses
         asmsymbollist^.insert(l);
       end;
 
+    procedure getaddrlabel(var l : pasmlabel);
+      begin
+        l:=new(pasmlabel,initaddr);
+        asmsymbollist^.insert(l);
+      end;
 
     procedure RegenerateLabel(var l : pasmlabel);
       begin
@@ -1090,7 +1108,11 @@ uses
 end.
 {
   $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
 
   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
                  not(po_iocheck in aktprocsym^.definition^.procoptions) then
                 begin
-                   getlabel(iolabel);
+                   getaddrlabel(iolabel);
                    emitlab(iolabel);
                 end
               else
@@ -1432,8 +1432,8 @@ implementation
 {$ifdef GDB}
           if (cs_debuginfo in aktmoduleswitches) then
             begin
-              getlabel(startlabel);
-              getlabel(endlabel);
+              getaddrlabel(startlabel);
+              getaddrlabel(endlabel);
               emitlab(startlabel);
               p^.inlineprocsym^.definition^.localst^.symtabletype:=inlinelocalsymtable;
               p^.inlineprocsym^.definition^.parast^.symtabletype:=inlineparasymtable;
@@ -1511,7 +1511,11 @@ implementation
 end.
 {
   $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
 
   Revision 1.2  2000/07/13 11:32:32  michael

+ 6 - 2
compiler/cg386flw.pas

@@ -600,7 +600,7 @@ do_jmp:
                 end
               else
                 begin
-                   getlabel(a);
+                   getaddrlabel(a);
                    emitlab(a);
                    emit_const(A_PUSH,S_L,0);
                    emit_sym(A_PUSH,S_L,a);
@@ -1234,7 +1234,11 @@ do_jmp:
 end.
 {
   $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
 
 }

+ 6 - 2
compiler/cg386inl.pas

@@ -231,7 +231,7 @@ implementation
            if (cs_check_io in aktlocalswitches) and
               not(po_iocheck in aktprocsym^.definition^.procoptions) then
              begin
-                getlabel(iolabel);
+                getaddrlabel(iolabel);
                 emitlab(iolabel);
              end
            else
@@ -1528,7 +1528,11 @@ implementation
 end.
 {
   $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
 
 }

+ 7 - 3
compiler/cg386mem.pas

@@ -894,8 +894,8 @@ implementation
                   if (cs_debuginfo in aktmoduleswitches) then
                     begin
                       inc(withlevel);
-                      getlabel(withstartlabel);
-                      getlabel(withendlabel);
+                      getaddrlabel(withstartlabel);
+                      getaddrlabel(withendlabel);
                       emitlab(withstartlabel);
                       withdebuglist^.concat(new(pai_stabs,init(strpnew(
                          '"with'+tostr(withlevel)+':'+tostr(symtablestack^.getnewtypecount)+
@@ -951,7 +951,11 @@ implementation
 end.
 {
   $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
 
 }

+ 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
          target_i386_linux:
            begin
-              getlabel(pl);
+              getaddrlabel(pl);
               emitcall('mcount');
               exprasmlist^.insert(new(paicpu,op_sym_ofs_reg(A_MOV,S_L,pl,0,R_EDX)));
               exprasmlist^.insert(new(pai_section,init(sec_code)));
@@ -3969,7 +3969,11 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
 end.
 {
   $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
 
   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
                    }
                    (*
+
                    if assigned(aktprocsym) then
                      begin
                        if not(assigned(procinfo^._class)) and
@@ -844,7 +845,11 @@ implementation
 end.
 {
   $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
 
 }

+ 7 - 3
compiler/t_win32.pas

@@ -182,8 +182,8 @@ unit t_win32;
            { Get labels for the sections }
              getdatalabel(lhead);
              getdatalabel(lname);
-             getlabel(lidata4);
-             getlabel(lidata5);
+             getaddrlabel(lidata4);
+             getaddrlabel(lidata5);
            { create header for this importmodule }
              importssection^.concat(new(pai_cut,init_begin));
              importssection^.concat(new(pai_section,init(sec_idata2)));
@@ -1303,7 +1303,11 @@ end;
 end.
 {
   $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
 
 }