[PATCH] D47179: [LLVM-C] Add Bindings For Named Metadata

Robert Widmann via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 27 11:36:33 PDT 2018


CodaFi added inline comments.


================
Comment at: include/llvm-c/Core.h:898
+ */
+const char *LLVMGetNamedMetadataName(LLVMNamedMDNodeRef NamedMD, size_t *NameLen);
+
----------------
Wallbraker wrote:
> CodaFi wrote:
> > Wallbraker wrote:
> > > Should this be disposed with LLVMDisposeMessage? Please update comment to reflect this.
> > No.  In general, `Get`-named things return objects managed by somebody else.  `Copy`-named things (or, unfortunately, functions documented to the contrary) return user-owned objects.  In this case, the module owns the named metadata which owns its name.
> Ah okay, so it's not consistent over the API? Even more reason to put it in the doc-comment of this function.
The exceptional cases are what deserve doc comments, and they are documented.  Otherwise I would have to re-annotate the entire C API which is out of scope for this patch and would be noise.

It would be good to go through and audit these things, though.  The C API is quite old and could use some standardization here.


https://reviews.llvm.org/D47179





More information about the llvm-commits mailing list