From 6ea058245e0192c82274b3f5b3161c63722488dc Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Mon, 24 Jun 2013 01:45:33 +0000 Subject: Add -ast-dump-lookups switch to -cc1 to dump DeclContext lookup maps. Test to follow. llvm-svn: 184678 --- clang/lib/AST/ASTDumper.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'clang/lib/AST/ASTDumper.cpp') diff --git a/clang/lib/AST/ASTDumper.cpp b/clang/lib/AST/ASTDumper.cpp index 3554394ef2e..dddc4d4c18f 100644 --- a/clang/lib/AST/ASTDumper.cpp +++ b/clang/lib/AST/ASTDumper.cpp @@ -2031,13 +2031,15 @@ void Decl::dumpColor() const { } void DeclContext::dumpLookups() const { + dumpLookups(llvm::errs()); +} + +void DeclContext::dumpLookups(raw_ostream &OS) const { const DeclContext *DC = this; while (!DC->isTranslationUnit()) DC = DC->getParent(); ASTContext &Ctx = cast(DC)->getASTContext(); - - ASTDumper P(llvm::errs(), &Ctx.getCommentCommandTraits(), - &Ctx.getSourceManager()); + ASTDumper P(OS, &Ctx.getCommentCommandTraits(), &Ctx.getSourceManager()); P.dumpLookups(this); } -- cgit v1.2.3