summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp12
-rw-r--r--llvm/lib/Support/WithColor.cpp18
2 files changed, 15 insertions, 15 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
index 73aa5017888..ba7aef37eac 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
@@ -1196,14 +1196,8 @@ bool DWARFVerifier::handleAccelTables() {
return NumErrors == 0;
}
-raw_ostream &DWARFVerifier::error() const {
- return WithColor(OS, HighlightColor::Error).get() << "error: ";
-}
+raw_ostream &DWARFVerifier::error() const { return WithColor::error(OS); }
-raw_ostream &DWARFVerifier::warn() const {
- return WithColor(OS, HighlightColor::Warning).get() << "warning: ";
-}
+raw_ostream &DWARFVerifier::warn() const { return WithColor::warning(OS); }
-raw_ostream &DWARFVerifier::note() const {
- return WithColor(OS, HighlightColor::Note).get() << "note: ";
-}
+raw_ostream &DWARFVerifier::note() const { return WithColor::note(OS); }
diff --git a/llvm/lib/Support/WithColor.cpp b/llvm/lib/Support/WithColor.cpp
index 29fa16493f7..5a1364ff3cb 100644
--- a/llvm/lib/Support/WithColor.cpp
+++ b/llvm/lib/Support/WithColor.cpp
@@ -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() {
OpenPOWER on IntegriCloud