From: Daniel Dunbar Date: Tue, 1 Dec 2009 17:42:06 +0000 (+0000) Subject: Convert Diagnostic::getCustomDiagID to take a StringRef. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=32d4d80c26e8c4c1922cff4661e0b9f44a3aabfc;p=clang Convert Diagnostic::getCustomDiagID to take a StringRef. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90244 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/Diagnostic.h b/include/clang/Basic/Diagnostic.h index 00a5bc6e93..d3744326a3 100644 --- a/include/clang/Basic/Diagnostic.h +++ b/include/clang/Basic/Diagnostic.h @@ -319,7 +319,7 @@ public: /// getCustomDiagID - Return an ID for a diagnostic with the specified message /// and level. If this is the first request for this diagnosic, it is /// registered and created, otherwise the existing ID is returned. - unsigned getCustomDiagID(Level L, const char *Message); + unsigned getCustomDiagID(Level L, llvm::StringRef Message); /// ConvertArgToString - This method converts a diagnostic argument (as an diff --git a/lib/Basic/Diagnostic.cpp b/lib/Basic/Diagnostic.cpp index fbc7313116..8a0b858ba9 100644 --- a/lib/Basic/Diagnostic.cpp +++ b/lib/Basic/Diagnostic.cpp @@ -163,7 +163,7 @@ namespace clang { return DiagInfo[DiagID-DIAG_UPPER_LIMIT].first; } - unsigned getOrCreateDiagID(Diagnostic::Level L, const char *Message, + unsigned getOrCreateDiagID(Diagnostic::Level L, llvm::StringRef Message, Diagnostic &Diags) { DiagDesc D(L, Message); // Check to see if it already exists. @@ -246,7 +246,7 @@ bool Diagnostic::popMappings() { /// getCustomDiagID - Return an ID for a diagnostic with the specified message /// and level. If this is the first request for this diagnosic, it is /// registered and created, otherwise the existing ID is returned. -unsigned Diagnostic::getCustomDiagID(Level L, const char *Message) { +unsigned Diagnostic::getCustomDiagID(Level L, llvm::StringRef Message) { if (CustomDiagInfo == 0) CustomDiagInfo = new diag::CustomDiagInfo(); return CustomDiagInfo->getOrCreateDiagID(L, Message, *this);