Make codeview::StringTable.
authorZachary Turner <zturner@google.com>
Tue, 2 May 2017 23:36:17 +0000 (23:36 +0000)
committerZachary Turner <zturner@google.com>
Tue, 2 May 2017 23:36:17 +0000 (23:36 +0000)
commit7dba20bd2b0767ff6be93d7d68a3045d060a7e22
tree4012baf0139582f0dd109c3bd3a359dc3201bb12
parentc7180204cab2407328fcbfc044e7526b9fcc7b7c
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
19 files changed:
llvm/include/llvm/DebugInfo/CodeView/StringTable.h [new file with mode: 0644]
llvm/include/llvm/DebugInfo/PDB/Native/PDBFile.h
llvm/include/llvm/DebugInfo/PDB/Native/PDBFileBuilder.h
llvm/include/llvm/DebugInfo/PDB/Native/PDBStringTable.h
llvm/include/llvm/DebugInfo/PDB/Native/PDBStringTableBuilder.h
llvm/include/llvm/DebugInfo/PDB/Native/RawTypes.h
llvm/include/llvm/Support/BinaryStreamReader.h
llvm/include/llvm/Support/BinaryStreamWriter.h
llvm/lib/DebugInfo/CodeView/CMakeLists.txt
llvm/lib/DebugInfo/CodeView/StringTable.cpp [new file with mode: 0644]
llvm/lib/DebugInfo/PDB/Native/DbiStream.cpp
llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp
llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
llvm/lib/DebugInfo/PDB/Native/PDBStringTable.cpp
llvm/lib/DebugInfo/PDB/Native/PDBStringTableBuilder.cpp
llvm/lib/DebugInfo/PDB/Native/StringTableStreamBuilder.cpp [new file with mode: 0644]
llvm/lib/Support/BinaryStreamReader.cpp
llvm/lib/Support/BinaryStreamWriter.cpp
llvm/unittests/DebugInfo/PDB/StringTableBuilderTest.cpp