Hacker News new | past | comments | ask | show | jobs | submit login

That'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".



GCC supports external dynamically loaded plugins since 4.5.0 (3 years ago)

http://gcc.gnu.org/onlinedocs/gccint/Plugins.html

The wiki has links to some plugins too http://gcc.gnu.org/wiki/plugins


Sure, 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.


If 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.


Thats 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?


Sure, I was just arguing possibility, not feasibility.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: