[PATCH] Add warning capabilities in LLVM (backend part)

Quentin Colombet qcolombet at apple.com
Mon Nov 18 10:24:50 PST 2013


On Nov 15, 2013, at 6:48 PM, Dmitri Gribenko <gribozavr at gmail.com> wrote:

> On Fri, Nov 15, 2013 at 6:44 PM, Alp Toker <alp at nuanti.com> wrote:
>> 
>> On 16/11/2013 02:26, Dmitri Gribenko wrote:
>>> 
>>> On Fri, Nov 15, 2013 at 5:51 PM, Quentin Colombet <qcolombet at apple.com>
>>> wrote:
>>>> 
>>>> Finally the reporting API would be:
>>>> void LLVMContext::report(DiagnosticInfo *, Kind, Severity)
>>>> The default message would be given by toStr().
>>> 
>>> I doubt that Clang will be using this API.
>> 
>> My understanding is that the proposed LLVMContext::report() function is for
>> LLVM to use. clang would then consume the results of these LLVM diagnostics
>> via a callback, potentially converting them into clang diagnostics through
>> the usual mechanism.
Yes, that’s exactly that :).

> 
> Ah, I see.  I thought that this was the default reporting API that the
> fronted can use to just dump the diagnostic to stdout.  Sorry for
> misunderstanding.
No worries.

> 
> I would request to call it diag() for consistency with Clang, then.
> Or diagnose() if you don't like abbreviations.  To me, report() sounds
> like reporting a message to the user.
Well, that is one of the goal of the approach in case a front-end is not available.
Anyway, I am fine with the renaming. You are the second one asking for it, Alp was the first one :).

Cheers,
Quentin

> 
> Dmitri
> 
> -- 
> main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
> (j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/





More information about the llvm-commits mailing list