aboutsummaryrefslogtreecommitdiff
path: root/clang-tools-extra/clang-query
diff options
context:
space:
mode:
authorBruno Ricci <riccibrun@gmail.com>2020-07-02 18:55:07 +0100
committerBruno Ricci <riccibrun@gmail.com>2020-07-02 19:29:02 +0100
commitaa7fd905e4e1bc510448431da9310e8cf5197523 (patch)
tree8a1953eabf7ac80fe1ea3a08eed69458992026f8 /clang-tools-extra/clang-query
parent0059f6ffe84241b9728e48c1eabdaf1a6abbef66 (diff)
downloadllvm-aa7fd905e4e1bc510448431da9310e8cf5197523.zip
llvm-aa7fd905e4e1bc510448431da9310e8cf5197523.tar.gz
llvm-aa7fd905e4e1bc510448431da9310e8cf5197523.tar.bz2
[clang][NFC] Store a pointer to the ASTContext in ASTDumper and TextNodeDumper
In general there is no way to get to the ASTContext from most AST nodes (Decls are one of the exception). This will be a problem when implementing the rest of APValue::dump since we need the ASTContext to dump some kinds of APValues. The ASTContext* in ASTDumper and TextNodeDumper is not always non-null. This is because we still want to be able to use the various dump() functions in a debugger. No functional changes intended.
Diffstat (limited to 'clang-tools-extra/clang-query')
-rw-r--r--clang-tools-extra/clang-query/Query.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/clang-tools-extra/clang-query/Query.cpp b/clang-tools-extra/clang-query/Query.cpp
index 2fc7af6..4fe7110 100644
--- a/clang-tools-extra/clang-query/Query.cpp
+++ b/clang-tools-extra/clang-query/Query.cpp
@@ -157,8 +157,7 @@ bool MatchQuery::run(llvm::raw_ostream &OS, QuerySession &QS) const {
OS << "Binding for \"" << BI->first << "\":\n";
const ASTContext &Ctx = AST->getASTContext();
const SourceManager &SM = Ctx.getSourceManager();
- ASTDumper Dumper(OS, &Ctx.getCommentCommandTraits(), &SM,
- SM.getDiagnostics().getShowColors(), Ctx.getPrintingPolicy());
+ ASTDumper Dumper(OS, Ctx, SM.getDiagnostics().getShowColors());
Dumper.SetTraversalKind(QS.TK);
Dumper.Visit(BI->second);
OS << "\n";