diff options
author | Alexander Potapenko <glider@google.com> | 2014-02-14 08:59:42 +0000 |
---|---|---|
committer | Alexander Potapenko <glider@google.com> | 2014-02-14 08:59:42 +0000 |
commit | 6d999e478fecb10dc43f20b85385d25cc239db0a (patch) | |
tree | cb8cb7133431300ebfc7fbfdbfa70b9be2cccefb /lib/sanitizer_common/sanitizer_report_decorator.h | |
parent | db75ada3a3169f4bc4b9f9f04b42a5075d264743 (diff) | |
download | compiler-rt-6d999e478fecb10dc43f20b85385d25cc239db0a.tar.gz |
[libsanitizer] Create SanitizerCommonDecorator which provides the Warning() and EndWarning() methods
(needed for SEGV handling in sanitizer_common)
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201392 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_report_decorator.h')
-rw-r--r-- | lib/sanitizer_common/sanitizer_report_decorator.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/sanitizer_common/sanitizer_report_decorator.h b/lib/sanitizer_common/sanitizer_report_decorator.h index eef2b15cc..2b6365fd1 100644 --- a/lib/sanitizer_common/sanitizer_report_decorator.h +++ b/lib/sanitizer_common/sanitizer_report_decorator.h @@ -36,6 +36,15 @@ class AnsiColorDecorator { private: bool ansi_; }; + +class SanitizerCommonDecorator: protected AnsiColorDecorator { + public: + SanitizerCommonDecorator() + : __sanitizer::AnsiColorDecorator(PrintsToTtyCached()) { } + const char *Warning() { return Red(); } + const char *EndWarning() { return Default(); } +}; + } // namespace __sanitizer #endif // SANITIZER_REPORT_DECORATOR_H |