adrian-prantl wrote:

> Why does this use tablegen to parse a .def file?
> 
> Can't you get the same behavior without tablegen, using normal xmacro 
> techniques, something like
> 
> ```c++
> enum SBSourceLanguageName : uint16_t {
> 
> #define HANDLE_DW_LNAME(ID, NAME, DESC, LOWER_BOUND) \
>   eLanguageName ## NAME = ID,
> 
> #include "llvm/include/llvm/BinaryFormat/Dwarf.def"
> 
> #undef HANDLE_DW_LNAME
> 
> };
> ```
> 
> ? Why bring tablegen into this?
> 
> (Sorry if I'm missing something obvious.)

That's a very valid question to ask!
The reason is that the header files produced here are part of the LLDB 
scripting API and are going to be processed by tools that are not full 
compilers and fully expanding this at compile-time avoids any compatibility 
issues with not fully compliant interface generators. The reason why this is 
implemented in C++ is because I don't want to assume that there is `sed` or 
something equivalent available on the build system especially on platforms like 
Windows.

https://github.com/llvm/llvm-project/pull/89981
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to