mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-19 23:23:38 -04:00
[Support] Extend WithColor helpers
Although printing warnings and errors to stderr is by far the most common case, this patch makes it possible to specify any stream. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330094 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -59,16 +59,22 @@ WithColor::WithColor(raw_ostream &OS, HighlightColor Color) : OS(OS) {
|
||||
}
|
||||
}
|
||||
|
||||
raw_ostream &WithColor::error() {
|
||||
return WithColor(errs(), HighlightColor::Error).get() << "error: ";
|
||||
raw_ostream &WithColor::error() { return error(errs()); }
|
||||
|
||||
raw_ostream &WithColor::warning() { return warning(errs()); }
|
||||
|
||||
raw_ostream &WithColor::note() { return note(errs()); }
|
||||
|
||||
raw_ostream &WithColor::error(raw_ostream &OS) {
|
||||
return WithColor(OS, HighlightColor::Error).get() << "error: ";
|
||||
}
|
||||
|
||||
raw_ostream &WithColor::warning() {
|
||||
return WithColor(errs(), HighlightColor::Warning).get() << "warning: ";
|
||||
raw_ostream &WithColor::warning(raw_ostream &OS) {
|
||||
return WithColor(OS, HighlightColor::Warning).get() << "warning: ";
|
||||
}
|
||||
|
||||
raw_ostream &WithColor::note() {
|
||||
return WithColor(errs(), HighlightColor::Note).get() << "note: ";
|
||||
raw_ostream &WithColor::note(raw_ostream &OS) {
|
||||
return WithColor(OS, HighlightColor::Note).get() << "note: ";
|
||||
}
|
||||
|
||||
WithColor::~WithColor() {
|
||||
|
||||
Reference in New Issue
Block a user