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

Also add a comment when a label has been optimized out when compiled DEBUG_LABEL

Pierre Muller 3 éve
szülő
commit
f27b55e9b2
1 módosított fájl, 4 hozzáadás és 2 törlés
  1. 4 2
      compiler/aggas.pas

+ 4 - 2
compiler/aggas.pas

@@ -1303,12 +1303,14 @@ implementation
 
            ait_label :
              begin
-               if (tai_label(hp).labsym.is_used) then
-                begin
 {$ifdef DEBUG_LABEL}
                   writer.AsmWrite(asminfo^.comment);
                   writer.AsmWriteLn('References = ' + tostr(tai_label(hp).labsym.getrefs));
+                  if tai_label(hp).labsym.getrefs=0 then
+                    writer.AsmWriteln(asminfo^.comment+'Optimized out label '+tai_label(hp).labsym.name);
 {$endif DEBUG_LABEL}
+               if (tai_label(hp).labsym.is_used) then
+                begin
                   if tai_label(hp).labsym.bind in [AB_GLOBAL,AB_PRIVATE_EXTERN] then
                    begin
                      if (tai_label(hp).labsym.bind=AB_PRIVATE_EXTERN) then