summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-06-24 01:45:33 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-06-24 01:45:33 +0000
commit6ea058245e0192c82274b3f5b3161c63722488dc (patch)
treec0fe2402cab73c076198bf06adaa15b859a9cd5b /clang/lib/AST
parentc0510b9c970fff35a8ebca89a318403a4b8be6bf (diff)
downloadbcm5719-llvm-6ea058245e0192c82274b3f5b3161c63722488dc.tar.gz
bcm5719-llvm-6ea058245e0192c82274b3f5b3161c63722488dc.zip
Add -ast-dump-lookups switch to -cc1 to dump DeclContext lookup maps. Test to
follow. llvm-svn: 184678
Diffstat (limited to 'clang/lib/AST')
-rw-r--r--clang/lib/AST/ASTDumper.cpp8
1 files changed, 5 insertions, 3 deletions
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<TranslationUnitDecl>(DC)->getASTContext();
-
- ASTDumper P(llvm::errs(), &Ctx.getCommentCommandTraits(),
- &Ctx.getSourceManager());
+ ASTDumper P(OS, &Ctx.getCommentCommandTraits(), &Ctx.getSourceManager());
P.dumpLookups(this);
}
OpenPOWER on IntegriCloud