From: Daniel Dunbar Date: Tue, 13 Mar 2012 18:30:42 +0000 (+0000) Subject: [Basic] Make DiagnosticBuilder::{isActive,getLocation,getDiagID} protected. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=06265bd82073c06294a02a0bd891951fafb484a5;p=clang [Basic] Make DiagnosticBuilder::{isActive,getLocation,getDiagID} protected. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152641 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/Diagnostic.h b/include/clang/Basic/Diagnostic.h index 9d3e02b657..cdfc49b4b7 100644 --- a/include/clang/Basic/Diagnostic.h +++ b/include/clang/Basic/Diagnostic.h @@ -765,6 +765,22 @@ class DiagnosticBuilder { protected: void FlushCounts(); + + /// isActive - Determine whether this diagnostic is still active. + bool isActive() const { return DiagObj != 0; } + + /// \brief Retrieve the active diagnostic ID. + /// + /// \pre \c isActive() + unsigned getDiagID() const { + assert(isActive() && "DiagnosticsEngine is inactive"); + return DiagObj->CurDiagID; + } + + /// \brief Retrieve the active diagnostic's location. + /// + /// \pre \c isActive() + SourceLocation getLocation() const { return DiagObj->CurDiagLoc; } public: /// Copy constructor. When copied, this "takes" the diagnostic info from the @@ -801,22 +817,6 @@ public: if (DiagObj) Emit(); } - - /// isActive - Determine whether this diagnostic is still active. - bool isActive() const { return DiagObj != 0; } - - /// \brief Retrieve the active diagnostic ID. - /// - /// \pre \c isActive() - unsigned getDiagID() const { - assert(isActive() && "DiagnosticsEngine is inactive"); - return DiagObj->CurDiagID; - } - - /// \brief Retrieve the active diagnostic's location. - /// - /// \pre \c isActive() - SourceLocation getLocation() const { return DiagObj->CurDiagLoc; } /// \brief Clear out the current diagnostic. void Clear() { DiagObj = 0; }