Index: llvm/trunk/tools/llvm-pdbdump/LinePrinter.h =================================================================== --- llvm/trunk/tools/llvm-pdbdump/LinePrinter.h +++ llvm/trunk/tools/llvm-pdbdump/LinePrinter.h @@ -89,6 +89,7 @@ private: void applyColor(PDB_ColorItem C); raw_ostream &OS; + bool UseColor; }; } } Index: llvm/trunk/tools/llvm-pdbdump/LinePrinter.cpp =================================================================== --- llvm/trunk/tools/llvm-pdbdump/LinePrinter.cpp +++ llvm/trunk/tools/llvm-pdbdump/LinePrinter.cpp @@ -83,12 +83,16 @@ 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) {