[PATCH] D98851: [OCaml] Add (get/set)_module_identifer functions

Vaivaswatha Nagaraj via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 18 18:23:52 PDT 2021


vaivaswatha marked an inline comment as done.
vaivaswatha added inline comments.


================
Comment at: llvm/bindings/ocaml/llvm/llvm_ocaml.c:342
+  const char *Name = LLVMGetModuleIdentifier(M, &Len);
+  return cstr_to_string(Name, (mlsize_t)Len);
+}
----------------
jberdine wrote:
> Does this still warn without the cast? I was expecting this cast to be not needed anymore.
I didn't get a warning on my system. I added this to make the conversion explicit, because `size_t` can be strictly larger than `mlsize_t` which is defined to be `unsigned long`. I'm not sure if other systems might throw a warning though.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98851/new/

https://reviews.llvm.org/D98851



More information about the llvm-commits mailing list