summaryrefslogtreecommitdiffstats
path: root/tools/index-test/index-test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/index-test/index-test.cpp')
-rw-r--r--tools/index-test/index-test.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/index-test/index-test.cpp b/tools/index-test/index-test.cpp
index 5606e75..552b7b0 100644
--- a/tools/index-test/index-test.cpp
+++ b/tools/index-test/index-test.cpp
@@ -125,16 +125,19 @@ int main(int argc, char **argv) {
if (Point.D) {
llvm::raw_ostream &OS = llvm::outs();
- assert(Point.D && "If no node was found we should have exited with error");
OS << "Declaration node at point: " << Point.D->getDeclKindName() << " ";
if (NamedDecl *ND = dyn_cast<NamedDecl>(Point.D))
OS << ND->getNameAsString();
OS << "\n";
+ if (const char *Comment = AST->getASTContext().getCommentForDecl(Point.D))
+ OS << "Comment associated with this declaration:\n" << Comment << "\n";
+
if (Point.Node) {
OS << "Statement node at point: " << Point.Node->getStmtClassName()
<< " ";
- Point.Node->printPretty(OS, AST->getASTContext());
+ Point.Node->printPretty(OS, AST->getASTContext(), 0,
+ PrintingPolicy(AST->getASTContext().getLangOptions()));
OS << "\n";
}
}
OpenPOWER on IntegriCloud