[cfe-dev] Need help designing a new diagnostic formatting command line option for use with x86_64-pc-win32

Andrew Fish afish at apple.com
Wed May 18 13:32:33 PDT 2011


>> 
>> 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?

Thanks,

Andrew

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110518/3fd9689f/attachment.html>


More information about the cfe-dev mailing list