[PATCH] D60810: [Support] Add LEB128 support to BinaryStreamReader/Writer.
Lang Hames via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 17 08:42:07 PDT 2019
lhames marked an inline comment as done.
lhames added a comment.
Thanks Dave!
================
Comment at: lib/Support/BinaryStreamReader.cpp:64-68
+ do {
+ if (auto Err = readBytes(NextByte, 1))
+ return Err;
+ EncodedBytes.push_back(NextByte[0]);
+ } while (NextByte[0] & 0x80);
----------------
dblaikie wrote:
> Wonder if it's worth rewriting decodeULEB128 as a template (so it can read from different sources without having to buffer it all into an array (& in doing that buffering, having to reimplement the 0x80 check piece))?
Yep — I considered that, but it would involve teaching decodeULEB128 to deal with sources that potentially generate errors. Since ULEB128 encoding isn’t built for speed anyway (prefix-based variable length encodings are better for that) I did not think the complication was worth it.
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D60810/new/
https://reviews.llvm.org/D60810
More information about the llvm-commits
mailing list