================
@@ -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);
----------------
dbartol wrote:
I've expanded the comments with a little more detail about how to handle this.
We should really just get rid of the remaining custom diagnostics.
https://github.com/llvm/llvm-project/pull/168153
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits