[PATCH] D19641: Add an alternative to LLVMMDNode that will only accept metadata as argument.

whitequark via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 15 04:08:13 PDT 2017


whitequark added a comment.
This revision now requires changes to proceed.

Do I understand it correctly that LLVMMetadataRef is going to effectively become a subtype of LLVMValueRef? I.e. it is (and will be, indefinitely) legal to pass an LLVMMetadataRef anywhere you can pass LLVMValueRef, but not vice versa?

Further, do I understand it correctly that the final signatures should look something like:

  LLVMMetadataRef LLVMMDString(const char *Str, unsigned SLen)
  LLVMMetadataRef LLVMCreateMDNode(LLVMContextRef C, LLVMMetadataRef *Vals, unsigned Count)
  LLVMMetadataRef LLVMValueAsMetadata(LLVMValueRef Val)

and so on?

And is it correct that LLVMMDNode function should be deprecated because everywhere else, the taken `LLVMValueRef` already *must* refer to metadata, but that's not true for `LLVMMDNode`?

In that case I agree with @deadalnix that we should not deprecate these 13 functions as this is not really a breakage of ABI contract, and it is sufficient to go through a single deprecation cycle removing just the `LLVMMDNode` function.


https://reviews.llvm.org/D19641





More information about the llvm-commits mailing list