Patch by Philip Craig.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168420
91177308-0d34-0410-b5e6-
96231b3b80d8
bool TraverseDecl(Decl *D) {
if (D != NULL && filterMatches(D)) {
- Out.changeColor(llvm::raw_ostream::BLUE) <<
- (Dump ? "Dumping " : "Printing ") << getName(D) << ":\n";
- Out.resetColor();
+ bool ShowColors = Out.has_colors();
+ if (ShowColors)
+ Out.changeColor(llvm::raw_ostream::BLUE);
+ Out << (Dump ? "Dumping " : "Printing ") << getName(D) << ":\n";
+ if (ShowColors)
+ Out.resetColor();
if (Dump)
D->dump(Out);
else
// RUN: clang-check -ast-dump -ast-dump-filter test_namespace::TheClass::theMethod "%s" -- 2>&1 | FileCheck -check-prefix CHECK-FILTER %s
// CHECK-FILTER-NOT: namespace test_namespace
// CHECK-FILTER-NOT: class TheClass
-// CHECK-FILTER: int theMethod(int x) (CompoundStmt
+// CHECK-FILTER: {{^}}Dumping test_namespace::TheClass::theMethod
+// CHECK-FILTER-NEXT: {{^}}int theMethod(int x) (CompoundStmt
// CHECK-FILTER-NEXT: (ReturnStmt
// CHECK-FILTER-NEXT: (BinaryOperator
//