[clang] [clang-tools-extra] [clang] Extend diagnose_if to accept more detailed warning information (PR #70976)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 11 08:21:58 PDT 2024


================
@@ -269,11 +268,60 @@ CATEGORY(INSTALLAPI, REFACTORING)
   return Found;
 }
 
-DiagnosticMapping DiagnosticIDs::getDefaultMapping(unsigned DiagID) {
+//===----------------------------------------------------------------------===//
+// Custom Diagnostic information
+//===----------------------------------------------------------------------===//
+
+namespace clang {
+namespace diag {
+using CustomDiagDesc = DiagnosticIDs::CustomDiagDesc;
+class CustomDiagInfo {
+  std::vector<CustomDiagDesc> DiagInfo;
+  std::map<CustomDiagDesc, unsigned> DiagIDs;
+  std::map<diag::Group, std::vector<unsigned>> GroupToDiags;
----------------
AaronBallman wrote:

Should these be using LLVM ADTs instead for better performance? Specifically, `SmallVector`, `[Small]DenseMap`, and `MapVector`?

https://github.com/llvm/llvm-project/pull/70976


More information about the cfe-commits mailing list