summaryrefslogtreecommitdiffstats
path: root/clang/Driver/ASTConsumers.h
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2009-01-13 01:29:24 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2009-01-13 01:29:24 +0000
commit9aabf025e5e1f80386ce597fcf7c6480f5e7fcf6 (patch)
tree62f424a414de0f5cd8aecf520c0906a32a131eac /clang/Driver/ASTConsumers.h
parent5c76772f49f7a42db66b96f4d1e8d1d0e47fae8c (diff)
downloadbcm5719-llvm-9aabf025e5e1f80386ce597fcf7c6480f5e7fcf6.tar.gz
bcm5719-llvm-9aabf025e5e1f80386ce597fcf7c6480f5e7fcf6.zip
Add an initial framework of a DeclContextPrinter. It can print DeclContext and
its Decls in indented format. An Example: $ cat t.cpp class A { int a; void f(); }; void A::f() { a = 3; } $ clang -print-decl-contexts t.cpp [translation unit] 0x9754d7c <typedef> __builtin_va_list [class] A 0x9753310 <class> A 0x975ce20 <field> a <c++ method> f <c++ ctor> A <c++ ctor> A <c++ method> operator= <c++ dtor> ~A [c++ method] f [[0x9753310]] Some comments: '<>' indicates a declaration, '[]' indicates a definition, '[[ ]]' displays the semantic DeclContext which is different from the lexical DeclContext. The symbols printed can definitely be changed in the future. llvm-svn: 62136
Diffstat (limited to 'clang/Driver/ASTConsumers.h')
-rw-r--r--clang/Driver/ASTConsumers.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/Driver/ASTConsumers.h b/clang/Driver/ASTConsumers.h
index 97adfb30c82..0093a7046ac 100644
--- a/clang/Driver/ASTConsumers.h
+++ b/clang/Driver/ASTConsumers.h
@@ -38,6 +38,8 @@ ASTConsumer *CreateASTDumper();
ASTConsumer *CreateASTViewer();
+ASTConsumer *CreateDeclContextPrinter();
+
ASTConsumer *CreateCodeRewriterTest(const std::string& InFile,
const std::string& OutFile,
Diagnostic &Diags,
OpenPOWER on IntegriCloud