Skip to content
Commit 9aabf025 authored by Zhongxing Xu's avatar Zhongxing Xu
Browse files

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
parent 5c76772f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment