diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 42d6f6eeced..2441fc79d94 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -1013,7 +1013,7 @@ namespace { PrintDecl(raw_ostream &os, unsigned indent) : OS(os), Indent(indent), ShowColors(false) { if (&os == &llvm::errs() || &os == &llvm::outs()) - ShowColors = llvm::errs().is_displayed() && llvm::outs().is_displayed(); + ShowColors = llvm::errs().has_colors() && llvm::outs().has_colors(); } void printRec(Decl *D) { PrintDecl(OS, Indent + 2).visit(D); } diff --git a/tools/swift/Immediate.cpp b/tools/swift/Immediate.cpp index 62d9b419f01..45d0008f46f 100644 --- a/tools/swift/Immediate.cpp +++ b/tools/swift/Immediate.cpp @@ -407,8 +407,8 @@ public: REPLInput(REPLEnvironment &env) : StackTrace(*this), Env(env), Autoindent(true) { - // Only show colors if both stderr and stdout are displayed. - ShowColors = llvm::errs().is_displayed() && llvm::outs().is_displayed(); + // Only show colors if both stderr and stdout have colors. + ShowColors = llvm::errs().has_colors() && llvm::outs().has_colors(); // Make sure the terminal color gets restored when the REPL is quit. if (ShowColors)