[llvm-commits] [PATCH] Extend the builder interface to use the new instruction positioning code.
Erick Tryzelaar
idadesub at users.sourceforge.net
Sun Mar 23 20:25:54 PDT 2008
This builds off of the code gordonh recently added for manipulating
iterators. This adds support for instruction iterators, as well as
rewriting the builder code to use these new functions. This lets us
eliminate the c bindings for moving around the builder. It also adds some
convenience functions like "builder_at_start".
One minor optimization would be to actually leave position_before and
position_at_end implemented in c, and have:
let position_builder pos b =
match pos with
| Before i => position_before i
| At_end bb => position_at_end bb
As this might let ocaml optimize away the match in certain circumstances.
However, I'm not sure if the overhead is really that bad, and if ocaml
can even do this.
---
bindings/ocaml/llvm/llvm.ml | 74 ++++++++++++++++++++++++++++++++++---
bindings/ocaml/llvm/llvm.mli | 76 ++++++++++++++++++++++++++++++++++---
bindings/ocaml/llvm/llvm_ocaml.c | 38 +++++++-----------
3 files changed, 152 insertions(+), 36 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: c3fa031637f0696680cef246a141c36f21b78a93.diff
Type: text/x-patch
Size: 11117 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20080323/a39ebc24/attachment.bin>
More information about the llvm-commits
mailing list