LLVM: include/llvm/Support/WithColor.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9#ifndef LLVM_SUPPORT_WITHCOLOR_H
10#define LLVM_SUPPORT_WITHCOLOR_H
11
14
15namespace llvm {
16
19
20namespace cl {
22}
23
25
26
39
51
52
53
55public:
57
58
59
60
61
64
65
66
67
68
69
70
74 : OS(OS), Mode(Mode) {
76 }
78
82 OS << O;
83 return *this;
84 }
86 OS << O;
87 return *this;
88 }
89
90
92
94
96
98
99
101 bool DisableColors = false);
102
104 bool DisableColors = false);
105
107 bool DisableColors = false);
108
110 bool DisableColors = false);
111
112
114
115
116
117
118
119
121 bool BG = false);
122
123
124
126
127
128
130
131
132
134
135
137
138
141
142private:
145
147};
148
149}
150
151#endif
#define LLVM_CTOR_NODISCARD
static cl::opt< RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode > Mode("regalloc-enable-advisor", cl::Hidden, cl::init(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default), cl::desc("Enable regalloc advisor mode"), cl::values(clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default, "default", "Default"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Release, "release", "precompiled"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Development, "development", "for training")))
Functions, function parameters, and return types can have attributes to indicate how they should be t...
Lightweight error class with error context and mandatory checking.
StringRef - Represent a constant reference to a string, i.e.
An RAII object that temporarily switches an output stream to a specific color.
Definition WithColor.h:54
LLVM_ABI WithColor & changeColor(raw_ostream::Colors Color, bool Bold=false, bool BG=false)
Change the color of text that will be output from this point forward.
static LLVM_ABI void defaultWarningHandler(Error Warning)
Implement default handling for Warning.
LLVM_CTOR_NODISCARD LLVM_ABI WithColor(raw_ostream &OS, HighlightColor S, ColorMode Mode=ColorMode::Auto)
To be used like this: WithColor(OS, HighlightColor::String) << "text";.
WithColor & operator<<(const T &O)
Definition WithColor.h:85
LLVM_ABI bool colorsEnabled()
Determine whether colors are displayed.
static LLVM_ABI raw_ostream & warning()
Convenience method for printing "warning: " to stderr.
LLVM_CTOR_NODISCARD WithColor(raw_ostream &OS, raw_ostream::Colors Color=raw_ostream::SAVEDCOLOR, bool Bold=false, bool BG=false, ColorMode Mode=ColorMode::Auto)
To be used like this: WithColor(OS, raw_ostream::BLACK) << "text";.
Definition WithColor.h:71
static LLVM_ABI raw_ostream & error()
Convenience method for printing "error: " to stderr.
bool(*)(const raw_ostream &OS) AutoDetectFunctionType
Definition WithColor.h:56
LLVM_ABI WithColor & resetColor()
Reset the colors to terminal defaults.
raw_ostream & get()
Definition WithColor.h:79
static LLVM_ABI void defaultErrorHandler(Error Err)
Implement default handling for Error.
static LLVM_ABI raw_ostream & note()
Convenience method for printing "note: " to stderr.
static LLVM_ABI AutoDetectFunctionType defaultAutoDetectFunction()
Retrieve the default color auto detection function.
static LLVM_ABI void setAutoDetectFunction(AutoDetectFunctionType NewAutoDetectFunction)
Change the global auto detection function.
WithColor & operator<<(T &O)
Definition WithColor.h:81
static LLVM_ABI raw_ostream & remark()
Convenience method for printing "remark: " to stderr.
This class implements an extremely fast bulk output stream that can only output to a stream.
static constexpr Colors SAVEDCOLOR
This namespace contains all of the command line option processing machinery.
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI cl::OptionCategory & getColorCategory()
HighlightColor
Definition WithColor.h:27
@ Warning
Definition WithColor.h:35
@ String
Definition WithColor.h:29
@ Enumerator
Definition WithColor.h:32
@ Note
Definition WithColor.h:36
@ Macro
Definition WithColor.h:33
@ Remark
Definition WithColor.h:37
@ Tag
Definition WithColor.h:30
ColorMode
Definition WithColor.h:40
@ Auto
Determine whether to use color based on the command line argument and the raw_ostream.
Definition WithColor.h:43
@ Enable
Enable colors.
Definition WithColor.h:47
@ Disable
Disable colors.
Definition WithColor.h:49