[cfe-commits] r100689 - in /cfe/trunk: docs/UsersManual.html include/clang/Driver/Options.td lib/Driver/Tools.cpp

Daniel Dunbar daniel at zuster.org
Wed Apr 7 19:31:20 PDT 2010


On Wed, Apr 7, 2010 at 1:49 PM, Chris Lattner <sabre at nondot.org> wrote:
> Author: lattner
> Date: Wed Apr  7 15:49:23 2010
> New Revision: 100689
>
> URL: http://llvm.org/viewvc/llvm-project?rev=100689&view=rev
> Log:
> add a new driver-level -ferror-limit=412 option, which causes clang to stop
> emitting diagnostics after it has produced that many errors.  Give this a
> default value of 20 which produces plenty of errors for people to fix before
> recompiling but not so many that their entire console scrolls away when the
> compiler gets confused.  The experience looks like this:
>
> $ clang foo.c
> <tons of crap>
> foo.c:102:3: error: unknown type name 'somethingbad'
>  somethingbad x;
>  ^
> fatal error: too many errors emitted, stopping now
> 36 warnings and 20 errors generated.

Would it make sense for this to say something like
  36 warnings and 20 (of 33 total) errors generated.
?

 - Daniel

>
> Modified:
>    cfe/trunk/docs/UsersManual.html
>    cfe/trunk/include/clang/Driver/Options.td
>    cfe/trunk/lib/Driver/Tools.cpp
>
> Modified: cfe/trunk/docs/UsersManual.html
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/UsersManual.html?rev=100689&r1=100688&r2=100689&view=diff
> ==============================================================================
> --- cfe/trunk/docs/UsersManual.html (original)
> +++ cfe/trunk/docs/UsersManual.html Wed Apr  7 15:49:23 2010
> @@ -189,6 +189,10 @@
>  <p><b>-pedantic-errors</b>: Error on language extensions.</p>
>  <p><b>-Wsystem-headers</b>: Enable warnings from system headers.</p>
>
> +<p><b>-ferror-limit=123</b>: Stop emitting diagnostics after 123 errors have
> +   been produced.  The default is 20, and the error limit can be disabled with
> +   -ferror-limit=0.</p>
> +
>  <!-- ================================================= -->
>  <h4 id="cl_diag_formatting">Formatting of Diagnostics</h4>
>  <!-- ================================================= -->
>
> Modified: cfe/trunk/include/clang/Driver/Options.td
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=100689&r1=100688&r2=100689&view=diff
> ==============================================================================
> --- cfe/trunk/include/clang/Driver/Options.td (original)
> +++ cfe/trunk/include/clang/Driver/Options.td Wed Apr  7 15:49:23 2010
> @@ -356,6 +356,7 @@
>  def fstrict_aliasing : Flag<"-fstrict-aliasing">, Group<clang_ignored_f_Group>;
>  def fsyntax_only : Flag<"-fsyntax-only">, Flags<[DriverOption]>;
>  def ftabstop_EQ : Joined<"-ftabstop=">, Group<f_Group>;
> +def ferror_limit_EQ : Joined<"-ferror-limit=">, Group<f_Group>;
>  def ftemplate_depth_ : Joined<"-ftemplate-depth-">, Group<f_Group>;
>  def fterminated_vtables : Flag<"-fterminated-vtables">, Group<f_Group>;
>  def fthreadsafe_statics : Flag<"-fthreadsafe-statics">, Group<f_Group>;
>
> Modified: cfe/trunk/lib/Driver/Tools.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=100689&r1=100688&r2=100689&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Driver/Tools.cpp (original)
> +++ cfe/trunk/lib/Driver/Tools.cpp Wed Apr  7 15:49:23 2010
> @@ -1073,6 +1073,12 @@
>     CmdArgs.push_back(A->getValue(Args));
>   }
>
> +  CmdArgs.push_back("-ferror-limit");
> +  if (Arg *A = Args.getLastArg(options::OPT_ferror_limit_EQ))
> +    CmdArgs.push_back(A->getValue(Args));
> +  else
> +    CmdArgs.push_back("19");
> +
>   // Pass -fmessage-length=.
>   CmdArgs.push_back("-fmessage-length");
>   if (Arg *A = Args.getLastArg(options::OPT_fmessage_length_EQ)) {
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>




More information about the cfe-commits mailing list