[PATCH] D52693: [LLVM-C] Add an accessor for the kind of a Metadata Node

whitequark via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 29 08:50:52 PDT 2018


whitequark added inline comments.


================
Comment at: include/llvm-c/DebugInfo.h:1198
+ */
+LLVMMetadataKind LLVMGetMetadataKind(LLVMMetadataRef Metadata);
+
----------------
CodaFi wrote:
> whitequark wrote:
> > 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.
> 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.
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.


Repository:
  rL LLVM

https://reviews.llvm.org/D52693





More information about the llvm-commits mailing list