diff options
author | Zachary Turner <zturner@google.com> | 2016-07-22 19:56:05 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2016-07-22 19:56:05 +0000 |
commit | bac69d33d013a86277cf2acb9809819e1623c732 (patch) | |
tree | 407e63a631bcc61579f375eb47394b145a48b46e /llvm/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp | |
parent | b8f95b5c6e77a36b5d5736cd167d244d64e53b87 (diff) | |
download | bcm5719-llvm-bac69d33d013a86277cf2acb9809819e1623c732.tar.gz bcm5719-llvm-bac69d33d013a86277cf2acb9809819e1623c732.zip |
[msf] Create LLVMDebugInfoMsf
This provides a better layering of responsibilities among different
aspects of PDB writing code. Some of the MSF related code was
contained in CodeView, and some was in PDB prior to this. Further,
we were often saying PDB when we meant MSF, and the two are
actually independent of each other since in theory you can have
other types of data besides PDB data in an MSF. So, this patch
separates the MSF specific code into its own library, with no
dependencies on anything else, and DebugInfoCodeView and
DebugInfoPDB take dependencies on DebugInfoMsf.
llvm-svn: 276458
Diffstat (limited to 'llvm/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp')
-rw-r--r-- | llvm/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/llvm/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp b/llvm/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp index 6f9e86c4f26..0762ef89fb1 100644 --- a/llvm/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp +++ b/llvm/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp @@ -9,28 +9,27 @@ #include "ErrorChecking.h" -#include "llvm/DebugInfo/CodeView/ByteStream.h" -#include "llvm/DebugInfo/CodeView/StreamReader.h" -#include "llvm/DebugInfo/CodeView/StreamRef.h" -#include "llvm/DebugInfo/CodeView/StreamWriter.h" -#include "llvm/DebugInfo/PDB/Raw/IPDBFile.h" -#include "llvm/DebugInfo/PDB/Raw/IPDBStreamData.h" -#include "llvm/DebugInfo/PDB/Raw/IndexedStreamData.h" -#include "llvm/DebugInfo/PDB/Raw/MappedBlockStream.h" +#include "llvm/DebugInfo/Msf/ByteStream.h" +#include "llvm/DebugInfo/Msf/IMsfFile.h" +#include "llvm/DebugInfo/Msf/IMsfStreamData.h" +#include "llvm/DebugInfo/Msf/IndexedStreamData.h" +#include "llvm/DebugInfo/Msf/MappedBlockStream.h" +#include "llvm/DebugInfo/Msf/StreamReader.h" +#include "llvm/DebugInfo/Msf/StreamRef.h" +#include "llvm/DebugInfo/Msf/StreamWriter.h" #include "gtest/gtest.h" #include <unordered_map> using namespace llvm; -using namespace llvm::codeview; -using namespace llvm::pdb; +using namespace llvm::msf; namespace { static const uint32_t BlocksAry[] = {0, 1, 2, 5, 4, 3, 6, 7, 8, 9}; static uint8_t DataAry[] = {'A', 'B', 'C', 'F', 'E', 'D', 'G', 'H', 'I', 'J'}; -class DiscontiguousFile : public IPDBFile { +class DiscontiguousFile : public IMsfFile { public: DiscontiguousFile(ArrayRef<uint32_t> Blocks, MutableArrayRef<uint8_t> Data) : Blocks(Blocks.begin(), Blocks.end()), Data(Data.begin(), Data.end()) {} @@ -55,9 +54,9 @@ public: Error setBlockData(uint32_t BlockIndex, uint32_t Offset, ArrayRef<uint8_t> SrcData) const override { if (BlockIndex >= Blocks.size()) - return make_error<CodeViewError>(cv_error_code::insufficient_buffer); + return make_error<MsfError>(msf_error_code::insufficient_buffer); if (Offset > getBlockSize() - SrcData.size()) - return make_error<CodeViewError>(cv_error_code::insufficient_buffer); + return make_error<MsfError>(msf_error_code::insufficient_buffer); ::memcpy(&Data[BlockIndex] + Offset, SrcData.data(), SrcData.size()); return Error::success(); } @@ -69,8 +68,8 @@ private: class MappedBlockStreamImpl : public MappedBlockStream { public: - MappedBlockStreamImpl(std::unique_ptr<IPDBStreamData> Data, - const IPDBFile &File) + MappedBlockStreamImpl(std::unique_ptr<IMsfStreamData> Data, + const IMsfFile &File) : MappedBlockStream(std::move(Data), File) {} }; |