On 02/03/2012 02:49 AM, Chad Rosier wrote:
> Author: mcrosier
> Date: Thu Feb  2 19:49:51 2012
> New Revision: 149662
>
> URL: http://llvm.org/viewvc/llvm-project?rev=149662&view=rev
> Log:
> [frontend] Don't allow a mapping to a warning override an error/fatal mapping.

[...]

> Modified: cfe/trunk/lib/Basic/Diagnostic.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Diagnostic.cpp?rev=149662&r1=149661&r2=149662&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Basic/Diagnostic.cpp (original)
> +++ cfe/trunk/lib/Basic/Diagnostic.cpp Thu Feb  2 19:49:51 2012
> @@ -172,6 +172,13 @@
>
>     FullSourceLoc Loc(L, *SourceMgr);
>     FullSourceLoc LastStateChangePos = DiagStatePoints.back().Loc;
> +  // Don't allow a mapping to a warning override an error/fatal mapping.
> +  if (Map == diag::MAP_WARNING) {
> +    DiagnosticMappingInfo&Info = 
> GetCurDiagState()->getOrAddMappingInfo(Diag);
> +    if (Info.getMapping() == diag::MAP_ERROR ||
> +        Info.getMapping() == diag::MAP_FATAL)
> +      Map = Info.getMapping();
> +  }
>     DiagnosticMappingInfo MappingInfo = makeMappingInfo(Map, L);


Why this change?

There are warnings that are mapped by default to errors.
After this change, clients no longer have the option of mapping them 
back to warnings, which is obviously wrong.

Please revert this portion of your commit.

Enea.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to