[PATCH] D63828: Add FileWriter to GSYM and encode/decode functions to AddressRange and AddressRanges

Greg Clayton via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 1 07:24:11 PDT 2019


clayborg added a comment.

In D63828#1563337 <https://reviews.llvm.org/D63828#1563337>, @MaskRay wrote:

> > It currently uses std::ostream over llvm::raw_ostream because llvm::raw_ostream doesn't support seeking which is required when encoding and decoding GSYM data.
>
> There is raw_fd_ostream::seek. You just need to make sure `raw_fd_ostream::supportsSeeking()` returns true when you open it.


The main issue is being able to write to a memory buffer so we don't need to create a temp file on disk when creating sections or doing unit tests. The only raw_ostream that supports seeking is the fd class, none of the other do and the docs for raw_ostream state that seek isn't supported.  What we would need is a few virtual methods on raw_ostream so that any raw_ostream can support seeking, but I am not sure people would be thrilled by this. For unit tests I was wanting to use raw_string_ostream, but again, no seek is available on the raw_ostream base class.

> #include <iostream> is Forbidden <https://llvm.org/docs/CodingStandards.html#id49>.

It is forbidden in header files only.


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

https://reviews.llvm.org/D63828





More information about the llvm-commits mailing list