Skip to content

Commit 0b28ea9

Browse files
[libsanitizer] Create SanitizerCommonDecorator which provides the Warning() and EndWarning() methods
(needed for SEGV handling in sanitizer_common) llvm-svn: 201392
1 parent 7429c59 commit 0b28ea9

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

compiler-rt/lib/asan/asan_report.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,9 @@ void AppendToErrorMessageBuffer(const char *buffer) {
4545
}
4646

4747
// ---------------------- Decorator ------------------------------ {{{1
48-
class Decorator: private __sanitizer::AnsiColorDecorator {
48+
class Decorator: public __sanitizer::SanitizerCommonDecorator {
4949
public:
50-
Decorator() : __sanitizer::AnsiColorDecorator(PrintsToTtyCached()) { }
51-
const char *Warning() { return Red(); }
52-
const char *EndWarning() { return Default(); }
50+
Decorator() : SanitizerCommonDecorator() { }
5351
const char *Access() { return Blue(); }
5452
const char *EndAccess() { return Default(); }
5553
const char *Location() { return Green(); }

compiler-rt/lib/sanitizer_common/sanitizer_report_decorator.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ class AnsiColorDecorator {
3636
private:
3737
bool ansi_;
3838
};
39+
40+
class SanitizerCommonDecorator: protected AnsiColorDecorator {
41+
public:
42+
SanitizerCommonDecorator()
43+
: __sanitizer::AnsiColorDecorator(PrintsToTtyCached()) { }
44+
const char *Warning() { return Red(); }
45+
const char *EndWarning() { return Default(); }
46+
};
47+
3948
} // namespace __sanitizer
4049

4150
#endif // SANITIZER_REPORT_DECORATOR_H

0 commit comments

Comments
 (0)