[clang] [clang-tools-extra] [clang] [diagnostics] Stable IDs for Clang diagnostics (PR #168153)
Balázs Benics via cfe-commits
cfe-commits at lists.llvm.org
Mon Dec 15 05:08:10 PST 2025
================
@@ -434,6 +478,26 @@ StringRef DiagnosticIDs::getDescription(unsigned DiagID) const {
return CustomDiagInfo->getDescription(DiagID).GetDescription();
}
+/// getStableID - Given a diagnostic ID, return the stable ID of the diagnostic.
+std::string DiagnosticIDs::getStableID(unsigned DiagID) const {
+ if (const StaticDiagInfoRec *Info = GetDiagInfo(DiagID))
+ return Info->getStableID().str();
+ assert(CustomDiagInfo && "Invalid CustomDiagInfo");
+ // TODO: Stable IDs for custom diagnostics?
+ return std::to_string(DiagID);
----------------
steakhal wrote:
Reading this TODO its unclear to me how to act on it, which suggests to me that we should either drop it or make it actionable.
Same goes for the next function.
https://github.com/llvm/llvm-project/pull/168153
More information about the cfe-commits
mailing list