From bac69d33d013a86277cf2acb9809819e1623c732 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Fri, 22 Jul 2016 19:56:05 +0000 Subject: [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 --- .../DebugInfo/PDB/MappedBlockStreamTest.cpp | 29 +++++++++++----------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'llvm/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp') 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 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 Blocks, MutableArrayRef 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 SrcData) const override { if (BlockIndex >= Blocks.size()) - return make_error(cv_error_code::insufficient_buffer); + return make_error(msf_error_code::insufficient_buffer); if (Offset > getBlockSize() - SrcData.size()) - return make_error(cv_error_code::insufficient_buffer); + return make_error(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 Data, - const IPDBFile &File) + MappedBlockStreamImpl(std::unique_ptr Data, + const IMsfFile &File) : MappedBlockStream(std::move(Data), File) {} }; -- cgit v1.2.3