From 5362a71c02e7d448a8ce98cf00c47e353fba5d04 Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Sat, 4 Jul 2009 13:58:54 +0000 Subject: Import Clang r74788. --- tools/index-test/index-test.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tools/index-test/index-test.cpp') 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(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"; } } -- cgit v1.2.3