[PATCH] D78797: [Support] Refactor LEB128 decoding into an output iterator

Nicolas Guillemot via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 23 23:57:34 PDT 2020


nlguillemot created this revision.
nlguillemot added reviewers: bogner, qcolombet, fhahn.
nlguillemot added a parent revision: D78796: [Support] Refactor LEB128 encoding into an input iterator.
nlguillemot added a comment.
nlguillemot updated this revision to Diff 259818.

The end goal of this series of patches is to support encoding/decoding `APInt` to/from `[U|S]LEB128`. This patch is an initial step in that direction. It refactors the logic to avoid code duplication and makes the interface to LEB128 decoding more generic.

In a later patch, I'd like to do some template magic to support `LEB128OutputIterator<APInt>` in a way that tries to share code with the `uint64_t`/`int64_t` implementations.


nlguillemot added a comment.

Forgot to include a few changes in the original diff that was posted.


Refactors the logic for LEB128 decoding into a std iterator style output
iterator. This allows LEB128 decoding to be used as the output of std
algorithms. Furthermore, this patch refactors the existing LEB128 decoding
functions to use this new interface.


https://reviews.llvm.org/D78797

Files:
  llvm/include/llvm/Support/LEB128.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78797.259818.patch
Type: text/x-patch
Size: 6550 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200424/ffdee543/attachment.bin>


More information about the llvm-commits mailing list