================
@@ -200,7 +273,33 @@ class DiagnosticIDs : public RefCountedBase<DiagnosticIDs> 
{
   // FIXME: Replace this function with a create-only facilty like
   // createCustomDiagIDFromFormatString() to enforce safe usage. At the time of
   // writing, nearly all callers of this function were invalid.
-  unsigned getCustomDiagID(Level L, StringRef FormatString);
+  unsigned getCustomDiagID(CustomDiagDesc Diag);
+
+  [[deprecated("Use a CustomDiagDesc instead of a Level")]] unsigned
+  getCustomDiagID(Level Level, StringRef Message) {
+    return getCustomDiagID([&]() -> CustomDiagDesc {
+      switch (Level) {
+      case DiagnosticIDs::Level::Ignored:
+        return {diag::Severity::Ignored, std::string(Message), CLASS_WARNING,
----------------
philnik777 wrote:

Yes, this is just matching the previous behaviour. I agree that it doesn't make 
a ton of sense in some cases, but this should go at some point anyways, so I 
didn't want to mess with it.

https://github.com/llvm/llvm-project/pull/70976
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to