diff options
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/DebugInfo/MSF/MSFBuilder.h | 7 | ||||
| -rw-r--r-- | llvm/include/llvm/DebugInfo/PDB/Native/PDBFileBuilder.h | 2 | ||||
| -rw-r--r-- | llvm/include/llvm/Support/BinaryByteStream.h | 12 |
3 files changed, 19 insertions, 2 deletions
diff --git a/llvm/include/llvm/DebugInfo/MSF/MSFBuilder.h b/llvm/include/llvm/DebugInfo/MSF/MSFBuilder.h index c06a0b4687d..3de98c4ecba 100644 --- a/llvm/include/llvm/DebugInfo/MSF/MSFBuilder.h +++ b/llvm/include/llvm/DebugInfo/MSF/MSFBuilder.h @@ -20,6 +20,8 @@ #include <vector> namespace llvm { +class FileBufferByteStream; +class WritableBinaryStream; namespace msf { class MSFBuilder { @@ -109,7 +111,10 @@ public: /// Finalize the layout and build the headers and structures that describe the /// MSF layout and can be written directly to the MSF file. - Expected<MSFLayout> build(); + Expected<MSFLayout> generateLayout(); + + /// Write the MSF layout to the underlying file. + Expected<FileBufferByteStream> commit(StringRef Path, MSFLayout &Layout); BumpPtrAllocator &getAllocator() { return Allocator; } diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/PDBFileBuilder.h b/llvm/include/llvm/DebugInfo/PDB/Native/PDBFileBuilder.h index 58dda71bf35..7f9c4cf9fa8 100644 --- a/llvm/include/llvm/DebugInfo/PDB/Native/PDBFileBuilder.h +++ b/llvm/include/llvm/DebugInfo/PDB/Native/PDBFileBuilder.h @@ -76,7 +76,7 @@ private: std::unique_ptr<MemoryBuffer> Content; }; - Expected<msf::MSFLayout> finalizeMsfLayout(); + Error finalizeMsfLayout(); Expected<uint32_t> allocateNamedStream(StringRef Name, uint32_t Size); void commitFpm(WritableBinaryStream &MsfBuffer, const msf::MSFLayout &Layout); diff --git a/llvm/include/llvm/Support/BinaryByteStream.h b/llvm/include/llvm/Support/BinaryByteStream.h index f39ac4e2413..9808d3b7215 100644 --- a/llvm/include/llvm/Support/BinaryByteStream.h +++ b/llvm/include/llvm/Support/BinaryByteStream.h @@ -222,6 +222,12 @@ private: return Error::success(); } + /// Returns a pointer to the start of the buffer. + uint8_t *getBufferStart() const { return FileBuffer->getBufferStart(); } + + /// Returns a pointer to the end of the buffer. + uint8_t *getBufferEnd() const { return FileBuffer->getBufferEnd(); } + private: std::unique_ptr<FileOutputBuffer> FileBuffer; }; @@ -253,6 +259,12 @@ public: Error commit() override { return Impl.commit(); } + /// Returns a pointer to the start of the buffer. + uint8_t *getBufferStart() const { return Impl.getBufferStart(); } + + /// Returns a pointer to the end of the buffer. + uint8_t *getBufferEnd() const { return Impl.getBufferEnd(); } + private: StreamImpl Impl; }; |

