summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/DWARF/SyntaxHighlighting.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/DebugInfo/DWARF/SyntaxHighlighting.cpp')
-rw-r--r--llvm/lib/DebugInfo/DWARF/SyntaxHighlighting.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/SyntaxHighlighting.cpp b/llvm/lib/DebugInfo/DWARF/SyntaxHighlighting.cpp
index 46c19bcc451..f60f9623a29 100644
--- a/llvm/lib/DebugInfo/DWARF/SyntaxHighlighting.cpp
+++ b/llvm/lib/DebugInfo/DWARF/SyntaxHighlighting.cpp
@@ -21,11 +21,9 @@ static cl::opt<cl::boolOrDefault>
cl::init(cl::BOU_UNSET));
bool WithColor::colorsEnabled(raw_ostream &OS) {
- switch (UseColor) {
- case cl::BOU_UNSET: return OS.has_colors();
- case cl::BOU_TRUE: return true;
- case cl::BOU_FALSE: return false;
- }
+ if (UseColor == cl::BOU_UNSET)
+ return OS.has_colors();
+ return UseColor == cl::BOU_TRUE;
}
WithColor::WithColor(raw_ostream &OS, enum HighlightColor Type) : OS(OS) {
OpenPOWER on IntegriCloud