[PATCH] D90831: DebugInfo support for OCaml bindings
Josh Berdine via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 15 13:54:03 PDT 2021
jberdine added inline comments.
================
Comment at: llvm/bindings/ocaml/debuginfo/debuginfo_ocaml.c:168
+ LLVMDIFlags Flags = 0;
+ Flags |= map_DIFlag(Int_val(i_Flag));
+ return alloc_diflags(Flags);
----------------
vaivaswatha wrote:
> jberdine wrote:
> > why `|`?
> This is strange. I can't recall why I used `|=`. It's likely that it was an overlook / typo. I've fixed this now. Thank you for catching this !
Maybe it was just left over from copy/paste from ..._set below
================
Comment at: llvm/bindings/ocaml/debuginfo/llvm_debuginfo.mli:1
+(*===-- llvm_debuginfo.mli - LLVM OCaml Interface --------------*- OCaml -*-===*
+ *
----------------
================
Comment at: llvm/bindings/ocaml/llvm/llvm_ocaml.c:47-55
+CAMLprim value cstr_to_string(const unsigned char *Str, unsigned Len) {
+ value String;
+ if (Str) {
+ String = caml_alloc_initialized_string(Len, Str);
+ } else {
+ String = caml_alloc_string(0);
+ }
----------------
I'm sorry for the poor suggestion before, but looking again I think this code needs to use CAMLlocal, etc.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D90831/new/
https://reviews.llvm.org/D90831
More information about the llvm-commits
mailing list