diff options
Diffstat (limited to 'include/clang/Basic/DiagnosticOptions.h')
-rw-r--r-- | include/clang/Basic/DiagnosticOptions.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/include/clang/Basic/DiagnosticOptions.h b/include/clang/Basic/DiagnosticOptions.h index a16c774..c9b0c5d 100644 --- a/include/clang/Basic/DiagnosticOptions.h +++ b/include/clang/Basic/DiagnosticOptions.h @@ -13,6 +13,7 @@ #include "clang/Basic/LLVM.h" #include "llvm/ADT/IntrusiveRefCntPtr.h" #include <string> +#include <type_traits> #include <vector> namespace clang { @@ -24,6 +25,38 @@ enum OverloadsShown : unsigned { Ovl_Best ///< Show just the "best" overload candidates. }; +/// \brief A bitmask representing the diagnostic levels used by +/// VerifyDiagnosticConsumer. +enum class DiagnosticLevelMask : unsigned { + None = 0, + Note = 1 << 0, + Remark = 1 << 1, + Warning = 1 << 2, + Error = 1 << 3, + All = Note | Remark | Warning | Error +}; + +inline DiagnosticLevelMask operator~(DiagnosticLevelMask M) { + using UT = std::underlying_type<DiagnosticLevelMask>::type; + return static_cast<DiagnosticLevelMask>(~static_cast<UT>(M)); +} + +inline DiagnosticLevelMask operator|(DiagnosticLevelMask LHS, + DiagnosticLevelMask RHS) { + using UT = std::underlying_type<DiagnosticLevelMask>::type; + return static_cast<DiagnosticLevelMask>( + static_cast<UT>(LHS) | static_cast<UT>(RHS)); +} + +inline DiagnosticLevelMask operator&(DiagnosticLevelMask LHS, + DiagnosticLevelMask RHS) { + using UT = std::underlying_type<DiagnosticLevelMask>::type; + return static_cast<DiagnosticLevelMask>( + static_cast<UT>(LHS) & static_cast<UT>(RHS)); +} + +raw_ostream& operator<<(raw_ostream& Out, DiagnosticLevelMask M); + /// \brief Options for controlling the compiler diagnostics engine. class DiagnosticOptions : public RefCountedBase<DiagnosticOptions>{ public: |