[LLVMdev] [RFC] Add warning capabilities in LLVM.
David Blaikie
dblaikie at gmail.com
Thu Jul 25 18:04:07 PDT 2013
On Thu, Jul 25, 2013 at 5:57 PM, Chris Lattner <clattner at apple.com> wrote:
>
> On Jul 25, 2013, at 5:09 PM, Quentin Colombet <qcolombet at apple.com> wrote:
>
>> Hi,
>>
>> I think we have a consensus on how we should report diagnostics now.
>> For broader uses, the discussion is still open.
>>
>> To move forward on the diagnostic part, here is the plan:
>> - Extend the current handler with a prototype like:
>> void report(enum Kind, enum Classification, const char* msg)
>> where
>> - Kind is the kind of report: InlineAsm, StackSize, Other.
>> - Classification is Error, Warning.
>> - msg contains the fall back message to print in case the front-end do not know what to do with the report.
>>
>> How does this sound?
>
> Sounds like the right direction, how about extending it a bit more to be:
>
>
>> void report(enum Kind, StringRef StringData, enum Classification, StringRef msg)
>
> The idea is that "StringData+Kind" can be used to format something nice in clang, but that "msg" fully covers it for clients that don't know the Kind enum.
Presumably there are diagnostics that are going to have more than one
parameter, though. ArrayRef<StringRef>? (though this doesn't scale to
providing fancy things like DIVariable parameters, that would possibly
allow Clang to lookup the variable (or function, etc) & print out
cursors, etc)
More information about the llvm-dev
mailing list