3 ms·
I think we can all agree that LLVM IR is a more powerful compilation target than C. However, what Pizlo was saying is that generating C can be simpler than gene
by ufo 7y ago
I think we can all agree that LLVM IR is a more powerful compilation target than C. However, what Pizlo was saying is that generating C can be simpler than generating LLVM IR. A bunch of printfs can get you very far.
- pizlonator 7y agoThere are very few things that you can say in LLVM IR that you can't say in C.
- ufo 7y agoI use C as a target for my own compiler and I agree that there are very few things that I miss. But the ones we do miss do stick out like a sore thumb. One of the main ones for me is a way to get an accurate stack map for precise garbage collection. With C you usually gotta go for a conservative GC, or you need to maintain a shadow stack. (Although I'll admit that the GC story with LLVM isn't super great either)
- ethelward 7y agoExcept for _e.g._ memory alignment, or types of a given width (until C99).
- pizlonator 7y agoFor lots of us the extensions that gcc and clang support are part of C. So, a backend that emits C would get access to those things if it wanted.