Browse Source

+ Statistics of warnings, hints and notes - (modified/fixed) patch from Naj Kejah, part of wishlist item 4897, plus hardcoded text moved to message file

git-svn-id: trunk@3181 -
Tomas Hajny 19 years ago
parent
commit
c17b57db07
6 changed files with 335 additions and 300 deletions
  1. 4 1
      compiler/comphook.pas
  2. 10 1
      compiler/compiler.pas
  3. 11 2
      compiler/msg/errore.msg
  4. 7 2
      compiler/msgidx.inc
  5. 293 291
      compiler/msgtxt.inc
  6. 10 3
      compiler/verbose.pas

+ 4 - 1
compiler/comphook.pas

@@ -77,7 +77,10 @@ type
     currentcolumn : longint;  { current line and column }
     currentcolumn : longint;  { current line and column }
   { Total Status }
   { Total Status }
     compiledlines : longint;  { the number of lines which are compiled }
     compiledlines : longint;  { the number of lines which are compiled }
-    errorcount    : longint;  { number of generated errors }
+    errorcount,
+    countWarnings,
+    countNotes,
+    countHints    : longint;  { number of found errors/warnings/notes/hints }
     codesize,
     codesize,
     datasize      : aint;
     datasize      : aint;
   { program info }
   { program info }

+ 10 - 1
compiler/compiler.pas

@@ -382,10 +382,19 @@ begin
             starttime:=starttime+3600.0*24.0;
             starttime:=starttime+3600.0*24.0;
           timestr:=tostr(trunc(starttime))+'.'+tostr(trunc(frac(starttime)*10));
           timestr:=tostr(trunc(starttime))+'.'+tostr(trunc(frac(starttime)*10));
           if status.codesize<>-1 then
           if status.codesize<>-1 then
-            linkstr:=', '+tostr(status.codesize)+' bytes code, '+tostr(status.datasize)+' bytes data'
+            linkstr:=', '+tostr(status.codesize)+' ' +strpas(MessagePChar(general_text_bytes_code))+', '+tostr(status.datasize)+' '+strpas(MessagePChar(general_text_bytes_data))
           else
           else
             linkstr:='';
             linkstr:='';
           Message3(general_i_abslines_compiled,tostr(status.compiledlines),timestr,linkstr);
           Message3(general_i_abslines_compiled,tostr(status.compiledlines),timestr,linkstr);
+          if (Status.Verbosity and V_Warning = V_Warning) and
+                                               (Status.CountWarnings <> 0) then
+           Message1 (general_i_number_of_warnings, tostr (Status.CountWarnings));
+          if (Status.Verbosity and V_Hint = V_Hint) and
+                                                  (Status.CountHints <> 0) then
+           Message1 (general_i_number_of_hints, tostr (Status.CountHints));
+          if (Status.Verbosity and V_Note = V_Note) and
+                                               (Status.CountNotes <> 0) then
+           Message1 (general_i_number_of_notes, tostr (Status.CountNotes));
         end;
         end;
      finally
      finally
        { no message possible after this !!    }
        { no message possible after this !!    }

+ 11 - 2
compiler/msg/errore.msg

@@ -45,8 +45,10 @@
 #
 #
 # General
 # General
 #
 #
-# 01016 is the last used one
+# 01023 is the last used one
 #
 #
+general_text_bytes_code=01019_bytes code
+general_text_bytes_data=01020_bytes data
 # BeginOfTeX
 # BeginOfTeX
 % \section{General compiler messages}
 % \section{General compiler messages}
 % This section gives the compiler messages which are not fatal, but which
 % This section gives the compiler messages which are not fatal, but which
@@ -79,7 +81,7 @@ general_t_objectpath=01007_T_Using object path: $1
 % When the \var{-vt} switch is used, this line tells you where the compiler
 % When the \var{-vt} switch is used, this line tells you where the compiler
 % looks for object files you link in (files used in \var{\{\$L xxx\}} statements).
 % looks for object files you link in (files used in \var{\{\$L xxx\}} statements).
 % You can set this path with the \var{-Fo} option.
 % You can set this path with the \var{-Fo} option.
-general_i_abslines_compiled=01008_I_$1 Lines compiled, $2 sec$3
+general_i_abslines_compiled=01008_I_$1 lines compiled, $2 sec$3
 % When the \var{-vi} switch is used, the compiler reports the number
 % When the \var{-vi} switch is used, the compiler reports the number
 % of lines compiled, and the time it took to compile them (real time,
 % of lines compiled, and the time it took to compile them (real time,
 % not program time).
 % not program time).
@@ -113,6 +115,13 @@ general_i_hint=01016_I_Hint:
 general_e_path_does_not_exist=01017_E_Path "$1" does not exist
 general_e_path_does_not_exist=01017_E_Path "$1" does not exist
 % The specified path does not exist.
 % The specified path does not exist.
 general_f_compilation_aborted=01018_F_Compilation aborted
 general_f_compilation_aborted=01018_F_Compilation aborted
+% Compilation was aborted.
+general_i_number_of_warnings=01021_I_$1 warning(s) issued
+% Total number of warnings issued during compilation.
+general_i_number_of_hints=01022_I_$1 hint(s) issued
+% Total number of hints issued during compilation.
+general_i_number_of_notes=01023_I_$1 note(s) issued
+% Total number of notes issued during compilation.
 % \end{description}
 % \end{description}
 #
 #
 # Scanner
 # Scanner

+ 7 - 2
compiler/msgidx.inc

@@ -1,4 +1,6 @@
 const
 const
+  general_text_bytes_code=01019;
+  general_text_bytes_data=01020;
   general_t_compilername=01000;
   general_t_compilername=01000;
   general_d_sourceos=01001;
   general_d_sourceos=01001;
   general_i_targetos=01002;
   general_i_targetos=01002;
@@ -18,6 +20,9 @@ const
   general_i_hint=01016;
   general_i_hint=01016;
   general_e_path_does_not_exist=01017;
   general_e_path_does_not_exist=01017;
   general_f_compilation_aborted=01018;
   general_f_compilation_aborted=01018;
+  general_i_number_of_warnings=01021;
+  general_i_number_of_hints=01022;
+  general_i_number_of_notes=01023;
   scan_f_end_of_file=02000;
   scan_f_end_of_file=02000;
   scan_f_string_exceeds_line=02001;
   scan_f_string_exceeds_line=02001;
   scan_f_illegal_char=02002;
   scan_f_illegal_char=02002;
@@ -673,9 +678,9 @@ const
   option_info=11024;
   option_info=11024;
   option_help_pages=11025;
   option_help_pages=11025;
 
 
-  MsgTxtSize = 39720;
+  MsgTxtSize = 39829;
 
 
   MsgIdxMax : array[1..20] of longint=(
   MsgIdxMax : array[1..20] of longint=(
-    19,75,219,60,62,47,100,22,135,60,
+    24,75,219,60,62,47,100,22,135,60,
     41,1,1,1,1,1,1,1,1,1
     41,1,1,1,1,1,1,1,1,1
   );
   );

File diff suppressed because it is too large
+ 293 - 291
compiler/msgtxt.inc


+ 10 - 3
compiler/verbose.pas

@@ -517,19 +517,25 @@ var
                   begin
                   begin
                     v:=v or V_Warning;
                     v:=v or V_Warning;
                     if status.errorwarning then
                     if status.errorwarning then
-                     inc(status.errorcount);
+                     inc(status.errorcount)
+                    else
+                     inc(status.countWarnings);
                   end;
                   end;
                 'N' :
                 'N' :
                   begin
                   begin
                     v:=v or V_Note;
                     v:=v or V_Note;
                     if status.errornote then
                     if status.errornote then
-                     inc(status.errorcount);
+                     inc(status.errorcount)
+                    else
+                     inc(status.countNotes);
                   end;
                   end;
                 'H' :
                 'H' :
                   begin
                   begin
                     v:=v or V_Hint;
                     v:=v or V_Hint;
                     if status.errorhint then
                     if status.errorhint then
-                     inc(status.errorcount);
+                     inc(status.errorcount)
+                    else
+                     inc(status.countHints);
                   end;
                   end;
                 'I' :
                 'I' :
                   v:=v or V_Info;
                   v:=v or V_Info;
@@ -830,3 +836,4 @@ finalization
   { Be sure to close the redirect files to flush all data }
   { Be sure to close the redirect files to flush all data }
   DoneRedirectFile;
   DoneRedirectFile;
 end.
 end.
+

Some files were not shown because too many files changed in this diff