Allows for retrieving the type of a metadata node. Has the added benefit of ensuring that the C and C++ kind APIs stay in sync as a failure to add a corresponding LLVMMetadataKind will result in the switch in the accessor being semantically malformed.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
include/llvm-c/DebugInfo.h | ||
---|---|---|
1198 ↗ | (On Diff #167606) | C enums don't have a defined ABI and should never be used in function signatures, because this makes FFI impossible to do correctly without going through something libclang. |
include/llvm-c/DebugInfo.h | ||
---|---|---|
1198 ↗ | (On Diff #167606) | So what's the workaround here? I recognize the ABI concerns given LLVM's stated policy on the C API, but I'm curious to know how this hasn't come up before considering Core.h and DebugInfo.h define and use over 20 different enumerations across their signatures. |
include/llvm-c/DebugInfo.h | ||
---|---|---|
1198 ↗ | (On Diff #167606) | Cast to an integer. I think to unsigned. All other uses of enumerations are a mistake as well; I'm not sure why they were introduced, but ideally they should be fixed. |