diff options
Diffstat (limited to 'include/clang/Basic/DiagnosticIDs.h')
-rw-r--r-- | include/clang/Basic/DiagnosticIDs.h | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/include/clang/Basic/DiagnosticIDs.h b/include/clang/Basic/DiagnosticIDs.h index d35b907..56e30fb 100644 --- a/include/clang/Basic/DiagnosticIDs.h +++ b/include/clang/Basic/DiagnosticIDs.h @@ -22,13 +22,13 @@ namespace clang { class DiagnosticsEngine; class SourceLocation; - struct WarningOption; // Import the diagnostic enums themselves. namespace diag { // Start position for diagnostics. enum { - DIAG_START_DRIVER = 300, + DIAG_START_COMMON = 0, + DIAG_START_DRIVER = DIAG_START_COMMON + 300, DIAG_START_FRONTEND = DIAG_START_DRIVER + 100, DIAG_START_SERIALIZATION = DIAG_START_FRONTEND + 100, DIAG_START_LEX = DIAG_START_SERIALIZATION + 120, @@ -48,7 +48,8 @@ namespace clang { // Get typedefs for common diagnostics. enum { #define DIAG(ENUM,FLAGS,DEFAULT_MAPPING,DESC,GROUP,\ - SFINAE,ACCESS,CATEGORY,NOWERROR,SHOWINSYSHEADER) ENUM, + SFINAE,CATEGORY,NOWERROR,SHOWINSYSHEADER) ENUM, +#define COMMONSTART #include "clang/Basic/DiagnosticCommonKinds.inc" NUM_BUILTIN_COMMON_DIAGNOSTICS #undef DIAG @@ -105,11 +106,12 @@ public: void setNoErrorAsFatal(bool Value) { HasNoErrorAsFatal = Value; } }; -/// \brief Used for handling and querying diagnostic IDs. Can be used and shared -/// by multiple Diagnostics for multiple translation units. +/// \brief Used for handling and querying diagnostic IDs. +/// +/// Can be used and shared by multiple Diagnostics for multiple translation units. class DiagnosticIDs : public RefCountedBase<DiagnosticIDs> { public: - /// Level The level of the diagnostic, after it has been through mapping. + /// \brief The level of the diagnostic, after it has been through mapping. enum Level { Ignored, Note, Warning, Error, Fatal }; @@ -224,8 +226,8 @@ public: /// \brief Get the set of all diagnostic IDs in the group with the given name. /// - /// \param Diags [out] - On return, the diagnostics in the group. - /// \returns True if the given group is unknown, false otherwise. + /// \param[out] Diags - On return, the diagnostics in the group. + /// \returns \c true if the given group is unknown, \c false otherwise. bool getDiagnosticsInGroup(StringRef Group, SmallVectorImpl<diag::kind> &Diags) const; @@ -237,18 +239,14 @@ public: static StringRef getNearestWarningOption(StringRef Group); private: - /// \brief Get the set of all diagnostic IDs in the given group. - /// - /// \param Diags [out] - On return, the diagnostics in the group. - void getDiagnosticsInGroup(const WarningOption *Group, - SmallVectorImpl<diag::kind> &Diags) const; - - /// \brief Based on the way the client configured the DiagnosticsEngine - /// object, classify the specified diagnostic ID into a Level, consumable by + /// \brief Classify the specified diagnostic ID into a Level, consumable by /// the DiagnosticClient. + /// + /// The classification is based on the way the client configured the + /// DiagnosticsEngine object. /// - /// \param Loc The source location we are interested in finding out the - /// diagnostic state. Can be null in order to query the latest state. + /// \param Loc The source location for which we are interested in finding out + /// the diagnostic state. Can be null in order to query the latest state. DiagnosticIDs::Level getDiagnosticLevel(unsigned DiagID, SourceLocation Loc, const DiagnosticsEngine &Diag) const; |