forked from OSchip/llvm-project
[libsanitizer] Create SanitizerCommonDecorator which provides the Warning() and EndWarning() methods
(needed for SEGV handling in sanitizer_common) llvm-svn: 201392
This commit is contained in:
parent
7429c5941b
commit
0b28ea9c47
|
@ -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(); }
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue