summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/ubsan/ubsan_diag.h
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/lib/ubsan/ubsan_diag.h')
-rw-r--r--compiler-rt/lib/ubsan/ubsan_diag.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/compiler-rt/lib/ubsan/ubsan_diag.h b/compiler-rt/lib/ubsan/ubsan_diag.h
index 7370b1b6242..d9ea410c358 100644
--- a/compiler-rt/lib/ubsan/ubsan_diag.h
+++ b/compiler-rt/lib/ubsan/ubsan_diag.h
@@ -121,6 +121,12 @@ public:
const char *getName() const { return Name; }
};
+enum class ErrorType {
+#define UBSAN_CHECK(Name, SummaryKind, FSanitizeFlagName) Name,
+#include "ubsan_checks.inc"
+#undef UBSAN_CHECK
+};
+
/// \brief Representation of an in-flight diagnostic.
///
/// Temporary \c Diag instances are created by the handler routines to
@@ -133,6 +139,9 @@ class Diag {
/// The diagnostic level.
DiagLevel Level;
+ /// The error type.
+ ErrorType ET;
+
/// The message which will be emitted, with %0, %1, ... placeholders for
/// arguments.
const char *Message;
@@ -197,8 +206,9 @@ private:
Diag &operator=(const Diag &);
public:
- Diag(Location Loc, DiagLevel Level, const char *Message)
- : Loc(Loc), Level(Level), Message(Message), NumArgs(0), NumRanges(0) {}
+ Diag(Location Loc, DiagLevel Level, ErrorType ET, const char *Message)
+ : Loc(Loc), Level(Level), ET(ET), Message(Message), NumArgs(0),
+ NumRanges(0) {}
~Diag();
Diag &operator<<(const char *Str) { return AddArg(Str); }
@@ -219,12 +229,6 @@ struct ReportOptions {
uptr bp;
};
-enum class ErrorType {
-#define UBSAN_CHECK(Name, SummaryKind, FSanitizeFlagName) Name,
-#include "ubsan_checks.inc"
-#undef UBSAN_CHECK
-};
-
bool ignoreReport(SourceLocation SLoc, ReportOptions Opts, ErrorType ET);
#define GET_REPORT_OPTIONS(unrecoverable_handler) \
OpenPOWER on IntegriCloud