From: Alp Toker Date: Mon, 23 Dec 2013 21:00:35 +0000 (+0000) Subject: Document the Message parameter of getCustomDiagID() X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2a59b1c79ae68b9db35a3fb87a8d729164131735;p=clang Document the Message parameter of getCustomDiagID() A lot of callers have been using this facility incorrectly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197920 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/Diagnostic.h b/include/clang/Basic/Diagnostic.h index c057bdf634..4eb080601b 100644 --- a/include/clang/Basic/Diagnostic.h +++ b/include/clang/Basic/Diagnostic.h @@ -591,6 +591,9 @@ public: /// /// If this is the first request for this diagnostic, it is registered and /// created, otherwise the existing ID is returned. + /// + /// \param Message A fixed diagnostic format string that will be hashed and + /// mapped to a unique DiagID. unsigned getCustomDiagID(Level L, StringRef Message) { return Diags->getCustomDiagID((DiagnosticIDs::Level)L, Message); } diff --git a/lib/Basic/DiagnosticIDs.cpp b/lib/Basic/DiagnosticIDs.cpp index 48e7317985..90d5ed0021 100644 --- a/lib/Basic/DiagnosticIDs.cpp +++ b/lib/Basic/DiagnosticIDs.cpp @@ -311,6 +311,9 @@ DiagnosticIDs::~DiagnosticIDs() { /// getCustomDiagID - Return an ID for a diagnostic with the specified message /// and level. If this is the first request for this diagnostic, it is /// registered and created, otherwise the existing ID is returned. +/// +/// \param Message A fixed diagnostic format string that will be hashed and +/// mapped to a unique DiagID. unsigned DiagnosticIDs::getCustomDiagID(Level L, StringRef Message) { if (CustomDiagInfo == 0) CustomDiagInfo = new diag::CustomDiagInfo();