Resources on Writing Compiler Backends for OO Languages?
Greetings Overflowers,
I am trying to deeply understand how one can develop an x86 (ia32/ia64) backend for OO languages (staticly/dynamically tryped), mainly to be run on Windows OS.
I have a good understanding of the x86 architecture, Windows ar开发者_如何学JAVAchitecture and how to get a code to the tree level ready to be optimized and serialized into machine native code.
It is just that step (serialization) that I do not really grasp and I want to learn more about. For example, is there standard x86 set of serialized instructions for a loop node in the code tree ?
I am trying to read through compiler books now, but are there specific materials (books, tutorials, projects... etc) to that subject ?
How about using the C language as an intermediate language and make use of some ready-made C compilers as a backend, such as ICC for their excellent optimizations ?
Many Thanks for You All !
Yes, you can output another language such as C and then compile that to your platform's machine language. Cfront, the original C++ compiler did exactly that.
Another possibility would be to use LLVM which gives you an abstract API for generating machine language.
精彩评论