This is an archive of the discontinued LLVM Phabricator instance.

OCaml bindings: Add functions for accessing metadata nodes
ClosedPublic

Authored by destrius on Apr 19 2016, 11:07 PM.

Details

Summary

Added llvm_get_mdnode_operands function, which allow access to the operands inside an MDNode.

Diff Detail

Repository
rL LLVM

Event Timeline

destrius updated this revision to Diff 54320.Apr 19 2016, 11:07 PM
destrius retitled this revision from to OCaml bindings: Add functions for accessing metadata nodes.
destrius updated this object.
destrius added a reviewer: whitequark.
whitequark added inline comments.Apr 19 2016, 11:10 PM
bindings/ocaml/llvm/llvm.mli
857 ↗(On Diff #54320)

I don't think this function is useful.

861 ↗(On Diff #54320)

Please add a test for this one.

destrius updated this revision to Diff 54820.Apr 25 2016, 1:02 AM

Removed get_mdnode_count function, and added a test in test/Bindings/OCaml/core.ml. Not sure if the test works right as I can't run the test suite properly on my system right now.

whitequark accepted this revision.Apr 25 2016, 11:18 AM
whitequark edited edge metadata.

LGTM, but please commit once you are certain that tests are pass.

This revision is now accepted and ready to land.Apr 25 2016, 11:18 AM
destrius updated this revision to Diff 54982.Apr 26 2016, 6:59 AM
destrius retitled this revision from OCaml bindings: Add functions for accessing metadata nodes to OCaml bindings: Add functions for accessing metadata nodes, fixed tests.
destrius edited edge metadata.

Fixed a missing semicolon in the test for get_mdnode_operands.

Fixed a bunch of tests in test/Bindings/OCaml/core.ml, allowing the check-llvm-bindings-ocaml test suite to complete successfully with no errors.

Also, it turns out that the tests had been marked as unsupported in lit.local.cfg, so they don't run by default. I'm leaving that as it is because I don't think I'm in a position to decide whether or not to change it back to supported.

whitequark requested changes to this revision.Apr 26 2016, 11:38 AM
whitequark edited edge metadata.
whitequark added inline comments.
test/Bindings/OCaml/core.ml
1168 ↗(On Diff #54982)

Just remove this. That interface will need to be redone.

1200 ↗(On Diff #54982)

The personality function is now a part of the function signature, so please move the check there.

1454 ↗(On Diff #54982)

Ditto, remove.

This revision now requires changes to proceed.Apr 26 2016, 11:38 AM
destrius updated this revision to Diff 61339.Jun 21 2016, 12:42 AM
destrius retitled this revision from OCaml bindings: Add functions for accessing metadata nodes, fixed tests to OCaml bindings: Add functions for accessing metadata nodes.
destrius updated this object.
destrius edited edge metadata.

New diff is against current (21/06/16) git repository. Fixes to the OCaml bindings tests have been added there, so we only need to add the test for get_mdnode_operands.

Sorry for taking so long on this, was caught up with work.

whitequark accepted this revision.Jun 21 2016, 2:45 AM
whitequark edited edge metadata.

LGTM

This revision is now accepted and ready to land.Jun 21 2016, 2:45 AM

Thanks! I'm a bit unsure how to proceed now, since I don't have commit
access to the repository. Could you help me do the commit, or is there some
procedure by which I can add it to some commit queue?

Thanks,
Xinyu

This revision was automatically updated to reflect the committed changes.