This is an archive of the discontinued LLVM Phabricator instance.

[OCaml] Add OCaml API for LLVMGetIndices
ClosedPublic

Authored by jberdine on Sep 17 2018, 6:24 PM.

Details

Summary

This patch adds a thin wrapper around LLVMGetNumIndices and
LLVMGetIndices to return the indices of ExtractValue or InsertValue
instructions as an OCaml array. It has not seemed to be necessary to
expose LLVMGetNumIndices separately.

Diff Detail

Event Timeline

jberdine created this revision.Sep 17 2018, 6:24 PM
whitequark added inline comments.Sep 17 2018, 6:36 PM
bindings/ocaml/llvm/llvm.mli
813

I think this function returns the indices, not the *number* of indices.

whitequark added inline comments.Sep 17 2018, 6:38 PM
bindings/ocaml/llvm/llvm_ocaml.c
733

Val_indices, by OCaml conventions, is the name for a function that makes an OCaml value from a C value indices, which is a bit confusing. Just indices would be nicer.

jberdine updated this revision to Diff 165937.Sep 18 2018, 4:39 AM
jberdine marked 2 inline comments as done.

fix doc, rename Val_indices

bindings/ocaml/llvm/llvm.mli
813

Indeed, nice catch.

whitequark accepted this revision.Sep 18 2018, 6:31 AM
This revision is now accepted and ready to land.Sep 18 2018, 6:31 AM
This revision was automatically updated to reflect the committed changes.