For modern compiler and a more direct approach I recommend https://www.cs.cornell.edu/~asampson/blog/llvm.html