search for: iter_block

Displaying 11 results from an estimated 11 matches for "iter_block".

Did you mean: iter_blocks
2012 Apr 24
1
[LLVMdev] OCaml binding and basic blocks
Hello everyone, I am using the OCaml binding to read and manipulate llvm bitcode and I have trouble to read the basic blocks of functions. The OCaml functions iter_blocks and fold_left_blocks are always behaving as if the list of blocks is empty, whatever the input file. Also, if I dump the following function: define i32 @add(i32 %x, i32 %y) nounwind uwtable ssp { %1 = alloca i32, align 4 %2 = alloca i32, align 4 %z = alloca i32, align 4 .......
2013 Oct 22
1
[PATCH 2/2] Discard unwritten ranges
...data_start; uint64_t size; lzma_index *idx; /* Open the file. */ fd = open (filename, O_RDONLY); @@ -176,10 +178,29 @@ xzfile_uncompress (const char *filename, const char *outputfile, posix_fadvise (fd, 0, 0, POSIX_FADV_RANDOM|POSIX_FADV_DONTNEED); /* Iterate over blocks. */ iter_blocks (idx, nr_threads, filename, fd, outputfile, ofd); + /* discard ranges that were allocated but not written */ + data_start = 0; + while (data_start < size) { + hole_start = lseek (ofd, data_start, SEEK_HOLE); + if (hole_start == (off_t) -1) + error (EXIT_FAILURE, errno, "lsee...
2008 Dec 31
0
[LLVMdev] llvm ocaml bindings
...ure 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: Instruction::Call: Instructio...
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
2015 Feb 12
8
[PATCH 1/3] macosx: Includes/defines for byteswap operations
--- src/inspect-apps.c | 13 ++++++++++++- src/inspect-fs-windows.c | 6 ++++++ src/journal.c | 5 +++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/inspect-apps.c b/src/inspect-apps.c index 20cf00a..8fbae9c 100644 --- a/src/inspect-apps.c +++ b/src/inspect-apps.c @@ -35,11 +35,22 @@ #include <sys/endian.h> #endif -/* be32toh is usually a macro
2016 Apr 14
3
builder: posix_fadvise fixes.
The way we used posix_fadvise was wrong, and yet right! Rich.
2008 Dec 31
1
[LLVMdev] llvm ocaml bindings
...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 (actually, dyn_cast_or_null<>), which is us...
2015 Feb 12
0
[PATCH 2/3] builder: Check HAVE_POSIX_FADVISE before using it
...reads) unix_error (err, (char *) "ftruncate", outputfilev); } +#if defined HAVE_POSIX_FADVISE /* Tell the kernel we won't read the output file. */ ignore_value (posix_fadvise (fd, 0, 0, POSIX_FADV_RANDOM|POSIX_FADV_DONTNEED)); +#endif /* Iterate over blocks. */ iter_blocks (idx, nr_threads, filenamev, fd, outputfilev, ofd); -- 1.9.3
2016 Apr 14
0
[PATCH 1/2] utils, builder: Add wrappers for posix_fadvise.
..."ftruncate", outputfilev); } -#if defined HAVE_POSIX_FADVISE - /* Tell the kernel we won't read the output file. */ - ignore_value (posix_fadvise (fd, 0, 0, POSIX_FADV_RANDOM|POSIX_FADV_DONTNEED)); -#endif + guestfs_int_fadvise_noreuse (fd); /* Iterate over blocks. */ iter_blocks (idx, nr_threads, filenamev, fd, outputfilev, ofd); diff --git a/src/guestfs-internal-frontend.h b/src/guestfs-internal-frontend.h index 7f10906..1305105 100644 --- a/src/guestfs-internal-frontend.h +++ b/src/guestfs-internal-frontend.h @@ -87,6 +87,11 @@ extern int guestfs_int_is_true (const char...
2016 Mar 06
8
[PATCH 0/5] Use less stack.
Various changes/fixes to use smaller stack frames. Rich.
2016 Mar 07
2
[PATCH v2] Use less stack.
...trm.avail_in = index_size; if (strm.avail_in > BUFSIZ) strm.avail_in = BUFSIZ; - n = read (fd, &buf, strm.avail_in); + n = read (fd, buf, strm.avail_in); if (n == -1) unix_error (errno, (char *) "read", filenamev); @@ -454,12 +459,17 @@ iter_blocks (lzma_index *idx, unsigned nr_threads, value filenamev, int fd, value outputfilev, int ofd) { struct global_state global; - struct per_thread_state per_thread[nr_threads]; - pthread_t thread[nr_threads]; + CLEANUP_FREE struct per_thread_state *per_thread = NULL; + CLEANUP_FRE...