This is an archive of the discontinued LLVM Phabricator instance.

Remove manual byte counting from internal Stream methods.
ClosedPublic

Authored by teemperor on Aug 13 2018, 5:04 PM.

Details

Summary

This patch removes the manual byte counting in all internal Stream methods.
This is now done by the automatic byte counting provided by calling GetWrittenBytes()
before and after writing the data (which is automatically done for us by the ByteDelta
utility class).

Diff Detail

Repository
rL LLVM

Event Timeline

teemperor created this revision.Aug 13 2018, 5:04 PM
labath added a subscriber: labath.Aug 14 2018, 9:45 AM

What would you say to moving this class to the header, so that it can be used in all the other byte-counting patches too?

teemperor updated this revision to Diff 160697.Aug 14 2018, 2:58 PM
  • Made ByteDelta public.
  • Minor fixes.

@labath It sounds reasonable to make ByteDelta public. It certainly improves the byte-counting code outside of Stream, even though it hopefully doesn't encourage anyone to do even more byte-counting in LLDB. (Also thanks for reviewing!)

teemperor added a reviewer: Restricted Project.Aug 28 2018, 10:27 AM
JDevlieghere added a subscriber: JDevlieghere.

Neat, LGTM!

This revision is now accepted and ready to land.Sep 11 2018, 9:11 AM
This revision was automatically updated to reflect the committed changes.