diff options
author | Ed Schouten <ed@FreeBSD.org> | 2009-07-04 13:58:54 +0000 |
---|---|---|
committer | Ed Schouten <ed@FreeBSD.org> | 2009-07-04 13:58:54 +0000 |
commit | 5362a71c02e7d448a8ce98cf00c47e353fba5d04 (patch) | |
tree | 8ddfe382e1c6d590dc240e76f7cd45cea5c78e24 /tools/index-test/index-test.cpp | |
parent | 4ebdf5c4f587daef4e0be499802eac3a7a49bf2f (diff) |
Notes
Diffstat (limited to 'tools/index-test/index-test.cpp')
-rw-r--r-- | tools/index-test/index-test.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/index-test/index-test.cpp b/tools/index-test/index-test.cpp index 5606e7576690..552b7b01498a 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"; } } |