does clang have a symbol table ?

Of course clang have a symbol table (or more) I guess. But what I want is, how to use them ? Here I have some questions related to symbol table:

(I implement a class inherited from RecursiveASTVisitor, so the question below is based on this)

  1. In the same code scope, I define two variables but with the same name. How to check this by a VarDecl ?
  2. If I define a variable which has the same name as a global variable, or a variable in the outter scope. How to check this ?
  3. I define a struct type, and define a variable with this type, how to get more type information from QualType ?

ps. I googled for a while and it seems I can use Sema class, but Sema is a huge class with lots of member functions. So it’s really difficult to start with Sema without any documents/tutorials.

Thanks.

I have the same question with you and I also want to find the symbol
table.are you have solved it,if so ,please tell me ,if not ,we can talk over
it.thank you!

Of course clang have a symbol table (or more) I guess. But what I want is, how to use them ? Here I have some questions related to symbol table:

(I implement a class inherited from RecursiveASTVisitor, so the question below is based on this)

  1. In the same code scope, I define two variables but with the same name. How to check this by a VarDecl ?

Best way I find to answer questions like this is to write erroneous code (declare two variables with the same name in the same scope) and compile it, then break in the debugger in something like clang::Sema::Diag, walk back up the stack and see how you got there.

  1. If I define a variable which has the same name as a global variable, or a variable in the outter scope. How to check this ?

Again, in debugger, compare a successful run with shadowing and the example in (1), see how they differ.

  1. I define a struct type, and define a variable with this type, how to get more type information from QualType ?

What ‘more information’?