I agree with you that gcc is much less pleasant than LLVM+Clang, but to say that LLVM is better becauses it uses C++ everywhere is simply incorrect. In fact, using this kind of DSL for backend definitions is good design.
I agree with you that gcc is much less pleasant than LLVM+Clang, but to say that LLVM is better becauses it uses C++ everywhere is simply incorrect. In fact, using this kind of DSL for backend definitions is good design.
A large part of any LLVM backend is actually custom C++ code for matching and expanding patterns which the pattern matcher either can't or is unwilling to do (e.g. custom backend-specific DAG nodes). I direct you at this file:
https://github.com/llvm-mirror/llvm/blob/master/lib/Target/X...
github will give you a warning before loading it because that single C++ source file is over a megabyte...
Note that I am not complaining about the DSL, just how things are quite difficult to figure out (and untyped macros, as stated above).