search for: iter_functions

Displaying 4 results from an estimated 4 matches for "iter_functions".

Did you mean: filter_functions
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 Llvm_bitwriter. Is there something more specific you want to do? On Mon, Dec 29, 2008 at 6:05 PM, Ranjit Jhala <jhala at cs.ucsd.edu> wrote: > Hi Erick -- > > many thanks for writing the ocaml bindings...
2008 Dec 31
0
[LLVMdev] llvm ocaml bindings
...s Chris and Gordon for the fantasic infrastructure and ocaml bindings and Erick for the prompt response! I'm looking to use LLVM to write program analyses for C/C++ programs, but to use Ocaml to write the analyses. I did see there were bindings for iterating over: * functions in a module [iter_functions] * basic blocks in a functions [iter_blocks] * instructions in a block [iter_instrs] The other things that i'd like are to know what kind of instruction a given instruction was. That is, (a) some ML encoding of the different opcodes like Instruction::Ret: Instruction::Invoke:...
2008 Dec 31
1
[LLVMdev] llvm ocaml bindings
...sic infrastructure and ocaml > bindings and Erick for the prompt response! > > I'm looking to use LLVM to write program analyses for > C/C++ programs, but to use Ocaml to write the analyses. > I did see there were bindings for iterating over: > > * functions in a module [iter_functions] > * basic blocks in a functions [iter_blocks] > * instructions in a block [iter_instrs] > > The other things that i'd like are to know what kind of > instruction a given instruction was. Hi Ranjit, There are recently aded C bindings for the "isa<>" template (ac...
2013 Jan 14
0
[LLVMdev] OCaml binding: error with the function "has_metadata"
...************* let load_module filename = let mb = Llvm.MemoryBuffer.of_file filename in Llvm_bitreader.parse_bitcode (Llvm.global_context ()) mb let stats m = let print llvalue = if Llvm.has_metadata llvalue then Printf.printf "%s\n%!" (Llvm.value_name llvalue) in Llvm.iter_functions print m let _ = let m = load_module Sys.argv.(1) in stats m ************************************* Does anbody know if I am doing something wrong ? or the OCaml binding is brocken for the function "has_metadata" ? I have the same error on Linx (ubuntu 12.04) and Mac...