well-typed / hs-bindgen

Automatically generate Haskell bindings from C header files
13 stars 0 forks source link

Introduce `clang_getCursorKind` #150

Closed edsko closed 1 week ago

edsko commented 1 week ago

We were using clang_getCursorType to determine what kind of AST element we were dealing with, but that's not quite right; we should instead be using clang_getCursorKind. For example, this tells us that we are dealing with an enum declaration (which happens to be reported as type enum); this matters in some cases, for example, a macro definition does not have any associated type (reported as "invalid"), but is reported as cursor kind "macro definition".