[PATCH] D136400: [llvm-ocaml] Migrate from naked pointers to prepare for OCaml 5

Dmitrii Kosarev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 18 14:36:30 PST 2023


Kakadu added a comment.

I think only minor quirks are left here. @alan , if you are going to make other patches about OCaml, don't hesitate to ping me.



================
Comment at: llvm/bindings/ocaml/llvm/llvm_ocaml.c:662
+  CAMLlocal1(Tys);
+  unsigned Length = LLVMCountStructElementTypes(Type_val(StructTy));
+  LLVMTypeRef *Temp = malloc(sizeof(LLVMTypeRef) * Length);
----------------
In the function above we can see the usage of size_t instead of unsigned. I'm far from being expert about C++, but heard that size_t should be preferred nowadays. Is it? If you are going to change, than in other functions probably too.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136400



More information about the llvm-commits mailing list