summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/DebugInfo/PDB
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2016-07-22 19:56:05 +0000
committerZachary Turner <zturner@google.com>2016-07-22 19:56:05 +0000
commitbac69d33d013a86277cf2acb9809819e1623c732 (patch)
tree407e63a631bcc61579f375eb47394b145a48b46e /llvm/unittests/DebugInfo/PDB
parentb8f95b5c6e77a36b5d5736cd167d244d64e53b87 (diff)
downloadbcm5719-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')
-rw-r--r--llvm/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp29
-rw-r--r--llvm/unittests/DebugInfo/PDB/MsfBuilderTest.cpp7
2 files changed, 17 insertions, 19 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) {}
};
diff --git a/llvm/unittests/DebugInfo/PDB/MsfBuilderTest.cpp b/llvm/unittests/DebugInfo/PDB/MsfBuilderTest.cpp
index ac292a73a8f..bb337118de2 100644
--- a/llvm/unittests/DebugInfo/PDB/MsfBuilderTest.cpp
+++ b/llvm/unittests/DebugInfo/PDB/MsfBuilderTest.cpp
@@ -9,14 +9,13 @@
#include "ErrorChecking.h"
-#include "llvm/DebugInfo/PDB/Raw/MsfBuilder.h"
-#include "llvm/DebugInfo/PDB/Raw/MsfCommon.h"
+#include "llvm/DebugInfo/Msf/MsfBuilder.h"
+#include "llvm/DebugInfo/Msf/MsfCommon.h"
#include "gtest/gtest.h"
using namespace llvm;
-using namespace llvm::pdb;
-using namespace llvm::pdb::msf;
+using namespace llvm::msf;
namespace {
class MsfBuilderTest : public testing::Test {
OpenPOWER on IntegriCloud