[LLVMdev] Reading Instructions from Ocaml

Gregory Malecha gmalecha at gmail.com
Mon Jun 13 20:53:44 PDT 2011


Hi Erick,

Are you suggesting that if I want to write my transformations in ocaml then
I need to write a bitcode parser for ocaml?

It doesn't seem like I'd have to add a whole lot to get that functionality,
if I could access the class ids from ocaml and get some extra information
then I could extract an ADT:

type instr =
  | Load of .. | Store of .. | ...etc...
  | Unknown of ...

What part of this wouldn't be portable?

On Mon, Jun 13, 2011 at 7:11 PM, Erick Tryzelaar <
idadesub at users.sourceforge.net> wrote:

> On Mon, Jun 13, 2011 at 12:09 PM, Gregory Malecha <gmalecha at gmail.com>
> wrote:
> > Hello,
>
> Hello Gregory,
>
> > I'm interested in the OCaml bindings, but I've been digging through them
> and
> > it doesn't seem possible to actually write a transformation with them.
> > Specifically, there are a lot of functions to build each type of
> > instruction, but there doesn't seem to be any way to query an llvalue and
> > determine what kind of instruction it is. Is there something that I am
> > missing?
>
> Unfortunately you'll have to write your transformations in C++. That
> functionality is purposely left unexposed in order to keep the llvm-c
> API stable, and allow the C++ API to evolve over time.
>



-- 
gregory malecha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110613/5d305bed/attachment.html>


More information about the llvm-dev mailing list