#include "llvm/Support/WithColor.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
#if 0#endif
WithColor::WithColor(raw_ostream &OS, HighlightColor Color, bool DisableColors)
: OS(OS), DisableColors(DisableColors) {
}
raw_ostream &WithColor::error() { return error(errs()); }
raw_ostream &WithColor::warning() { return warning(errs()); }
raw_ostream &WithColor::note() { return note(errs()); }
raw_ostream &WithColor::remark() { return remark(errs()); }
raw_ostream &WithColor::error(raw_ostream &OS, StringRef Prefix,
bool DisableColors) {
if (!Prefix.empty())
OS << Prefix << ": ";
return WithColor(OS, HighlightColor::Error, DisableColors).get()
<< "error: ";
}
raw_ostream &WithColor::warning(raw_ostream &OS, StringRef Prefix,
bool DisableColors) {
if (!Prefix.empty())
OS << Prefix << ": ";
return WithColor(OS, HighlightColor::Warning, DisableColors).get()
<< "warning: ";
}
raw_ostream &WithColor::note(raw_ostream &OS, StringRef Prefix,
bool DisableColors) {
if (!Prefix.empty())
OS << Prefix << ": ";
return WithColor(OS, HighlightColor::Note, DisableColors).get() << "note: ";
}
raw_ostream &WithColor::remark(raw_ostream &OS, StringRef Prefix,
bool DisableColors) {
if (!Prefix.empty())
OS << Prefix << ": ";
return WithColor(OS, HighlightColor::Remark, DisableColors).get()
<< "remark: ";
}
bool WithColor::colorsEnabled() {
return false; }
WithColor &WithColor::changeColor(raw_ostream::Colors Color, bool Bold,
bool BG) {
return *this;
}
WithColor &WithColor::resetColor() {
return *this;
}
WithColor::~WithColor() { resetColor(); }