summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-query/Query.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clang-query/Query.cpp')
-rw-r--r--clang-tools-extra/clang-query/Query.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/clang-tools-extra/clang-query/Query.cpp b/clang-tools-extra/clang-query/Query.cpp
index eea0e7766d3..675fd968f46 100644
--- a/clang-tools-extra/clang-query/Query.cpp
+++ b/clang-tools-extra/clang-query/Query.cpp
@@ -8,6 +8,7 @@
#include "Query.h"
#include "QuerySession.h"
+#include "clang/AST/ASTDumper.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/Frontend/ASTUnit.h"
#include "clang/Frontend/TextDiagnostic.h"
@@ -128,7 +129,11 @@ bool MatchQuery::run(llvm::raw_ostream &OS, QuerySession &QS) const {
}
if (QS.DetailedASTOutput) {
OS << "Binding for \"" << BI->first << "\":\n";
- BI->second.dump(OS, AST->getSourceManager());
+ const ASTContext &Ctx = AST->getASTContext();
+ const SourceManager &SM = Ctx.getSourceManager();
+ ASTDumper Dumper(OS, &Ctx.getCommentCommandTraits(), &SM,
+ SM.getDiagnostics().getShowColors(), Ctx.getPrintingPolicy());
+ Dumper.Visit(BI->second);
OS << "\n";
}
}
OpenPOWER on IntegriCloud