diff options
| author | Zachary Turner <zturner@google.com> | 2017-02-28 00:04:07 +0000 |
|---|---|---|
| committer | Zachary Turner <zturner@google.com> | 2017-02-28 00:04:07 +0000 |
| commit | 695ed56ba5d3bd3b86c6a4ed6d79b89eb8fbd2f4 (patch) | |
| tree | caf35bd7345bb071545ef39b636b40ffafc41504 /llvm/unittests/DebugInfo/PDB/StringTableBuilderTest.cpp | |
| parent | 59cd89332010b22e82c3110d558ff37948c4df1e (diff) | |
| download | bcm5719-llvm-695ed56ba5d3bd3b86c6a4ed6d79b89eb8fbd2f4.tar.gz bcm5719-llvm-695ed56ba5d3bd3b86c6a4ed6d79b89eb8fbd2f4.zip | |
[PDB] Make streams carry their own endianness.
Before the endianness was specified on each call to read
or write of the StreamReader / StreamWriter, but in practice
it's extremely rare for streams to have data encoded in
multiple different endiannesses, so we should optimize for the
99% use case.
This makes the code cleaner and more general, but otherwise
has NFC.
llvm-svn: 296415
Diffstat (limited to 'llvm/unittests/DebugInfo/PDB/StringTableBuilderTest.cpp')
| -rw-r--r-- | llvm/unittests/DebugInfo/PDB/StringTableBuilderTest.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/unittests/DebugInfo/PDB/StringTableBuilderTest.cpp b/llvm/unittests/DebugInfo/PDB/StringTableBuilderTest.cpp index bc5420038e6..aecffbe9b01 100644 --- a/llvm/unittests/DebugInfo/PDB/StringTableBuilderTest.cpp +++ b/llvm/unittests/DebugInfo/PDB/StringTableBuilderTest.cpp @@ -19,6 +19,7 @@ using namespace llvm; using namespace llvm::pdb; +using namespace llvm::support; namespace { class StringTableBuilderTest : public ::testing::Test {}; @@ -33,12 +34,12 @@ TEST_F(StringTableBuilderTest, Simple) { EXPECT_EQ(9U, Builder.insert("baz")); std::vector<uint8_t> Buffer(Builder.finalize()); - MutableBinaryByteStream OutStream(Buffer); + MutableBinaryByteStream OutStream(Buffer, little); BinaryStreamWriter Writer(OutStream); EXPECT_NO_ERROR(Builder.commit(Writer)); // Reads the contents back. - BinaryByteStream InStream(Buffer); + BinaryByteStream InStream(Buffer, little); BinaryStreamReader Reader(InStream); StringTable Table; EXPECT_NO_ERROR(Table.load(Reader)); |

