[PATCH] D78796: [Support] Refactor LEB128 encoding into an input iterator

Nicolas Guillemot via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 24 23:12:21 PDT 2020


nlguillemot updated this revision to Diff 260067.
nlguillemot marked an inline comment as done.
nlguillemot added a comment.

Updated comments about zext to include a mention of sext.

  diff
  diff --git a/llvm/include/llvm/Support/LEB128.h b/llvm/include/llvm/Support/LEB128.h
  --- a/llvm/include/llvm/Support/LEB128.h
  +++ b/llvm/include/llvm/Support/LEB128.h
  @@ -35,7 +35,7 @@ template <class ValueT> class LEB128InputIterator {
     /// Whether there will be more output after the previously outputted byte.
     bool More;
  
  -  /// The output will be zext-ed to this number of bytes if necessary.
  +  /// The output will be sext-ed/zext-ed to this number of bytes if necessary.
     unsigned PadTo;
  
     /// The current number of outputted bytes.
  @@ -87,8 +87,9 @@ public:
     /// If IsSigned is true, then it encodes as SLEB128. If it's false, it encodes
     /// as ULEB128.
     ///
  -  /// \param PadTo ZExt the output to this number of bytes if fewer than this
  -  /// number of bytes have been outputted.
  +  /// \param PadTo Pads the output to this number of bytes if fewer than this
  +  /// number of bytes have been outputted. If IsSigned is true, then the padding
  +  /// is sign-extended. If IsSigned is false, then it's zero-extended.
     explicit LEB128InputIterator(ValueT Value, bool IsSigned, unsigned PadTo)
         : IsEnd(false), Value(std::move(Value)), IsSigned(IsSigned), PadTo(PadTo),
           Count(0) {


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78796/new/

https://reviews.llvm.org/D78796

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78796.260067.patch
Type: text/x-patch
Size: 10284 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200425/720cf688/attachment.bin>


More information about the llvm-commits mailing list