search for: llinstr

Displaying 3 results from an estimated 3 matches for "llinstr".

2008 Dec 31
0
[LLVMdev] llvm ocaml bindings
...w what kind of instruction a given instruction was. That is, (a) some ML encoding of the different opcodes like Instruction::Ret: Instruction::Invoke: Instruction::Call: Instruction::Malloc: Instruction::Alloca: etc. e.g. encoded as an Ocaml type "llinstr" ? (b) ML bindings for functions like Instruction::getOpcode e.g. functions like val instr_of_value : llvalue -> llinstr val value_is_instr : llvalue -> bool etc. Are these available somewhere ? Even if they are not, I am happy to try to add these bindings ... Thank...
2008 Dec 30
2
[LLVMdev] llvm ocaml bindings
(ccing llvmdev) Hi Ranjit! I only ported Chris's tutorial and Gordon did the vast majority of the bindings, so they deserve most of the praise. I believe there are techniques for walking over the CFG. You can load up code using Llvm_bitreader, use things like Llvm.iter_globals, Llvm.iter_functions, and Llvm.iter_instrs to walk over the module, and write out a new llmodule using
2008 Dec 31
1
[LLVMdev] llvm ocaml bindings
...tters. Re exposing the type ID as an Ocaml variant type, consider that there is no type ID for Instruction, since it is abstract; matching an instruction would therefore be extremely inconvenient, and would be brittle with respect to additions or changes to the Value class hierarchy. > llinstr Adding Ocaml types for each llvm::Value class seems inadvisable to me. You can certainly try it, but I expect the result would be unusably cumbersome. — Gordon