[llvm] [C API] Add bindings for DWARF type encoding.wq (PR #102171)

via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 8 13:11:28 PDT 2024


deadalnix wrote:

> Why is that a difficulty?

Because you end up having to process the def file to produce the binding in a foreign language from said foreign language. The syntax differs from C and you most likely don't have access to a preprocessor, so you end up having to write an ad hoc parser for the def file, or just wing it and implement something hoping it matches what will be generated on the other hand from the def file, without being able to check. When you screw up with the wing it strategy, you don't end up with an error, but something going from the program does the wrong thing, to memory/stack gets corrupted because of ABI mismatch.

On the other hand, looking at a list of names an values in an enum can easily be checked with a diff tool, even accross languages.

https://github.com/llvm/llvm-project/pull/102171


More information about the llvm-commits mailing list