X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=lib%2FSupport%2FSourceMgr.cpp;h=6d44a4d51f600e98a58caf5b256225c9fff732a7;hb=6948897e478cbd66626159776a8017b3c18579b9;hp=d5e3157b064e898e1ad4e8d66647b1e028c66472;hpb=c3b0732900953dc4d8f68ce41da35f4760933bb3;p=android-x86%2Fexternal-llvm.git diff --git a/lib/Support/SourceMgr.cpp b/lib/Support/SourceMgr.cpp index d5e3157b064..6d44a4d51f6 100644 --- a/lib/Support/SourceMgr.cpp +++ b/lib/Support/SourceMgr.cpp @@ -332,8 +332,8 @@ static bool isNonASCII(char c) { return c & 0x80; } -void SMDiagnostic::print(const char *ProgName, raw_ostream &S, - bool ShowColors) const { +void SMDiagnostic::print(const char *ProgName, raw_ostream &S, bool ShowColors, + bool ShowKindLabel) const { // Display colors only if OS supports colors. ShowColors &= S.has_colors(); @@ -357,27 +357,29 @@ void SMDiagnostic::print(const char *ProgName, raw_ostream &S, S << ": "; } - switch (Kind) { - case SourceMgr::DK_Error: - if (ShowColors) - S.changeColor(raw_ostream::RED, true); - S << "error: "; - break; - case SourceMgr::DK_Warning: - if (ShowColors) - S.changeColor(raw_ostream::MAGENTA, true); - S << "warning: "; - break; - case SourceMgr::DK_Note: - if (ShowColors) - S.changeColor(raw_ostream::BLACK, true); - S << "note: "; - break; - } + if (ShowKindLabel) { + switch (Kind) { + case SourceMgr::DK_Error: + if (ShowColors) + S.changeColor(raw_ostream::RED, true); + S << "error: "; + break; + case SourceMgr::DK_Warning: + if (ShowColors) + S.changeColor(raw_ostream::MAGENTA, true); + S << "warning: "; + break; + case SourceMgr::DK_Note: + if (ShowColors) + S.changeColor(raw_ostream::BLACK, true); + S << "note: "; + break; + } - if (ShowColors) { - S.resetColor(); - S.changeColor(raw_ostream::SAVEDCOLOR, true); + if (ShowColors) { + S.resetColor(); + S.changeColor(raw_ostream::SAVEDCOLOR, true); + } } S << Message << '\n';