The -output-color option was successful at suppressing color changes, but
was still allowing color resets.
Differential Revision: https://reviews.llvm.org/D31468
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299006
91177308-0d34-0410-b5e6-
96231b3b80d8
ExcludeCompilandFilters);
}
-WithColor::WithColor(LinePrinter &P, PDB_ColorItem C) : OS(P.OS) {
- if (P.hasColor())
+WithColor::WithColor(LinePrinter &P, PDB_ColorItem C)
+ : OS(P.OS), UseColor(P.hasColor()) {
+ if (UseColor)
applyColor(C);
}
-WithColor::~WithColor() { OS.resetColor(); }
+WithColor::~WithColor() {
+ if (UseColor)
+ OS.resetColor();
+}
void WithColor::applyColor(PDB_ColorItem C) {
switch (C) {
private:
void applyColor(PDB_ColorItem C);
raw_ostream &OS;
+ bool UseColor;
};
}
}