]> git.ipfire.org Git - thirdparty/gcc.git/blame - libsanitizer/sanitizer_common/sanitizer_report_decorator.h
i386-c.c (ix86_target_macros_internal): Separate PROCESSOR_COREI7_AVX out from PROCES...
[thirdparty/gcc.git] / libsanitizer / sanitizer_common / sanitizer_report_decorator.h
CommitLineData
e9772e16
KS
1//===-- sanitizer_report_decorator.h ----------------------------*- C++ -*-===//
2//
3// This file is distributed under the University of Illinois Open Source
4// License. See LICENSE.TXT for details.
5//
6//===----------------------------------------------------------------------===//
7//
8// Tags to decorate the sanitizer reports.
9// Currently supported tags:
10// * None.
11// * ANSI color sequences.
12//
13//===----------------------------------------------------------------------===//
14
de5a5fa1
MP
15#ifndef SANITIZER_REPORT_DECORATOR_H
16#define SANITIZER_REPORT_DECORATOR_H
e9772e16
KS
17
18namespace __sanitizer {
19class AnsiColorDecorator {
20 public:
21 explicit AnsiColorDecorator(bool use_ansi_colors) : ansi_(use_ansi_colors) { }
de5a5fa1
MP
22 const char *Bold() const { return ansi_ ? "\033[1m" : ""; }
23 const char *Black() const { return ansi_ ? "\033[1m\033[30m" : ""; }
24 const char *Red() const { return ansi_ ? "\033[1m\033[31m" : ""; }
25 const char *Green() const { return ansi_ ? "\033[1m\033[32m" : ""; }
26 const char *Yellow() const { return ansi_ ? "\033[1m\033[33m" : ""; }
27 const char *Blue() const { return ansi_ ? "\033[1m\033[34m" : ""; }
28 const char *Magenta() const { return ansi_ ? "\033[1m\033[35m" : ""; }
29 const char *Cyan() const { return ansi_ ? "\033[1m\033[36m" : ""; }
30 const char *White() const { return ansi_ ? "\033[1m\033[37m" : ""; }
31 const char *Default() const { return ansi_ ? "\033[1m\033[0m" : ""; }
e9772e16
KS
32 private:
33 bool ansi_;
34};
35} // namespace __sanitizer
de5a5fa1
MP
36
37#endif // SANITIZER_REPORT_DECORATOR_H