I'm trying to understand the ins and outs of Clang, and I'm not really sure about the "Sema" library. Is the semantic analysis in the path the compiler takes to compile a program? Or is it only used by the programmer to analyze his/her code?
From what I gather, the parser builds an AST, then there are "AST consumers" that use the AST to do different things. So, the code generation library turns the AST into IR. And the semantic analysis library uses the AST to analyze the code. Is this understanding correct, or is the semantic analyzer also used for compiling?