r210518 - Improve diagnostic mapping terminology

Alp Toker alp at nuanti.com
Wed Jun 11 23:06:25 PDT 2014


On 12/06/2014 08:50, Justin Bogner wrote:
> Alp Toker <alp at nuanti.com> writes:
>> --- cfe/trunk/include/clang/Basic/DiagnosticIDs.h (original)
>> +++ cfe/trunk/include/clang/Basic/DiagnosticIDs.h Tue Jun 10 04:31:37 2014
>> @@ -60,28 +60,28 @@ namespace clang {
>>       /// (emit a warning), MAP_ERROR (emit as an error).  It allows clients to
>>       /// map errors to MAP_ERROR/MAP_DEFAULT or MAP_FATAL (stop emitting
>>       /// diagnostics after this one).
>> -    enum Mapping {
>> +    enum Severity {
>>         // NOTE: 0 means "uncomputed".
>> -      MAP_IGNORE  = 1,     ///< Map this diagnostic to nothing, ignore it.
>> -      MAP_REMARK  = 2,     ///< Map this diagnostic to a remark.
>> -      MAP_WARNING = 3,     ///< Map this diagnostic to a warning.
>> -      MAP_ERROR   = 4,     ///< Map this diagnostic to an error.
>> -      MAP_FATAL   = 5      ///< Map this diagnostic to a fatal error.
>> +      MAP_IGNORE = 1,  ///< Map this diagnostic to nothing, ignore it.
>> +      MAP_REMARK = 2,  ///< Map this diagnostic to a remark.
>> +      MAP_WARNING = 3, ///< Map this diagnostic to a warning.
>> +      MAP_ERROR = 4,   ///< Map this diagnostic to an error.
>> +      MAP_FATAL = 5    ///< Map this diagnostic to a fatal error.
>>       };
>>     }
> Seems a bit strange to have an enum called "Severity" with values tagged
> "MAP_", doesn't it?

Yes, it's a little strange. I didn't change them because there are 
out-of-tree users (clang-tools-extra at least) and it seems preferable 
to keep code compiling with a typedef for now while the diagnostic code 
gets cleaned up.

I'm hoping it'll be possible to reuse one of the several other 
diagnostic level enums in clang for mapping and get rid of this one 
completely.

Alp.

-- 
http://www.nuanti.com
the browser experts




More information about the cfe-commits mailing list