thakis added inline comments.

================
Comment at: clang/lib/Basic/CLWarnings.cpp:17
+  switch (CLWarningID) {
+  case 4005: return "macro-redefined";
+  case 4018: return "sign-compare";
----------------
hans wrote:
> Would it be possible to reference the DiagGroup symbolically here somehow 
> instead of using a string? That way, if the DiagGroup gets renamed, we don't 
> risk forgetting to update this string.
As far as I can tell, diagnostic groups don't exist as enums. Options:

- Make this function return a diag:: that the number maps to, and then use 
`DiagnosticIDs::getWarningOptionForDiag()` to get that diag's group name and 
disable that. That should work, but it's a bit confusing since we'd return a 
single diag here (either of warn_deprecated, warn_property_method_deprecated, 
warn_atl_uuid_deprecated and several others would have the same effect of 
representing the group DeprecatedDeclarations) but then disable the whole group.

- Update clang-tblgen to emit something that can be used to create a DiagGroup 
enum and use that.

The latter sounds better to me, so I'll look into that.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110668/new/

https://reviews.llvm.org/D110668

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to