diff options
Diffstat (limited to 'include/clang/Basic/DiagnosticIDs.h')
-rw-r--r-- | include/clang/Basic/DiagnosticIDs.h | 96 |
1 files changed, 51 insertions, 45 deletions
diff --git a/include/clang/Basic/DiagnosticIDs.h b/include/clang/Basic/DiagnosticIDs.h index a6c22db..11552af 100644 --- a/include/clang/Basic/DiagnosticIDs.h +++ b/include/clang/Basic/DiagnosticIDs.h @@ -6,9 +6,10 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// This file defines the Diagnostic IDs-related interfaces. -// +/// +/// \file +/// \brief Defines the Diagnostic IDs-related interfaces. +/// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_DIAGNOSTICIDS_H @@ -37,14 +38,15 @@ namespace clang { DIAG_START_LEX = DIAG_START_SERIALIZATION + 120, DIAG_START_PARSE = DIAG_START_LEX + 300, DIAG_START_AST = DIAG_START_PARSE + 400, - DIAG_START_SEMA = DIAG_START_AST + 100, + DIAG_START_COMMENT = DIAG_START_AST + 100, + DIAG_START_SEMA = DIAG_START_COMMENT + 100, DIAG_START_ANALYSIS = DIAG_START_SEMA + 3000, DIAG_UPPER_LIMIT = DIAG_START_ANALYSIS + 100 }; class CustomDiagInfo; - /// diag::kind - All of the diagnostics that can be emitted by the frontend. + /// \brief All of the diagnostics that can be emitted by the frontend. typedef unsigned kind; // Get typedefs for common diagnostics. @@ -63,10 +65,10 @@ namespace clang { /// one). enum Mapping { // NOTE: 0 means "uncomputed". - MAP_IGNORE = 1, //< Map this diagnostic to nothing, ignore it. - MAP_WARNING = 2, //< Map this diagnostic to a warning. - MAP_ERROR = 3, //< Map this diagnostic to an error. - MAP_FATAL = 4 //< Map this diagnostic to a fatal error. + MAP_IGNORE = 1, ///< Map this diagnostic to nothing, ignore it. + MAP_WARNING = 2, ///< Map this diagnostic to a warning. + MAP_ERROR = 3, ///< Map this diagnostic to an error. + MAP_FATAL = 4 ///< Map this diagnostic to a fatal error. }; } @@ -111,83 +113,84 @@ public: /// 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. + /// Level The level of the diagnostic, after it has been through mapping. enum Level { Ignored, Note, Warning, Error, Fatal }; private: - /// CustomDiagInfo - Information for uniquing and looking up custom diags. + /// \brief Information for uniquing and looking up custom diags. diag::CustomDiagInfo *CustomDiagInfo; public: DiagnosticIDs(); ~DiagnosticIDs(); - /// 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. + /// \brief 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, StringRef Message); //===--------------------------------------------------------------------===// // Diagnostic classification and reporting interfaces. // - /// getDescription - Given a diagnostic ID, return a description of the - /// issue. + /// \brief Given a diagnostic ID, return a description of the issue. StringRef getDescription(unsigned DiagID) const; - /// isBuiltinWarningOrExtension - Return true if the unmapped diagnostic level - /// of the specified diagnostic ID is a Warning or Extension. This only works - /// on builtin diagnostics, not custom ones, and is not legal to call on - /// NOTEs. + /// \brief Return true if the unmapped diagnostic levelof the specified + /// diagnostic ID is a Warning or Extension. + /// + /// This only works on builtin diagnostics, not custom ones, and is not + /// legal to call on NOTEs. static bool isBuiltinWarningOrExtension(unsigned DiagID); /// \brief Return true if the specified diagnostic is mapped to errors by /// default. static bool isDefaultMappingAsError(unsigned DiagID); - /// \brief Determine whether the given built-in diagnostic ID is a - /// Note. + /// \brief Determine whether the given built-in diagnostic ID is a Note. static bool isBuiltinNote(unsigned DiagID); - /// isBuiltinExtensionDiag - Determine whether the given built-in diagnostic - /// ID is for an extension of some sort. - /// + /// \brief Determine whether the given built-in diagnostic ID is for an + /// extension of some sort. static bool isBuiltinExtensionDiag(unsigned DiagID) { bool ignored; return isBuiltinExtensionDiag(DiagID, ignored); } - /// isBuiltinExtensionDiag - Determine whether the given built-in diagnostic - /// ID is for an extension of some sort. This also returns EnabledByDefault, - /// which is set to indicate whether the diagnostic is ignored by default (in - /// which case -pedantic enables it) or treated as a warning/error by default. + /// \brief Determine whether the given built-in diagnostic ID is for an + /// extension of some sort, and whether it is enabled by default. + /// + /// This also returns EnabledByDefault, which is set to indicate whether the + /// diagnostic is ignored by default (in which case -pedantic enables it) or + /// treated as a warning/error by default. /// static bool isBuiltinExtensionDiag(unsigned DiagID, bool &EnabledByDefault); - /// getWarningOptionForDiag - Return the lowest-level warning option that - /// enables the specified diagnostic. If there is no -Wfoo flag that controls - /// the diagnostic, this returns null. + /// \brief Return the lowest-level warning option that enables the specified + /// diagnostic. + /// + /// If there is no -Wfoo flag that controls the diagnostic, this returns null. static StringRef getWarningOptionForDiag(unsigned DiagID); - /// getCategoryNumberForDiag - Return the category number that a specified - /// DiagID belongs to, or 0 if no category. + /// \brief Return the category number that a specified \p DiagID belongs to, + /// or 0 if no category. static unsigned getCategoryNumberForDiag(unsigned DiagID); - /// getNumberOfCategories - Return the number of categories + /// \brief Return the number of diagnostic categories. static unsigned getNumberOfCategories(); - /// getCategoryNameFromID - Given a category ID, return the name of the - /// category. + /// \brief Given a category ID, return the name of the category. static StringRef getCategoryNameFromID(unsigned CategoryID); - /// isARCDiagnostic - Return true if a given diagnostic falls into an - /// ARC diagnostic category; + /// \brief Return true if a given diagnostic falls into an ARC diagnostic + /// category. static bool isARCDiagnostic(unsigned DiagID); - /// \brief Enumeration describing how the the emission of a diagnostic should + /// \brief Enumeration describing how the emission of a diagnostic should /// be treated when it occurs during C++ template argument deduction. enum SFINAEResponse { /// \brief The diagnostic should not be reported, but it should cause @@ -253,20 +256,23 @@ private: DiagnosticIDs::Level getDiagnosticLevel(unsigned DiagID, SourceLocation Loc, const DiagnosticsEngine &Diag) const; - /// getDiagnosticLevel - This is an internal implementation helper used when - /// DiagClass is already known. + /// \brief An internal implementation helper used when \p DiagClass is + /// already known. DiagnosticIDs::Level getDiagnosticLevel(unsigned DiagID, unsigned DiagClass, SourceLocation Loc, const DiagnosticsEngine &Diag) const; - /// ProcessDiag - This is the method used to report a diagnostic that is - /// finally fully formed. + /// \brief Used to report a diagnostic that is finally fully formed. /// - /// \returns true if the diagnostic was emitted, false if it was + /// \returns \c true if the diagnostic was emitted, \c false if it was /// suppressed. bool ProcessDiag(DiagnosticsEngine &Diag) const; + /// \brief Used to emit a diagnostic that is finally fully formed, + /// ignoring suppression. + void EmitDiag(DiagnosticsEngine &Diag, Level DiagLevel) const; + /// \brief Whether the diagnostic may leave the AST in a state where some /// invariants can break. bool isUnrecoverable(unsigned DiagID) const; |