5 ms·
This is exactly GCC's architecture as well, where front-ends are transpiled into a generic language, which is then compiled into native code for a given platfor
by statusgraph 13y ago
This is exactly GCC's architecture as well, where front-ends are transpiled into a generic language, which is then compiled into native code for a given platform.
- cperciva 13y agoThat's how GCC works internally, but neither the front-ends nor the back-ends are available to use individually. Indeed, RMS specifically avoided having a flexible architecture similar to llvm, because he was afraid such flexibility would be used for non-GPL "plugins".
- foobarbazqux 13y agoIf you can dump or generate the IR you can use the front or back ends as you please, no? You might have to write something that reads in the IR.
- justincormack 13y agoThats a lot of work for what you get out of the box with clang. There is a whole community of tooling around llvm for these types of use case, so why use gcc?
- foobarbazqux 13y agoSure, I was just arguing possibility, not feasibility.
- __alexs 13y agoGCC supports external dynamically loaded plugins since 4.5.0 (3 years ago) http://gcc.gnu.org/onlinedocs/gccint/Plugins.html http://gcc.gnu.org/onlinedocs/gccint/Plugins.html The wiki has links to some plugins too http://gcc.gnu.org/wiki/plugins http://gcc.gnu.org/wiki/plugins
- chongli 13y agoSure, but what about the inverse? With LLVM you can use frontends as libraries for integrating into an (possibly non-free) IDE for completion, syntax highlighting, refactoring etc. This is especially powerful because you can avoid serialization and just keep the ASTs in memory. I'm not aware of this being possible with GCC, but I could be wrong.