[cfe-dev] Notes in Clang diagnostics and LLVM DiagnosticInfo

Quentin Colombet qcolombet at apple.com
Mon Feb 24 10:20:11 PST 2014


Hi Tobias,

Thanks for looking into this.

On Feb 23, 2014, at 1:21 AM, Tobias Grosser <tobias at grosser.es> wrote:

> On 02/23/2014 10:08 AM, tsett wrote:
>> Hi Tobias,
>> I got the problem.
>> I use the DiagnostigBuilder::setForceEmit() for this.
>> An instance of DiagnostigBuilder will be returned if you use the
>> report-function.
> 
> Good point. The following patch makes my messages appear again:
> 
> --- a/lib/CodeGen/CodeGenAction.cpp
> +++ b/lib/CodeGen/CodeGenAction.cpp
> @@ -384,7 +384,9 @@ void BackendConsumer::DiagnosticHandlerImpl(const DiagnosticInfo &DI) {
> 
>   // Report the backend message using the usual diagnostic mechanism.
>   FullSourceLoc Loc;
> -  Diags.Report(Loc, DiagID).AddString(MsgStorage);
> +  DiagnosticBuilder DB = Diags.Report(Loc, DiagID);
> +  DB.setForceEmit();
> +  DB.AddString(MsgStorage);
> 
> We could use this to either force printing of all backend diagnostics or only the notes. However, I am afraid that would break existing flags to suppress diagnostics.
Would it be hard to check what is the actual behavior?
That would indeed be unfortunate!

-Quentin

> 
> Another option is to only set this for plugin diagnostics. However, this would not solve the problem for the vectorizers which may need similar reporting capabilities.
> 
> Tobias
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list