I am trying to understand LLVM. Can an expert tell me how to compare the kaleidoscope implementation with the LLVM’s compiler implementation. I mean can anyone tell me about the lexer, parser, codegen related .cpp and .h files inside the LLVM solution project. I would like to understand the LLVM’s compiler in the same way that the kaleidoscope compiler is explained.
Thanks a lot.
That's a tall order, and I don't think we would be able to help you in general. However, there is a lot of documentation on LLVM (optimization passes, analysis, code generation, dead chicken waving) here:
For the front-end (lexer, parser, semantic analysis, voodoo), you will want to look at these web pages:
I went through the front end part of the clang (a bit atleast) and I went through some of the documentation on the llvm.org website and was trying to know what happens after the front end is done with the code. Could you tell me how does llvm comes into picture as soon as clang part of the interface deals with the source code.
See clang/lib/Frontend/CodeGenAction.cpp , if I'm understanding the
question correctly. There isn't really anything conceptually
interesting beyond what kaleidoscope does, though.