[PATCH] D94624: PATCH] [clang-query] Add a --use-color option to clang-query to allow forcing the behavior

Tom Ritter via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 15 11:09:21 PST 2021


tomrittervg added a comment.

I started trying to work on a patch, but I'm still unpacking from a move and don't have all my machines set up - trying to enable and build tests filled up my hard drive (even after I removed the easy-to-remove stuff), so I don't think I'm going to be able to create a test for this in the short-term.



================
Comment at: clang-tools-extra/clang-query/Query.cpp:159
           const ASTContext &Ctx = AST->getASTContext();
-          const SourceManager &SM = Ctx.getSourceManager();
-          ASTDumper Dumper(OS, Ctx, SM.getDiagnostics().getShowColors());
+          ASTDumper Dumper(OS, Ctx, AST->getDiagnostics().getShowColors());
           Dumper.SetTraversalKind(QS.TK);
----------------
aaron.ballman wrote:
> Semi-idle curiosity, does the source manager have a different diagnostics object than the AST? I guess I'm a bit surprised this change is needed (or is the change just a minor simplification to the code?).
Just a minor simplification.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94624/new/

https://reviews.llvm.org/D94624



More information about the cfe-commits mailing list