Porting Clang to use with a new architecture


Where I’m working they’ve asked me to look into compiling c code for a new processor architecture being developed. I’ve been checking into using clang for this.

According to what I’'ve been reading I should port LLVM to this new architecture, for which I have found some documentation. This would change llvm (since I need to add classes and modify code) but I’m not clear on how this will then interface with the entire clang front end, i.e How is the output of the front end (which I understand is ClangAST or similar) inputted into llvm to transform in opcodes?

I would really apreciate a suggestion on where to start reading in order to the porting, or to know if I’m going in the right direction.

Thank you for your time.