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".
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 usingclang_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".