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 | 0b28ea9c471308faf04b4b6695c9f016aabea49a (patch) | |
tree | 1f39432a56afb2c3324c10074b79a50768ea4594 | |
parent | 7429c5941b2b8411cb66d5448c95381c59c7c697 (diff) | |
download | bcm5719-llvm-0b28ea9c471308faf04b4b6695c9f016aabea49a.tar.gz bcm5719-llvm-0b28ea9c471308faf04b4b6695c9f016aabea49a.zip |
[libsanitizer] Create SanitizerCommonDecorator which provides the Warning() and EndWarning() methods
(needed for SEGV handling in sanitizer_common)
llvm-svn: 201392
-rw-r--r-- | compiler-rt/lib/asan/asan_report.cc | 6 | ||||
-rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_report_decorator.h | 9 |
2 files changed, 11 insertions, 4 deletions
diff --git a/compiler-rt/lib/asan/asan_report.cc b/compiler-rt/lib/asan/asan_report.cc index bd900e8c574..787dc5c2784 100644 --- a/compiler-rt/lib/asan/asan_report.cc +++ b/compiler-rt/lib/asan/asan_report.cc @@ -45,11 +45,9 @@ void AppendToErrorMessageBuffer(const char *buffer) { } // ---------------------- Decorator ------------------------------ {{{1 -class Decorator: private __sanitizer::AnsiColorDecorator { +class Decorator: public __sanitizer::SanitizerCommonDecorator { public: - Decorator() : __sanitizer::AnsiColorDecorator(PrintsToTtyCached()) { } - const char *Warning() { return Red(); } - const char *EndWarning() { return Default(); } + Decorator() : SanitizerCommonDecorator() { } const char *Access() { return Blue(); } const char *EndAccess() { return Default(); } const char *Location() { return Green(); } diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_report_decorator.h b/compiler-rt/lib/sanitizer_common/sanitizer_report_decorator.h index eef2b15ccd3..2b6365fd19e 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_report_decorator.h +++ b/compiler-rt/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 |