From 7dba20bd2b0767ff6be93d7d68a3045d060a7e22 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Tue, 2 May 2017 23:36:17 +0000 Subject: Make codeview::StringTable. Previously we had knowledge of how to serialize and deserialize a string table inside of DebugInfo/PDB, but the string table that it serializes contains a piece that is actually considered CodeView and can appear outside of a PDB. We already have logic in llvm-readobj and MCCodeView to read and write this format, so it doesn't make sense to duplicate the logic in DebugInfoPDB as well. This patch makes codeview::StringTable (for writing) and codeview::StringTableRef (for reading), updates DebugInfoPDB to use these classes for its own writing, and updates llvm-readobj to additionally use StringTableRef for reading. It's a bit more difficult to get MCCodeView to use this for writing, but it's a logical next step. llvm-svn: 301986 --- llvm/unittests/DebugInfo/PDB/StringTableBuilderTest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/unittests/DebugInfo/PDB/StringTableBuilderTest.cpp') diff --git a/llvm/unittests/DebugInfo/PDB/StringTableBuilderTest.cpp b/llvm/unittests/DebugInfo/PDB/StringTableBuilderTest.cpp index 514cdc8d578..44cc85d9e44 100644 --- a/llvm/unittests/DebugInfo/PDB/StringTableBuilderTest.cpp +++ b/llvm/unittests/DebugInfo/PDB/StringTableBuilderTest.cpp @@ -33,7 +33,7 @@ TEST_F(StringTableBuilderTest, Simple) { EXPECT_EQ(1U, Builder.insert("foo")); EXPECT_EQ(9U, Builder.insert("baz")); - std::vector Buffer(Builder.finalize()); + std::vector Buffer(Builder.calculateSerializedSize()); MutableBinaryByteStream OutStream(Buffer, little); BinaryStreamWriter Writer(OutStream); EXPECT_NO_ERROR(Builder.commit(Writer)); @@ -42,7 +42,7 @@ TEST_F(StringTableBuilderTest, Simple) { BinaryByteStream InStream(Buffer, little); BinaryStreamReader Reader(InStream); PDBStringTable Table; - EXPECT_NO_ERROR(Table.load(Reader)); + EXPECT_NO_ERROR(Table.reload(Reader)); EXPECT_EQ(3U, Table.getNameCount()); EXPECT_EQ(1U, Table.getHashVersion()); -- cgit v1.2.3