[cfe-dev] Need help designing a new diagnostic formatting command line option for use with x86_64-pc-win32
Douglas Gregor
dgregor at apple.com
Wed May 18 13:40:35 PDT 2011
On May 18, 2011, at 1:32 PM, Andrew Fish wrote:
>>>
>>> I implemented for msvc and vi variants, here are the changes in TextDiagnosticPrinter.cpp for TextDiagnosticPrinter::HandleDiagnostic()
>>>
>>> if (DiagOpts->Format == 1)
>>> // msvc parsable format
>>> OS << PLoc.getFilename() << '(' << LineNo << ") : ";
>>> else if (DiagOpts->Format == 2)
>>> // vi command line format
>>> OS << PLoc.getFilename() << " +" << LineNo << ':';
>>> else
>>> // clang format
>>> OS << PLoc.getFilename() << ':' << LineNo << ':';
>>> if (DiagOpts->ShowColumn)
>>> if (unsigned ColNo = PLoc.getColumn())
>>> OS << ColNo << ':';
>>
>> I'd rather that DiagOpts->Format use an enumeration type, so this can be a switch() on the format. Otherwise, this looks fine.
>>
>
> I copied DiagnosticOptions ShowCategories and it did not implement an enum. I was trying to copy code as much as I could to follow the coding standards. What would a good name for the enum be?
TextDiagnosticFormat?
- Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110518/3f3584df/attachment.html>
More information about the cfe-dev
mailing list