I'd like to write a self-hosting LLVM compiler. How should I interface with the LLVM middle-end optimizers and back-end code generators?

Your compiler front-end will communicate with LLVM by creating a module in the LLVM intermediate representation (IR) format. Assuming you want to write your language's compiler in the language itself (rather than C++), there are 3 major ways to tackle generating LLVM IR from a front-end: • Call into the LLVM libraries code using your language's FFI (foreign function interface). €¢ for: best tracks changes to the LLVM IR, .

Ll syntax, and . Bc format • for: enables running LLVM optimization passes without a emit/parse overhead • for: adapts well to a JIT context • against: lots of ugly glue code to write • Emit LLVM assembly from your compiler's native language. €¢ for: very straightforward to get started • against: the .

Ll parser is slower than the bitcode reader when interfacing to the middle end • against: you'll have to re-engineer the LLVM IR object model and asm writer in your language • against: it may be harder to track changes to the IR • Emit LLVM bitcode from your compiler's ... more.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions