Clang Semantic Analysis for Beginner


I’m looking for resources or advice on how to get started with adding to a type system for a C like language in clang.

For example, if I had the following function declarations (where matrix is a type I added into c++):

void Foo(matrix);
void Foo(float);

  1. How would I teach clang about overloading the Foo function to take the correct types.

  2. I see a SemaConsumer class that seems to work like the ASTConsumer, but allows me to modify the AST. If I was implementing a type system (or additions to one), would I work mostly with this class?

Thanks, I’ve google for information but I oculdn’t find much.

I appreciate your time/knowledge.