diff options
author | Zachary Turner <zturner@google.com> | 2017-05-03 15:58:37 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2017-05-03 15:58:37 +0000 |
commit | c504ae3cefc0fab043bb76f992045c9770ef87c1 (patch) | |
tree | 1dd725e862fac7c621642cac792d96cf6f5636f3 /llvm/lib/Support/BinaryStreamWriter.cpp | |
parent | 99b925bdf38840a43ed0f57c37fec389f0388148 (diff) | |
download | bcm5719-llvm-c504ae3cefc0fab043bb76f992045c9770ef87c1.tar.gz bcm5719-llvm-c504ae3cefc0fab043bb76f992045c9770ef87c1.zip |
Resubmit r301986 and r301987 "Add codeview::StringTable"
This was reverted due to a "missing" file, but in reality
what happened was that I renamed a file, and then due to
a merge conflict both the old file and the new file got
added to the repository. This led to an unused cpp file
being in the repo and not referenced by any CMakeLists.txt
but #including a .h file that wasn't in the repo. In an
even more unfortunate coincidence, CMake didn't report the
unused cpp file because it was in a subdirectory of the
folder with the CMakeLists.txt, and not in the same directory
as any CMakeLists.txt.
The presence of the unused file was then breaking certain
tools that determine file lists by globbing rather than
by what's specified in CMakeLists.txt
In any case, the fix is to just remove the unused file from
the patch set.
llvm-svn: 302042
Diffstat (limited to 'llvm/lib/Support/BinaryStreamWriter.cpp')
-rw-r--r-- | llvm/lib/Support/BinaryStreamWriter.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/Support/BinaryStreamWriter.cpp b/llvm/lib/Support/BinaryStreamWriter.cpp index d60b75642d0..d78dbc68f59 100644 --- a/llvm/lib/Support/BinaryStreamWriter.cpp +++ b/llvm/lib/Support/BinaryStreamWriter.cpp @@ -59,6 +59,19 @@ Error BinaryStreamWriter::writeStreamRef(BinaryStreamRef Ref, uint32_t Length) { return Error::success(); } +std::pair<BinaryStreamWriter, BinaryStreamWriter> +BinaryStreamWriter::split(uint32_t Off) const { + assert(getLength() >= Off); + + WritableBinaryStreamRef First = Stream.drop_front(Offset); + + WritableBinaryStreamRef Second = First.drop_front(Off); + First = First.keep_front(Off); + BinaryStreamWriter W1{First}; + BinaryStreamWriter W2{Second}; + return std::make_pair(W1, W2); +} + Error BinaryStreamWriter::padToAlignment(uint32_t Align) { uint32_t NewOffset = alignTo(Offset, Align); if (NewOffset > getLength()) |