aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Basic/DiagnosticOptions.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-06-21 14:00:56 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-06-21 14:00:56 +0000
commit2e645aa5697838f16ec570eb07c2bee7e13d0e0b (patch)
treea764184c2fc9486979b074250b013a0937ee64e5 /include/clang/Basic/DiagnosticOptions.h
parent798321d8eb5630cd4a8f490a4f25e32ef195fb07 (diff)
downloadsrc-b1275e4ec6ae8678003cabd31268752aaa7b8dc8.tar.gz
src-b1275e4ec6ae8678003cabd31268752aaa7b8dc8.zip
Vendor import of clang trunk r240225:vendor/clang/clang-trunk-r240225
Diffstat (limited to 'include/clang/Basic/DiagnosticOptions.h')
-rw-r--r--include/clang/Basic/DiagnosticOptions.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/include/clang/Basic/DiagnosticOptions.h b/include/clang/Basic/DiagnosticOptions.h
index a16c7747cec3..c9b0c5def992 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: