From 85c3e3ee9c279cf6c62aedbdc12237a50aca5f89 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Fri, 29 Jul 2016 18:38:47 +0000 Subject: [PATCH] Revert "[msf] Rename Msf to MSF." This reverts commit 4d1557ffac41e079bcb1abbcf04f512474dcd6fe. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277194 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/DebugInfo/CodeView/CVRecord.h | 4 +- .../llvm/DebugInfo/CodeView/ModuleSubstream.h | 4 +- .../CodeView/ModuleSubstreamVisitor.h | 4 +- .../llvm/DebugInfo/CodeView/SymbolRecord.h | 2 +- .../llvm/DebugInfo/{MSF => Msf}/ByteStream.h | 16 ++-- .../llvm/DebugInfo/{MSF => Msf}/IMsfFile.h | 8 +- .../{MSF => Msf}/MappedBlockStream.h | 42 ++++----- .../llvm/DebugInfo/{MSF => Msf}/MsfBuilder.h | 16 ++-- .../llvm/DebugInfo/{MSF => Msf}/MsfCommon.h | 6 +- .../llvm/DebugInfo/{MSF => Msf}/MsfError.h | 10 +-- .../DebugInfo/{MSF => Msf}/MsfStreamLayout.h | 12 +-- .../llvm/DebugInfo/{MSF => Msf}/StreamArray.h | 2 +- .../DebugInfo/{MSF => Msf}/StreamInterface.h | 0 .../DebugInfo/{MSF => Msf}/StreamReader.h | 14 +-- .../llvm/DebugInfo/{MSF => Msf}/StreamRef.h | 12 +-- .../DebugInfo/{MSF => Msf}/StreamWriter.h | 10 +-- include/llvm/DebugInfo/PDB/Raw/DbiStream.h | 6 +- .../llvm/DebugInfo/PDB/Raw/DbiStreamBuilder.h | 6 +- include/llvm/DebugInfo/PDB/Raw/InfoStream.h | 2 +- .../DebugInfo/PDB/Raw/InfoStreamBuilder.h | 2 +- include/llvm/DebugInfo/PDB/Raw/ModInfo.h | 4 +- include/llvm/DebugInfo/PDB/Raw/ModStream.h | 6 +- .../llvm/DebugInfo/PDB/Raw/NameHashTable.h | 4 +- include/llvm/DebugInfo/PDB/Raw/PDBFile.h | 14 +-- .../llvm/DebugInfo/PDB/Raw/PDBFileBuilder.h | 8 +- .../llvm/DebugInfo/PDB/Raw/PublicsStream.h | 4 +- include/llvm/DebugInfo/PDB/Raw/TpiStream.h | 2 +- lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | 4 +- lib/CodeGen/AsmPrinter/LLVMBuild.txt | 2 +- lib/DebugInfo/CMakeLists.txt | 2 +- lib/DebugInfo/CodeView/LLVMBuild.txt | 2 +- lib/DebugInfo/CodeView/ModuleSubstream.cpp | 2 +- .../CodeView/ModuleSubstreamVisitor.cpp | 4 +- lib/DebugInfo/CodeView/TypeDumper.cpp | 2 +- lib/DebugInfo/LLVMBuild.txt | 2 +- lib/DebugInfo/{MSF => Msf}/CMakeLists.txt | 8 +- lib/DebugInfo/{MSF => Msf}/LLVMBuild.txt | 4 +- .../{MSF => Msf}/MappedBlockStream.cpp | 48 +++++------ lib/DebugInfo/{MSF => Msf}/MsfBuilder.cpp | 60 ++++++------- lib/DebugInfo/{MSF => Msf}/MsfCommon.cpp | 16 ++-- lib/DebugInfo/{MSF => Msf}/MsfError.cpp | 26 +++--- lib/DebugInfo/{MSF => Msf}/StreamReader.cpp | 8 +- lib/DebugInfo/{MSF => Msf}/StreamWriter.cpp | 8 +- lib/DebugInfo/PDB/LLVMBuild.txt | 2 +- lib/DebugInfo/PDB/Raw/DbiStream.cpp | 6 +- lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp | 6 +- lib/DebugInfo/PDB/Raw/InfoStream.cpp | 4 +- lib/DebugInfo/PDB/Raw/InfoStreamBuilder.cpp | 6 +- lib/DebugInfo/PDB/Raw/ModInfo.cpp | 2 +- lib/DebugInfo/PDB/Raw/ModStream.cpp | 2 +- lib/DebugInfo/PDB/Raw/NameHashTable.cpp | 2 +- lib/DebugInfo/PDB/Raw/NameMap.cpp | 4 +- lib/DebugInfo/PDB/Raw/NameMapBuilder.cpp | 2 +- lib/DebugInfo/PDB/Raw/PDBFile.cpp | 8 +- lib/DebugInfo/PDB/Raw/PDBFileBuilder.cpp | 14 +-- lib/DebugInfo/PDB/Raw/PublicsStream.cpp | 4 +- lib/DebugInfo/PDB/Raw/RawSession.cpp | 4 +- lib/DebugInfo/PDB/Raw/SymbolStream.cpp | 4 +- lib/DebugInfo/PDB/Raw/TpiStream.cpp | 4 +- tools/llvm-pdbdump/CMakeLists.txt | 2 +- tools/llvm-pdbdump/LLVMBuild.txt | 2 +- tools/llvm-pdbdump/LLVMOutputStyle.cpp | 4 +- tools/llvm-pdbdump/PdbYaml.cpp | 2 +- tools/llvm-pdbdump/PdbYaml.h | 10 +-- tools/llvm-pdbdump/YAMLOutputStyle.cpp | 2 +- tools/llvm-pdbdump/llvm-pdbdump.cpp | 4 +- tools/llvm-readobj/CMakeLists.txt | 2 +- tools/llvm-readobj/COFFDumper.cpp | 2 +- tools/llvm-readobj/LLVMBuild.txt | 2 +- unittests/DebugInfo/PDB/CMakeLists.txt | 4 +- .../DebugInfo/PDB/MappedBlockStreamTest.cpp | 24 +++--- unittests/DebugInfo/PDB/MsfBuilderTest.cpp | 86 +++++++++---------- 72 files changed, 319 insertions(+), 319 deletions(-) rename include/llvm/DebugInfo/{MSF => Msf}/ByteStream.h (91%) rename include/llvm/DebugInfo/{MSF => Msf}/IMsfFile.h (88%) rename include/llvm/DebugInfo/{MSF => Msf}/MappedBlockStream.h (76%) rename include/llvm/DebugInfo/{MSF => Msf}/MsfBuilder.h (94%) rename include/llvm/DebugInfo/{MSF => Msf}/MsfCommon.h (96%) rename include/llvm/DebugInfo/{MSF => Msf}/MsfError.h (79%) rename include/llvm/DebugInfo/{MSF => Msf}/MsfStreamLayout.h (79%) rename include/llvm/DebugInfo/{MSF => Msf}/StreamArray.h (99%) rename include/llvm/DebugInfo/{MSF => Msf}/StreamInterface.h (100%) rename include/llvm/DebugInfo/{MSF => Msf}/StreamReader.h (89%) rename include/llvm/DebugInfo/{MSF => Msf}/StreamRef.h (92%) rename include/llvm/DebugInfo/{MSF => Msf}/StreamWriter.h (91%) rename lib/DebugInfo/{MSF => Msf}/CMakeLists.txt (62%) rename lib/DebugInfo/{MSF => Msf}/LLVMBuild.txt (87%) rename lib/DebugInfo/{MSF => Msf}/MappedBlockStream.cpp (91%) rename lib/DebugInfo/{MSF => Msf}/MsfBuilder.cpp (84%) rename lib/DebugInfo/{MSF => Msf}/MsfCommon.cpp (76%) rename lib/DebugInfo/{MSF => Msf}/MsfError.cpp (73%) rename lib/DebugInfo/{MSF => Msf}/StreamReader.cpp (92%) rename lib/DebugInfo/{MSF => Msf}/StreamWriter.cpp (92%) diff --git a/include/llvm/DebugInfo/CodeView/CVRecord.h b/include/llvm/DebugInfo/CodeView/CVRecord.h index 39433ddc8bf..7cd6b45ef50 100644 --- a/include/llvm/DebugInfo/CodeView/CVRecord.h +++ b/include/llvm/DebugInfo/CodeView/CVRecord.h @@ -14,8 +14,8 @@ #include "llvm/ADT/iterator_range.h" #include "llvm/DebugInfo/CodeView/CodeViewError.h" #include "llvm/DebugInfo/CodeView/RecordSerialization.h" -#include "llvm/DebugInfo/MSF/StreamReader.h" -#include "llvm/DebugInfo/MSF/StreamRef.h" +#include "llvm/DebugInfo/Msf/StreamReader.h" +#include "llvm/DebugInfo/Msf/StreamRef.h" #include "llvm/Support/Endian.h" namespace llvm { diff --git a/include/llvm/DebugInfo/CodeView/ModuleSubstream.h b/include/llvm/DebugInfo/CodeView/ModuleSubstream.h index 8860ae42fc0..073031f84a1 100644 --- a/include/llvm/DebugInfo/CodeView/ModuleSubstream.h +++ b/include/llvm/DebugInfo/CodeView/ModuleSubstream.h @@ -11,8 +11,8 @@ #define LLVM_DEBUGINFO_CODEVIEW_MODULESUBSTREAM_H #include "llvm/DebugInfo/CodeView/CodeView.h" -#include "llvm/DebugInfo/MSF/StreamArray.h" -#include "llvm/DebugInfo/MSF/StreamRef.h" +#include "llvm/DebugInfo/Msf/StreamArray.h" +#include "llvm/DebugInfo/Msf/StreamRef.h" #include "llvm/Support/Endian.h" #include "llvm/Support/Error.h" diff --git a/include/llvm/DebugInfo/CodeView/ModuleSubstreamVisitor.h b/include/llvm/DebugInfo/CodeView/ModuleSubstreamVisitor.h index bbdf82060c1..e1bc68f80e2 100644 --- a/include/llvm/DebugInfo/CodeView/ModuleSubstreamVisitor.h +++ b/include/llvm/DebugInfo/CodeView/ModuleSubstreamVisitor.h @@ -14,8 +14,8 @@ #include "llvm/DebugInfo/CodeView/CodeViewError.h" #include "llvm/DebugInfo/CodeView/Line.h" #include "llvm/DebugInfo/CodeView/ModuleSubstream.h" -#include "llvm/DebugInfo/MSF/StreamReader.h" -#include "llvm/DebugInfo/MSF/StreamRef.h" +#include "llvm/DebugInfo/Msf/StreamReader.h" +#include "llvm/DebugInfo/Msf/StreamRef.h" namespace llvm { namespace codeview { diff --git a/include/llvm/DebugInfo/CodeView/SymbolRecord.h b/include/llvm/DebugInfo/CodeView/SymbolRecord.h index 21ad71fb0ac..b3974ecb862 100644 --- a/include/llvm/DebugInfo/CodeView/SymbolRecord.h +++ b/include/llvm/DebugInfo/CodeView/SymbolRecord.h @@ -16,7 +16,7 @@ #include "llvm/DebugInfo/CodeView/CodeView.h" #include "llvm/DebugInfo/CodeView/RecordSerialization.h" #include "llvm/DebugInfo/CodeView/TypeIndex.h" -#include "llvm/DebugInfo/MSF/StreamArray.h" +#include "llvm/DebugInfo/Msf/StreamArray.h" #include "llvm/Support/Endian.h" #include "llvm/Support/Error.h" diff --git a/include/llvm/DebugInfo/MSF/ByteStream.h b/include/llvm/DebugInfo/Msf/ByteStream.h similarity index 91% rename from include/llvm/DebugInfo/MSF/ByteStream.h rename to include/llvm/DebugInfo/Msf/ByteStream.h index 737693aa009..78ea1111975 100644 --- a/include/llvm/DebugInfo/MSF/ByteStream.h +++ b/include/llvm/DebugInfo/Msf/ByteStream.h @@ -12,8 +12,8 @@ #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/StringRef.h" -#include "llvm/DebugInfo/MSF/MSFError.h" -#include "llvm/DebugInfo/MSF/StreamInterface.h" +#include "llvm/DebugInfo/Msf/MsfError.h" +#include "llvm/DebugInfo/Msf/StreamInterface.h" #include "llvm/Support/Error.h" #include "llvm/Support/FileOutputBuffer.h" #include "llvm/Support/MemoryBuffer.h" @@ -32,16 +32,16 @@ public: Error readBytes(uint32_t Offset, uint32_t Size, ArrayRef &Buffer) const override { if (Offset > Data.size()) - return make_error(msf_error_code::insufficient_buffer); + return make_error(msf_error_code::insufficient_buffer); if (Data.size() < Size + Offset) - return make_error(msf_error_code::insufficient_buffer); + return make_error(msf_error_code::insufficient_buffer); Buffer = Data.slice(Offset, Size); return Error::success(); } Error readLongestContiguousChunk(uint32_t Offset, ArrayRef &Buffer) const override { if (Offset >= Data.size()) - return make_error(msf_error_code::insufficient_buffer); + return make_error(msf_error_code::insufficient_buffer); Buffer = Data.slice(Offset); return Error::success(); } @@ -90,9 +90,9 @@ public: Error writeBytes(uint32_t Offset, ArrayRef Buffer) const override { if (Data.size() < Buffer.size()) - return make_error(msf_error_code::insufficient_buffer); + return make_error(msf_error_code::insufficient_buffer); if (Offset > Buffer.size() - Data.size()) - return make_error(msf_error_code::insufficient_buffer); + return make_error(msf_error_code::insufficient_buffer); uint8_t *DataPtr = const_cast(Data.data()); ::memcpy(DataPtr + Offset, Buffer.data(), Buffer.size()); @@ -121,7 +121,7 @@ private: Error commit() const override { if (FileBuffer->commit()) - return llvm::make_error(msf_error_code::not_writable); + return llvm::make_error(msf_error_code::not_writable); return Error::success(); } diff --git a/include/llvm/DebugInfo/MSF/IMsfFile.h b/include/llvm/DebugInfo/Msf/IMsfFile.h similarity index 88% rename from include/llvm/DebugInfo/MSF/IMsfFile.h rename to include/llvm/DebugInfo/Msf/IMsfFile.h index 6c5754f11b9..1c7eeb92d28 100644 --- a/include/llvm/DebugInfo/MSF/IMsfFile.h +++ b/include/llvm/DebugInfo/Msf/IMsfFile.h @@ -1,4 +1,4 @@ -//===- IMSFFile.h - Abstract base class for an MSF file ---------*- C++ -*-===// +//===- IMsfFile.h - Abstract base class for an MSF file ---------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -12,7 +12,7 @@ #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/StringRef.h" -#include "llvm/DebugInfo/MSF/StreamArray.h" +#include "llvm/DebugInfo/Msf/StreamArray.h" #include "llvm/Support/Endian.h" #include "llvm/Support/Error.h" @@ -21,9 +21,9 @@ namespace llvm { namespace msf { -class IMSFFile { +class IMsfFile { public: - virtual ~IMSFFile() {} + virtual ~IMsfFile() {} virtual uint32_t getBlockSize() const = 0; virtual uint32_t getBlockCount() const = 0; diff --git a/include/llvm/DebugInfo/MSF/MappedBlockStream.h b/include/llvm/DebugInfo/Msf/MappedBlockStream.h similarity index 76% rename from include/llvm/DebugInfo/MSF/MappedBlockStream.h rename to include/llvm/DebugInfo/Msf/MappedBlockStream.h index aef6b011153..f66826ba804 100644 --- a/include/llvm/DebugInfo/MSF/MappedBlockStream.h +++ b/include/llvm/DebugInfo/Msf/MappedBlockStream.h @@ -1,4 +1,4 @@ -//===- MappedBlockStream.h - Discontiguous stream data in an MSF -*- C++ +//===- MappedBlockStream.h - Discontiguous stream data in an Msf -*- C++ //-*-===// // // The LLVM Compiler Infrastructure @@ -14,8 +14,8 @@ #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/STLExtras.h" -#include "llvm/DebugInfo/MSF/MSFStreamLayout.h" -#include "llvm/DebugInfo/MSF/StreamInterface.h" +#include "llvm/DebugInfo/Msf/MsfStreamLayout.h" +#include "llvm/DebugInfo/Msf/StreamInterface.h" #include "llvm/Support/Allocator.h" #include "llvm/Support/Endian.h" #include "llvm/Support/Error.h" @@ -25,16 +25,16 @@ namespace llvm { namespace msf { -struct MSFLayout; +struct MsfLayout; -/// MappedBlockStream represents data stored in an MSF file into chunks of a +/// MappedBlockStream represents data stored in an Msf file into chunks of a /// particular size (called the Block Size), and whose chunks may not be -/// necessarily contiguous. The arrangement of these chunks MSF the file -/// is described by some other metadata contained within the MSF file. In -/// the case of a standard MSF Stream, the layout of the stream's blocks -/// is described by the MSF "directory", but in the case of the directory +/// necessarily contiguous. The arrangement of these chunks within the file +/// is described by some other metadata contained within the Msf file. In +/// the case of a standard Msf Stream, the layout of the stream's blocks +/// is described by the Msf "directory", but in the case of the directory /// itself, the layout is described by an array at a fixed location within -/// the MSF. MappedBlockStream provides methods for reading from and writing +/// the Msf. MappedBlockStream provides methods for reading from and writing /// to one of these streams transparently, as if it were a contiguous sequence /// of bytes. class MappedBlockStream : public ReadableStream { @@ -43,14 +43,14 @@ class MappedBlockStream : public ReadableStream { public: static std::unique_ptr createStream(uint32_t BlockSize, uint32_t NumBlocks, - const MSFStreamLayout &Layout, const ReadableStream &MsfData); + const MsfStreamLayout &Layout, const ReadableStream &MsfData); static std::unique_ptr - createIndexedStream(const MSFLayout &Layout, const ReadableStream &MsfData, + createIndexedStream(const MsfLayout &Layout, const ReadableStream &MsfData, uint32_t StreamIndex); static std::unique_ptr - createDirectoryStream(const MSFLayout &Layout, const ReadableStream &MsfData); + createDirectoryStream(const MsfLayout &Layout, const ReadableStream &MsfData); Error readBytes(uint32_t Offset, uint32_t Size, ArrayRef &Buffer) const override; @@ -71,11 +71,11 @@ public: protected: MappedBlockStream(uint32_t BlockSize, uint32_t NumBlocks, - const MSFStreamLayout &StreamLayout, + const MsfStreamLayout &StreamLayout, const ReadableStream &MsfData); private: - const MSFStreamLayout &getStreamLayout() const { return StreamLayout; } + const MsfStreamLayout &getStreamLayout() const { return StreamLayout; } void fixCacheAfterWrite(uint32_t Offset, ArrayRef Data) const; Error readBytes(uint32_t Offset, MutableArrayRef Buffer) const; @@ -84,7 +84,7 @@ private: const uint32_t BlockSize; const uint32_t NumBlocks; - const MSFStreamLayout StreamLayout; + const MsfStreamLayout StreamLayout; const ReadableStream &MsfData; typedef MutableArrayRef CacheEntry; @@ -96,14 +96,14 @@ class WritableMappedBlockStream : public WritableStream { public: static std::unique_ptr createStream(uint32_t BlockSize, uint32_t NumBlocks, - const MSFStreamLayout &Layout, const WritableStream &MsfData); + const MsfStreamLayout &Layout, const WritableStream &MsfData); static std::unique_ptr - createIndexedStream(const MSFLayout &Layout, const WritableStream &MsfData, + createIndexedStream(const MsfLayout &Layout, const WritableStream &MsfData, uint32_t StreamIndex); static std::unique_ptr - createDirectoryStream(const MSFLayout &Layout, const WritableStream &MsfData); + createDirectoryStream(const MsfLayout &Layout, const WritableStream &MsfData); Error readBytes(uint32_t Offset, uint32_t Size, ArrayRef &Buffer) const override; @@ -115,7 +115,7 @@ public: Error commit() const override; - const MSFStreamLayout &getStreamLayout() const { + const MsfStreamLayout &getStreamLayout() const { return ReadInterface.getStreamLayout(); } uint32_t getBlockSize() const { return ReadInterface.getBlockSize(); } @@ -124,7 +124,7 @@ public: protected: WritableMappedBlockStream(uint32_t BlockSize, uint32_t NumBlocks, - const MSFStreamLayout &StreamLayout, + const MsfStreamLayout &StreamLayout, const WritableStream &MsfData); private: diff --git a/include/llvm/DebugInfo/MSF/MsfBuilder.h b/include/llvm/DebugInfo/Msf/MsfBuilder.h similarity index 94% rename from include/llvm/DebugInfo/MSF/MsfBuilder.h rename to include/llvm/DebugInfo/Msf/MsfBuilder.h index bf29e626339..0ccdd6f0149 100644 --- a/include/llvm/DebugInfo/MSF/MsfBuilder.h +++ b/include/llvm/DebugInfo/Msf/MsfBuilder.h @@ -13,7 +13,7 @@ #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/BitVector.h" -#include "llvm/DebugInfo/MSF/MSFCommon.h" +#include "llvm/DebugInfo/Msf/MsfCommon.h" #include "llvm/Support/Allocator.h" #include "llvm/Support/Endian.h" @@ -24,15 +24,15 @@ namespace llvm { namespace msf { -class MSFBuilder { +class MsfBuilder { public: - /// \brief Create a new `MSFBuilder`. + /// \brief Create a new `MsfBuilder`. /// /// \param BlockSize The internal block size used by the PDB file. See /// isValidBlockSize() for a list of valid block sizes. /// /// \param MinBlockCount Causes the builder to reserve up front space for - /// at least `MinBlockCount` blocks. This is useful when using `MSFBuilder` + /// at least `MinBlockCount` blocks. This is useful when using `MsfBuilder` /// to read an existing MSF that you want to write back out later. The /// original MSF file's SuperBlock contains the exact number of blocks used /// by the file, so is a good hint as to how many blocks the new MSF file @@ -54,7 +54,7 @@ public: /// failed. Currently the only way this can fail is if an invalid block size /// is specified, or `MinBlockCount` does not leave enough room for the /// mandatory reserved blocks required by an MSF file. - static Expected create(BumpPtrAllocator &Allocator, + static Expected create(BumpPtrAllocator &Allocator, uint32_t BlockSize, uint32_t MinBlockCount = 0, bool CanGrow = true); @@ -81,7 +81,7 @@ public: /// Update the size of an existing stream. This will allocate or deallocate /// blocks as needed to match the requested size. This can fail if `CanGrow` - /// was set to false when initializing the `MSFBuilder`. + /// was set to false when initializing the `MsfBuilder`. Error setStreamSize(uint32_t Idx, uint32_t Size); /// Get the total number of streams in the MSF layout. This should return 1 @@ -111,10 +111,10 @@ public: /// Finalize the layout and build the headers and structures that describe the /// MSF layout and can be written directly to the MSF file. - Expected build(); + Expected build(); private: - MSFBuilder(uint32_t BlockSize, uint32_t MinBlockCount, bool CanGrow, + MsfBuilder(uint32_t BlockSize, uint32_t MinBlockCount, bool CanGrow, BumpPtrAllocator &Allocator); Error allocateBlocks(uint32_t NumBlocks, MutableArrayRef Blocks); diff --git a/include/llvm/DebugInfo/MSF/MsfCommon.h b/include/llvm/DebugInfo/Msf/MsfCommon.h similarity index 96% rename from include/llvm/DebugInfo/MSF/MsfCommon.h rename to include/llvm/DebugInfo/Msf/MsfCommon.h index 58e6a1af426..86f20bd1711 100644 --- a/include/llvm/DebugInfo/MSF/MsfCommon.h +++ b/include/llvm/DebugInfo/Msf/MsfCommon.h @@ -1,4 +1,4 @@ -//===- MSFCommon.h - Common types and functions for MSF files ---*- C++ -*-===// +//===- MsfCommon.h - Common types and functions for MSF files ---*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -48,8 +48,8 @@ struct SuperBlock { support::ulittle32_t BlockMapAddr; }; -struct MSFLayout { - MSFLayout() : SB(nullptr) {} +struct MsfLayout { + MsfLayout() : SB(nullptr) {} const SuperBlock *SB; ArrayRef DirectoryBlocks; ArrayRef StreamSizes; diff --git a/include/llvm/DebugInfo/MSF/MsfError.h b/include/llvm/DebugInfo/Msf/MsfError.h similarity index 79% rename from include/llvm/DebugInfo/MSF/MsfError.h rename to include/llvm/DebugInfo/Msf/MsfError.h index e66aeca3cd4..4cdbaec3962 100644 --- a/include/llvm/DebugInfo/MSF/MsfError.h +++ b/include/llvm/DebugInfo/Msf/MsfError.h @@ -1,4 +1,4 @@ -//===- MSFError.h - Error extensions for MSF Files --------------*- C++ -*-===// +//===- MsfError.h - Error extensions for Msf Files --------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -26,12 +26,12 @@ enum class msf_error_code { }; /// Base class for errors originating when parsing raw PDB files -class MSFError : public ErrorInfo { +class MsfError : public ErrorInfo { public: static char ID; - MSFError(msf_error_code C); - MSFError(const std::string &Context); - MSFError(msf_error_code C, const std::string &Context); + MsfError(msf_error_code C); + MsfError(const std::string &Context); + MsfError(msf_error_code C, const std::string &Context); void log(raw_ostream &OS) const override; const std::string &getErrorMessage() const; diff --git a/include/llvm/DebugInfo/MSF/MsfStreamLayout.h b/include/llvm/DebugInfo/Msf/MsfStreamLayout.h similarity index 79% rename from include/llvm/DebugInfo/MSF/MsfStreamLayout.h rename to include/llvm/DebugInfo/Msf/MsfStreamLayout.h index 1b987aa04cf..68a3ca33518 100644 --- a/include/llvm/DebugInfo/MSF/MsfStreamLayout.h +++ b/include/llvm/DebugInfo/Msf/MsfStreamLayout.h @@ -1,4 +1,4 @@ -//===- MSFStreamLayout.h - Describes the layout of a stream -----*- C++ -*-===// +//===- MsfStreamLayout.h - Describes the layout of a stream -----*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -18,13 +18,13 @@ namespace llvm { namespace msf { -/// \brief Describes the layout of a stream in an MSF layout. A "stream" here -/// is defined as any logical unit of data which may be arranged inside the MSF +/// \brief Describes the layout of a stream in an Msf layout. A "stream" here +/// is defined as any logical unit of data which may be arranged inside the Msf /// file as a sequence of (possibly discontiguous) blocks. When we want to read -/// from a particular MSF Stream, we fill out a stream layout structure and the -/// reader uses it to determine which blocks in the underlying MSF file contain +/// from a particular Msf Stream, we fill out a stream layout structure and the +/// reader uses it to determine which blocks in the underlying Msf file contain /// the data, so that it can be pieced together in the right order. -class MSFStreamLayout { +class MsfStreamLayout { public: uint32_t Length; ArrayRef Blocks; diff --git a/include/llvm/DebugInfo/MSF/StreamArray.h b/include/llvm/DebugInfo/Msf/StreamArray.h similarity index 99% rename from include/llvm/DebugInfo/MSF/StreamArray.h rename to include/llvm/DebugInfo/Msf/StreamArray.h index 88f41ddfb52..569fb9bdd89 100644 --- a/include/llvm/DebugInfo/MSF/StreamArray.h +++ b/include/llvm/DebugInfo/Msf/StreamArray.h @@ -10,7 +10,7 @@ #ifndef LLVM_DEBUGINFO_MSF_STREAMARRAY_H #define LLVM_DEBUGINFO_MSF_STREAMARRAY_H -#include "llvm/DebugInfo/MSF/StreamRef.h" +#include "llvm/DebugInfo/Msf/StreamRef.h" #include "llvm/Support/Error.h" #include diff --git a/include/llvm/DebugInfo/MSF/StreamInterface.h b/include/llvm/DebugInfo/Msf/StreamInterface.h similarity index 100% rename from include/llvm/DebugInfo/MSF/StreamInterface.h rename to include/llvm/DebugInfo/Msf/StreamInterface.h diff --git a/include/llvm/DebugInfo/MSF/StreamReader.h b/include/llvm/DebugInfo/Msf/StreamReader.h similarity index 89% rename from include/llvm/DebugInfo/MSF/StreamReader.h rename to include/llvm/DebugInfo/Msf/StreamReader.h index ac43aaa8447..31f437f87c9 100644 --- a/include/llvm/DebugInfo/MSF/StreamReader.h +++ b/include/llvm/DebugInfo/Msf/StreamReader.h @@ -11,10 +11,10 @@ #define LLVM_DEBUGINFO_MSF_STREAMREADER_H #include "llvm/ADT/ArrayRef.h" -#include "llvm/DebugInfo/MSF/MSFError.h" -#include "llvm/DebugInfo/MSF/StreamArray.h" -#include "llvm/DebugInfo/MSF/StreamInterface.h" -#include "llvm/DebugInfo/MSF/StreamRef.h" +#include "llvm/DebugInfo/Msf/MsfError.h" +#include "llvm/DebugInfo/Msf/StreamArray.h" +#include "llvm/DebugInfo/Msf/StreamInterface.h" +#include "llvm/DebugInfo/Msf/StreamRef.h" #include "llvm/Support/Endian.h" #include "llvm/Support/Error.h" @@ -61,7 +61,7 @@ public: } if (NumElements > UINT32_MAX / sizeof(T)) - return make_error(msf_error_code::insufficient_buffer); + return make_error(msf_error_code::insufficient_buffer); if (auto EC = readBytes(Bytes, NumElements * sizeof(T))) return EC; @@ -86,9 +86,9 @@ public: } uint32_t Length = NumItems * sizeof(T); if (Length / sizeof(T) != NumItems) - return make_error(msf_error_code::invalid_format); + return make_error(msf_error_code::invalid_format); if (Offset + Length > Stream.getLength()) - return make_error(msf_error_code::insufficient_buffer); + return make_error(msf_error_code::insufficient_buffer); ReadableStreamRef View = Stream.slice(Offset, Length); Array = FixedStreamArray(View); Offset += Length; diff --git a/include/llvm/DebugInfo/MSF/StreamRef.h b/include/llvm/DebugInfo/Msf/StreamRef.h similarity index 92% rename from include/llvm/DebugInfo/MSF/StreamRef.h rename to include/llvm/DebugInfo/Msf/StreamRef.h index c25fd381ef2..ff280c03507 100644 --- a/include/llvm/DebugInfo/MSF/StreamRef.h +++ b/include/llvm/DebugInfo/Msf/StreamRef.h @@ -10,8 +10,8 @@ #ifndef LLVM_DEBUGINFO_MSF_STREAMREF_H #define LLVM_DEBUGINFO_MSF_STREAMREF_H -#include "llvm/DebugInfo/MSF/MSFError.h" -#include "llvm/DebugInfo/MSF/StreamInterface.h" +#include "llvm/DebugInfo/Msf/MsfError.h" +#include "llvm/DebugInfo/Msf/StreamInterface.h" namespace llvm { namespace msf { @@ -76,9 +76,9 @@ public: Error readBytes(uint32_t Offset, uint32_t Size, ArrayRef &Buffer) const { if (ViewOffset + Offset < Offset) - return make_error(msf_error_code::insufficient_buffer); + return make_error(msf_error_code::insufficient_buffer); if (Size + Offset > Length) - return make_error(msf_error_code::insufficient_buffer); + return make_error(msf_error_code::insufficient_buffer); return Stream->readBytes(ViewOffset + Offset, Size, Buffer); } @@ -87,7 +87,7 @@ public: Error readLongestContiguousChunk(uint32_t Offset, ArrayRef &Buffer) const { if (Offset >= Length) - return make_error(msf_error_code::insufficient_buffer); + return make_error(msf_error_code::insufficient_buffer); if (auto EC = Stream->readLongestContiguousChunk(Offset, Buffer)) return EC; @@ -117,7 +117,7 @@ public: Error writeBytes(uint32_t Offset, ArrayRef Data) const { if (Data.size() + Offset > Length) - return make_error(msf_error_code::insufficient_buffer); + return make_error(msf_error_code::insufficient_buffer); return Stream->writeBytes(ViewOffset + Offset, Data); } diff --git a/include/llvm/DebugInfo/MSF/StreamWriter.h b/include/llvm/DebugInfo/Msf/StreamWriter.h similarity index 91% rename from include/llvm/DebugInfo/MSF/StreamWriter.h rename to include/llvm/DebugInfo/Msf/StreamWriter.h index 88043c737bd..04194892e9b 100644 --- a/include/llvm/DebugInfo/MSF/StreamWriter.h +++ b/include/llvm/DebugInfo/Msf/StreamWriter.h @@ -11,10 +11,10 @@ #define LLVM_DEBUGINFO_MSF_STREAMWRITER_H #include "llvm/ADT/ArrayRef.h" -#include "llvm/DebugInfo/MSF/MSFError.h" -#include "llvm/DebugInfo/MSF/StreamArray.h" -#include "llvm/DebugInfo/MSF/StreamInterface.h" -#include "llvm/DebugInfo/MSF/StreamRef.h" +#include "llvm/DebugInfo/Msf/MsfError.h" +#include "llvm/DebugInfo/Msf/StreamArray.h" +#include "llvm/DebugInfo/Msf/StreamInterface.h" +#include "llvm/DebugInfo/Msf/StreamRef.h" #include "llvm/Support/Endian.h" #include "llvm/Support/Error.h" @@ -54,7 +54,7 @@ public: return Error::success(); if (Array.size() > UINT32_MAX / sizeof(T)) - return make_error(msf_error_code::insufficient_buffer); + return make_error(msf_error_code::insufficient_buffer); return writeBytes( ArrayRef(reinterpret_cast(Array.data()), diff --git a/include/llvm/DebugInfo/PDB/Raw/DbiStream.h b/include/llvm/DebugInfo/PDB/Raw/DbiStream.h index c97ca32ab43..7802f48be2c 100644 --- a/include/llvm/DebugInfo/PDB/Raw/DbiStream.h +++ b/include/llvm/DebugInfo/PDB/Raw/DbiStream.h @@ -11,9 +11,9 @@ #define LLVM_DEBUGINFO_PDB_RAW_PDBDBISTREAM_H #include "llvm/DebugInfo/CodeView/ModuleSubstream.h" -#include "llvm/DebugInfo/MSF/MappedBlockStream.h" -#include "llvm/DebugInfo/MSF/StreamArray.h" -#include "llvm/DebugInfo/MSF/StreamRef.h" +#include "llvm/DebugInfo/Msf/MappedBlockStream.h" +#include "llvm/DebugInfo/Msf/StreamArray.h" +#include "llvm/DebugInfo/Msf/StreamRef.h" #include "llvm/DebugInfo/PDB/PDBTypes.h" #include "llvm/DebugInfo/PDB/Raw/ModInfo.h" #include "llvm/DebugInfo/PDB/Raw/NameHashTable.h" diff --git a/include/llvm/DebugInfo/PDB/Raw/DbiStreamBuilder.h b/include/llvm/DebugInfo/PDB/Raw/DbiStreamBuilder.h index 9b93efef560..a3c8fc5dbbb 100644 --- a/include/llvm/DebugInfo/PDB/Raw/DbiStreamBuilder.h +++ b/include/llvm/DebugInfo/PDB/Raw/DbiStreamBuilder.h @@ -14,8 +14,8 @@ #include "llvm/ADT/StringSet.h" #include "llvm/Support/Error.h" -#include "llvm/DebugInfo/MSF/ByteStream.h" -#include "llvm/DebugInfo/MSF/StreamReader.h" +#include "llvm/DebugInfo/Msf/ByteStream.h" +#include "llvm/DebugInfo/Msf/StreamReader.h" #include "llvm/DebugInfo/PDB/PDBTypes.h" #include "llvm/DebugInfo/PDB/Raw/PDBFile.h" #include "llvm/DebugInfo/PDB/Raw/RawConstants.h" @@ -48,7 +48,7 @@ public: Expected> build(PDBFile &File, const msf::WritableStream &Buffer); - Error commit(const msf::MSFLayout &Layout, + Error commit(const msf::MsfLayout &Layout, const msf::WritableStream &Buffer) const; private: diff --git a/include/llvm/DebugInfo/PDB/Raw/InfoStream.h b/include/llvm/DebugInfo/PDB/Raw/InfoStream.h index 6b8b94ff1a3..e71c63d0552 100644 --- a/include/llvm/DebugInfo/PDB/Raw/InfoStream.h +++ b/include/llvm/DebugInfo/PDB/Raw/InfoStream.h @@ -11,7 +11,7 @@ #define LLVM_DEBUGINFO_PDB_RAW_PDBINFOSTREAM_H #include "llvm/ADT/StringMap.h" -#include "llvm/DebugInfo/MSF/MappedBlockStream.h" +#include "llvm/DebugInfo/Msf/MappedBlockStream.h" #include "llvm/DebugInfo/PDB/PDBTypes.h" #include "llvm/DebugInfo/PDB/Raw/NameMap.h" #include "llvm/DebugInfo/PDB/Raw/RawConstants.h" diff --git a/include/llvm/DebugInfo/PDB/Raw/InfoStreamBuilder.h b/include/llvm/DebugInfo/PDB/Raw/InfoStreamBuilder.h index 870c5d528a5..f3c3eadcec6 100644 --- a/include/llvm/DebugInfo/PDB/Raw/InfoStreamBuilder.h +++ b/include/llvm/DebugInfo/PDB/Raw/InfoStreamBuilder.h @@ -43,7 +43,7 @@ public: Expected> build(PDBFile &File, const msf::WritableStream &Buffer); - Error commit(const msf::MSFLayout &Layout, + Error commit(const msf::MsfLayout &Layout, const msf::WritableStream &Buffer) const; private: diff --git a/include/llvm/DebugInfo/PDB/Raw/ModInfo.h b/include/llvm/DebugInfo/PDB/Raw/ModInfo.h index b084f5b569f..e48b6aa15fa 100644 --- a/include/llvm/DebugInfo/PDB/Raw/ModInfo.h +++ b/include/llvm/DebugInfo/PDB/Raw/ModInfo.h @@ -11,8 +11,8 @@ #define LLVM_DEBUGINFO_PDB_RAW_MODINFO_H #include "llvm/ADT/StringRef.h" -#include "llvm/DebugInfo/MSF/StreamArray.h" -#include "llvm/DebugInfo/MSF/StreamRef.h" +#include "llvm/DebugInfo/Msf/StreamArray.h" +#include "llvm/DebugInfo/Msf/StreamRef.h" #include "llvm/DebugInfo/PDB/Raw/RawTypes.h" #include "llvm/Support/Endian.h" #include diff --git a/include/llvm/DebugInfo/PDB/Raw/ModStream.h b/include/llvm/DebugInfo/PDB/Raw/ModStream.h index f5296e08169..57e84edc1bb 100644 --- a/include/llvm/DebugInfo/PDB/Raw/ModStream.h +++ b/include/llvm/DebugInfo/PDB/Raw/ModStream.h @@ -14,9 +14,9 @@ #include "llvm/DebugInfo/CodeView/CVRecord.h" #include "llvm/DebugInfo/CodeView/ModuleSubstream.h" #include "llvm/DebugInfo/CodeView/SymbolRecord.h" -#include "llvm/DebugInfo/MSF/MappedBlockStream.h" -#include "llvm/DebugInfo/MSF/StreamArray.h" -#include "llvm/DebugInfo/MSF/StreamRef.h" +#include "llvm/DebugInfo/Msf/MappedBlockStream.h" +#include "llvm/DebugInfo/Msf/StreamArray.h" +#include "llvm/DebugInfo/Msf/StreamRef.h" #include "llvm/Support/Error.h" namespace llvm { diff --git a/include/llvm/DebugInfo/PDB/Raw/NameHashTable.h b/include/llvm/DebugInfo/PDB/Raw/NameHashTable.h index 00d022d4d8e..c9dd95d01c1 100644 --- a/include/llvm/DebugInfo/PDB/Raw/NameHashTable.h +++ b/include/llvm/DebugInfo/PDB/Raw/NameHashTable.h @@ -12,8 +12,8 @@ #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/StringRef.h" -#include "llvm/DebugInfo/MSF/StreamArray.h" -#include "llvm/DebugInfo/MSF/StreamRef.h" +#include "llvm/DebugInfo/Msf/StreamArray.h" +#include "llvm/DebugInfo/Msf/StreamRef.h" #include "llvm/Support/Endian.h" #include "llvm/Support/Error.h" #include diff --git a/include/llvm/DebugInfo/PDB/Raw/PDBFile.h b/include/llvm/DebugInfo/PDB/Raw/PDBFile.h index 29e931f8fc4..b0be4fb4705 100644 --- a/include/llvm/DebugInfo/PDB/Raw/PDBFile.h +++ b/include/llvm/DebugInfo/PDB/Raw/PDBFile.h @@ -11,10 +11,10 @@ #define LLVM_DEBUGINFO_PDB_RAW_PDBFILE_H #include "llvm/ADT/DenseMap.h" -#include "llvm/DebugInfo/MSF/IMSFFile.h" -#include "llvm/DebugInfo/MSF/MSFCommon.h" -#include "llvm/DebugInfo/MSF/StreamArray.h" -#include "llvm/DebugInfo/MSF/StreamInterface.h" +#include "llvm/DebugInfo/Msf/IMsfFile.h" +#include "llvm/DebugInfo/Msf/MsfCommon.h" +#include "llvm/DebugInfo/Msf/StreamArray.h" +#include "llvm/DebugInfo/Msf/StreamInterface.h" #include "llvm/Support/Allocator.h" #include "llvm/Support/Endian.h" #include "llvm/Support/Error.h" @@ -38,7 +38,7 @@ class PublicsStream; class SymbolStream; class TpiStream; -class PDBFile : public msf::IMSFFile { +class PDBFile : public msf::IMsfFile { friend PDBFileBuilder; public: @@ -74,7 +74,7 @@ public: return ContainerLayout.StreamMap; } - const msf::MSFLayout &getMsfLayout() const { return ContainerLayout; } + const msf::MsfLayout &getMsfLayout() const { return ContainerLayout; } const msf::ReadableStream &getMsfBuffer() const { return *Buffer; } ArrayRef getDirectoryBlockArray() const; @@ -95,7 +95,7 @@ private: std::unique_ptr Buffer; - msf::MSFLayout ContainerLayout; + msf::MsfLayout ContainerLayout; std::unique_ptr Info; std::unique_ptr Dbi; diff --git a/include/llvm/DebugInfo/PDB/Raw/PDBFileBuilder.h b/include/llvm/DebugInfo/PDB/Raw/PDBFileBuilder.h index b9c06db2e5a..6242f42e991 100644 --- a/include/llvm/DebugInfo/PDB/Raw/PDBFileBuilder.h +++ b/include/llvm/DebugInfo/PDB/Raw/PDBFileBuilder.h @@ -23,7 +23,7 @@ namespace llvm { namespace msf { -class MSFBuilder; +class MsfBuilder; } namespace pdb { class DbiStreamBuilder; @@ -37,7 +37,7 @@ public: Error initialize(const msf::SuperBlock &Super); - msf::MSFBuilder &getMsfBuilder(); + msf::MsfBuilder &getMsfBuilder(); InfoStreamBuilder &getInfoBuilder(); DbiStreamBuilder &getDbiBuilder(); @@ -47,11 +47,11 @@ public: Error commit(const msf::WritableStream &Buffer); private: - Expected finalizeMsfLayout() const; + Expected finalizeMsfLayout() const; BumpPtrAllocator &Allocator; - std::unique_ptr Msf; + std::unique_ptr Msf; std::unique_ptr Info; std::unique_ptr Dbi; }; diff --git a/include/llvm/DebugInfo/PDB/Raw/PublicsStream.h b/include/llvm/DebugInfo/PDB/Raw/PublicsStream.h index ba8ed11456d..a302d853b8a 100644 --- a/include/llvm/DebugInfo/PDB/Raw/PublicsStream.h +++ b/include/llvm/DebugInfo/PDB/Raw/PublicsStream.h @@ -11,8 +11,8 @@ #define LLVM_DEBUGINFO_PDB_RAW_PUBLICSSTREAM_H #include "llvm/DebugInfo/CodeView/SymbolRecord.h" -#include "llvm/DebugInfo/MSF/MappedBlockStream.h" -#include "llvm/DebugInfo/MSF/StreamArray.h" +#include "llvm/DebugInfo/Msf/MappedBlockStream.h" +#include "llvm/DebugInfo/Msf/StreamArray.h" #include "llvm/DebugInfo/PDB/PDBTypes.h" #include "llvm/DebugInfo/PDB/Raw/RawConstants.h" #include "llvm/DebugInfo/PDB/Raw/RawTypes.h" diff --git a/include/llvm/DebugInfo/PDB/Raw/TpiStream.h b/include/llvm/DebugInfo/PDB/Raw/TpiStream.h index e518333bf1f..31c02675d10 100644 --- a/include/llvm/DebugInfo/PDB/Raw/TpiStream.h +++ b/include/llvm/DebugInfo/PDB/Raw/TpiStream.h @@ -11,7 +11,7 @@ #define LLVM_DEBUGINFO_PDB_RAW_PDBTPISTREAM_H #include "llvm/DebugInfo/CodeView/TypeRecord.h" -#include "llvm/DebugInfo/MSF/StreamArray.h" +#include "llvm/DebugInfo/Msf/StreamArray.h" #include "llvm/DebugInfo/PDB/PDBTypes.h" #include "llvm/DebugInfo/PDB/Raw/RawConstants.h" #include "llvm/DebugInfo/PDB/Raw/RawTypes.h" diff --git a/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp index 9d5d2127359..874a154a954 100644 --- a/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -22,8 +22,8 @@ #include "llvm/DebugInfo/CodeView/TypeIndex.h" #include "llvm/DebugInfo/CodeView/TypeRecord.h" #include "llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h" -#include "llvm/DebugInfo/MSF/ByteStream.h" -#include "llvm/DebugInfo/MSF/StreamReader.h" +#include "llvm/DebugInfo/Msf/ByteStream.h" +#include "llvm/DebugInfo/Msf/StreamReader.h" #include "llvm/IR/Constants.h" #include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCExpr.h" diff --git a/lib/CodeGen/AsmPrinter/LLVMBuild.txt b/lib/CodeGen/AsmPrinter/LLVMBuild.txt index c40c5e747e8..3b240f21fc0 100644 --- a/lib/CodeGen/AsmPrinter/LLVMBuild.txt +++ b/lib/CodeGen/AsmPrinter/LLVMBuild.txt @@ -19,4 +19,4 @@ type = Library name = AsmPrinter parent = Libraries -required_libraries = Analysis CodeGen Core DebugInfoCodeView DebugInfoMSF MC MCParser Support Target TransformUtils +required_libraries = Analysis CodeGen Core DebugInfoCodeView DebugInfoMsf MC MCParser Support Target TransformUtils diff --git a/lib/DebugInfo/CMakeLists.txt b/lib/DebugInfo/CMakeLists.txt index e7be0a0617d..944dfb67cbe 100644 --- a/lib/DebugInfo/CMakeLists.txt +++ b/lib/DebugInfo/CMakeLists.txt @@ -1,5 +1,5 @@ add_subdirectory(DWARF) -add_subdirectory(MSF) +add_subdirectory(Msf) add_subdirectory(CodeView) add_subdirectory(PDB) add_subdirectory(Symbolize) diff --git a/lib/DebugInfo/CodeView/LLVMBuild.txt b/lib/DebugInfo/CodeView/LLVMBuild.txt index f799a9eeae9..c1e35abf150 100644 --- a/lib/DebugInfo/CodeView/LLVMBuild.txt +++ b/lib/DebugInfo/CodeView/LLVMBuild.txt @@ -19,4 +19,4 @@ type = Library name = DebugInfoCodeView parent = DebugInfo -required_libraries = Support DebugInfoMSF +required_libraries = Support DebugInfoMsf diff --git a/lib/DebugInfo/CodeView/ModuleSubstream.cpp b/lib/DebugInfo/CodeView/ModuleSubstream.cpp index 768ebaa1c98..6473338a272 100644 --- a/lib/DebugInfo/CodeView/ModuleSubstream.cpp +++ b/lib/DebugInfo/CodeView/ModuleSubstream.cpp @@ -9,7 +9,7 @@ #include "llvm/DebugInfo/CodeView/ModuleSubstream.h" -#include "llvm/DebugInfo/MSF/StreamReader.h" +#include "llvm/DebugInfo/Msf/StreamReader.h" using namespace llvm; using namespace llvm::codeview; diff --git a/lib/DebugInfo/CodeView/ModuleSubstreamVisitor.cpp b/lib/DebugInfo/CodeView/ModuleSubstreamVisitor.cpp index 52479327798..f5afe61efc2 100644 --- a/lib/DebugInfo/CodeView/ModuleSubstreamVisitor.cpp +++ b/lib/DebugInfo/CodeView/ModuleSubstreamVisitor.cpp @@ -8,8 +8,8 @@ //===----------------------------------------------------------------------===// #include "llvm/DebugInfo/CodeView/ModuleSubstreamVisitor.h" -#include "llvm/DebugInfo/MSF/StreamReader.h" -#include "llvm/DebugInfo/MSF/StreamRef.h" +#include "llvm/DebugInfo/Msf/StreamReader.h" +#include "llvm/DebugInfo/Msf/StreamRef.h" using namespace llvm; using namespace llvm::codeview; diff --git a/lib/DebugInfo/CodeView/TypeDumper.cpp b/lib/DebugInfo/CodeView/TypeDumper.cpp index 5ceaa59a79e..428914b59a9 100644 --- a/lib/DebugInfo/CodeView/TypeDumper.cpp +++ b/lib/DebugInfo/CodeView/TypeDumper.cpp @@ -12,7 +12,7 @@ #include "llvm/DebugInfo/CodeView/CVTypeVisitor.h" #include "llvm/DebugInfo/CodeView/TypeIndex.h" #include "llvm/DebugInfo/CodeView/TypeRecord.h" -#include "llvm/DebugInfo/MSF/ByteStream.h" +#include "llvm/DebugInfo/Msf/ByteStream.h" #include "llvm/Support/ScopedPrinter.h" using namespace llvm; diff --git a/lib/DebugInfo/LLVMBuild.txt b/lib/DebugInfo/LLVMBuild.txt index 86503e13a03..876c43a5749 100644 --- a/lib/DebugInfo/LLVMBuild.txt +++ b/lib/DebugInfo/LLVMBuild.txt @@ -16,7 +16,7 @@ ;===------------------------------------------------------------------------===; [common] -subdirectories = DWARF MSF CodeView PDB Symbolize +subdirectories = DWARF Msf CodeView PDB Symbolize [component_0] type = Group diff --git a/lib/DebugInfo/MSF/CMakeLists.txt b/lib/DebugInfo/Msf/CMakeLists.txt similarity index 62% rename from lib/DebugInfo/MSF/CMakeLists.txt rename to lib/DebugInfo/Msf/CMakeLists.txt index dcb2a8e0cc9..5342c54fd20 100644 --- a/lib/DebugInfo/MSF/CMakeLists.txt +++ b/lib/DebugInfo/Msf/CMakeLists.txt @@ -1,8 +1,8 @@ -add_llvm_library(LLVMDebugInfoMSF +add_llvm_library(LLVMDebugInfoMsf MappedBlockStream.cpp - MSFBuilder.cpp - MSFCommon.cpp - MSFError.cpp + MsfBuilder.cpp + MsfCommon.cpp + MsfError.cpp StreamReader.cpp StreamWriter.cpp ADDITIONAL_HEADER_DIRS diff --git a/lib/DebugInfo/MSF/LLVMBuild.txt b/lib/DebugInfo/Msf/LLVMBuild.txt similarity index 87% rename from lib/DebugInfo/MSF/LLVMBuild.txt rename to lib/DebugInfo/Msf/LLVMBuild.txt index 391547c949b..4598c437a93 100644 --- a/lib/DebugInfo/MSF/LLVMBuild.txt +++ b/lib/DebugInfo/Msf/LLVMBuild.txt @@ -1,4 +1,4 @@ -;===- ./lib/DebugInfo/MSF/LLVMBuild.txt -------------------*- Conf -*--===; +;===- ./lib/DebugInfo/Msf/LLVMBuild.txt -------------------*- Conf -*--===; ; ; The LLVM Compiler Infrastructure ; @@ -17,6 +17,6 @@ [component_0] type = Library -name = DebugInfoMSF +name = DebugInfoMsf parent = DebugInfo required_libraries = Support diff --git a/lib/DebugInfo/MSF/MappedBlockStream.cpp b/lib/DebugInfo/Msf/MappedBlockStream.cpp similarity index 91% rename from lib/DebugInfo/MSF/MappedBlockStream.cpp rename to lib/DebugInfo/Msf/MappedBlockStream.cpp index 0a3b2b96ab4..7d5be88c4d1 100644 --- a/lib/DebugInfo/MSF/MappedBlockStream.cpp +++ b/lib/DebugInfo/Msf/MappedBlockStream.cpp @@ -7,12 +7,12 @@ // //===----------------------------------------------------------------------===// -#include "llvm/DebugInfo/MSF/MappedBlockStream.h" +#include "llvm/DebugInfo/Msf/MappedBlockStream.h" -#include "llvm/DebugInfo/MSF/IMSFFile.h" -#include "llvm/DebugInfo/MSF/MSFCommon.h" -#include "llvm/DebugInfo/MSF/MSFError.h" -#include "llvm/DebugInfo/MSF/MSFStreamLayout.h" +#include "llvm/DebugInfo/Msf/IMsfFile.h" +#include "llvm/DebugInfo/Msf/MsfCommon.h" +#include "llvm/DebugInfo/Msf/MsfError.h" +#include "llvm/DebugInfo/Msf/MsfStreamLayout.h" using namespace llvm; using namespace llvm::msf; @@ -33,24 +33,24 @@ static Interval intersect(const Interval &I1, const Interval &I2) { } MappedBlockStream::MappedBlockStream(uint32_t BlockSize, uint32_t NumBlocks, - const MSFStreamLayout &Layout, + const MsfStreamLayout &Layout, const ReadableStream &MsfData) : BlockSize(BlockSize), NumBlocks(NumBlocks), StreamLayout(Layout), MsfData(MsfData) {} std::unique_ptr MappedBlockStream::createStream(uint32_t BlockSize, uint32_t NumBlocks, - const MSFStreamLayout &Layout, + const MsfStreamLayout &Layout, const ReadableStream &MsfData) { return llvm::make_unique>( BlockSize, NumBlocks, Layout, MsfData); } std::unique_ptr -MappedBlockStream::createIndexedStream(const MSFLayout &Layout, +MappedBlockStream::createIndexedStream(const MsfLayout &Layout, const ReadableStream &MsfData, uint32_t StreamIndex) { - MSFStreamLayout SL; + MsfStreamLayout SL; SL.Blocks = Layout.StreamMap[StreamIndex]; SL.Length = Layout.StreamSizes[StreamIndex]; return llvm::make_unique>( @@ -58,9 +58,9 @@ MappedBlockStream::createIndexedStream(const MSFLayout &Layout, } std::unique_ptr -MappedBlockStream::createDirectoryStream(const MSFLayout &Layout, +MappedBlockStream::createDirectoryStream(const MsfLayout &Layout, const ReadableStream &MsfData) { - MSFStreamLayout SL; + MsfStreamLayout SL; SL.Blocks = Layout.DirectoryBlocks; SL.Length = Layout.SB->NumDirectoryBytes; return createStream(Layout.SB->BlockSize, Layout.SB->NumBlocks, SL, MsfData); @@ -70,9 +70,9 @@ Error MappedBlockStream::readBytes(uint32_t Offset, uint32_t Size, ArrayRef &Buffer) const { // Make sure we aren't trying to read beyond the end of the stream. if (Size > StreamLayout.Length) - return make_error(msf_error_code::insufficient_buffer); + return make_error(msf_error_code::insufficient_buffer); if (Offset > StreamLayout.Length - Size) - return make_error(msf_error_code::insufficient_buffer); + return make_error(msf_error_code::insufficient_buffer); if (tryReadContiguously(Offset, Size, Buffer)) return Error::success(); @@ -150,7 +150,7 @@ Error MappedBlockStream::readLongestContiguousChunk( uint32_t Offset, ArrayRef &Buffer) const { // Make sure we aren't trying to read beyond the end of the stream. if (Offset >= StreamLayout.Length) - return make_error(msf_error_code::insufficient_buffer); + return make_error(msf_error_code::insufficient_buffer); uint32_t First = Offset / BlockSize; uint32_t Last = First; @@ -221,9 +221,9 @@ Error MappedBlockStream::readBytes(uint32_t Offset, // Make sure we aren't trying to read beyond the end of the stream. if (Buffer.size() > StreamLayout.Length) - return make_error(msf_error_code::insufficient_buffer); + return make_error(msf_error_code::insufficient_buffer); if (Offset > StreamLayout.Length - Buffer.size()) - return make_error(msf_error_code::insufficient_buffer); + return make_error(msf_error_code::insufficient_buffer); uint32_t BytesLeft = Buffer.size(); uint32_t BytesWritten = 0; @@ -292,24 +292,24 @@ void MappedBlockStream::fixCacheAfterWrite(uint32_t Offset, } WritableMappedBlockStream::WritableMappedBlockStream( - uint32_t BlockSize, uint32_t NumBlocks, const MSFStreamLayout &Layout, + uint32_t BlockSize, uint32_t NumBlocks, const MsfStreamLayout &Layout, const WritableStream &MsfData) : ReadInterface(BlockSize, NumBlocks, Layout, MsfData), WriteInterface(MsfData) {} std::unique_ptr WritableMappedBlockStream::createStream(uint32_t BlockSize, uint32_t NumBlocks, - const MSFStreamLayout &Layout, + const MsfStreamLayout &Layout, const WritableStream &MsfData) { return llvm::make_unique>( BlockSize, NumBlocks, Layout, MsfData); } std::unique_ptr -WritableMappedBlockStream::createIndexedStream(const MSFLayout &Layout, +WritableMappedBlockStream::createIndexedStream(const MsfLayout &Layout, const WritableStream &MsfData, uint32_t StreamIndex) { - MSFStreamLayout SL; + MsfStreamLayout SL; SL.Blocks = Layout.StreamMap[StreamIndex]; SL.Length = Layout.StreamSizes[StreamIndex]; return createStream(Layout.SB->BlockSize, Layout.SB->NumBlocks, SL, MsfData); @@ -317,8 +317,8 @@ WritableMappedBlockStream::createIndexedStream(const MSFLayout &Layout, std::unique_ptr WritableMappedBlockStream::createDirectoryStream( - const MSFLayout &Layout, const WritableStream &MsfData) { - MSFStreamLayout SL; + const MsfLayout &Layout, const WritableStream &MsfData) { + MsfStreamLayout SL; SL.Blocks = Layout.DirectoryBlocks; SL.Length = Layout.SB->NumDirectoryBytes; return createStream(Layout.SB->BlockSize, Layout.SB->NumBlocks, SL, MsfData); @@ -342,10 +342,10 @@ Error WritableMappedBlockStream::writeBytes(uint32_t Offset, ArrayRef Buffer) const { // Make sure we aren't trying to write beyond the end of the stream. if (Buffer.size() > getStreamLength()) - return make_error(msf_error_code::insufficient_buffer); + return make_error(msf_error_code::insufficient_buffer); if (Offset > getStreamLayout().Length - Buffer.size()) - return make_error(msf_error_code::insufficient_buffer); + return make_error(msf_error_code::insufficient_buffer); uint32_t BlockNum = Offset / getBlockSize(); uint32_t OffsetInBlock = Offset % getBlockSize(); diff --git a/lib/DebugInfo/MSF/MsfBuilder.cpp b/lib/DebugInfo/Msf/MsfBuilder.cpp similarity index 84% rename from lib/DebugInfo/MSF/MsfBuilder.cpp rename to lib/DebugInfo/Msf/MsfBuilder.cpp index 62960b67db2..0128264b9ec 100644 --- a/lib/DebugInfo/MSF/MsfBuilder.cpp +++ b/lib/DebugInfo/Msf/MsfBuilder.cpp @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// -#include "llvm/DebugInfo/MSF/MSFBuilder.h" -#include "llvm/DebugInfo/MSF/MSFError.h" +#include "llvm/DebugInfo/Msf/MsfBuilder.h" +#include "llvm/DebugInfo/Msf/MsfError.h" using namespace llvm; using namespace llvm::msf; @@ -22,7 +22,7 @@ const uint32_t kNumReservedPages = 3; const uint32_t kDefaultBlockMapAddr = kNumReservedPages; } -MSFBuilder::MSFBuilder(uint32_t BlockSize, uint32_t MinBlockCount, bool CanGrow, +MsfBuilder::MsfBuilder(uint32_t BlockSize, uint32_t MinBlockCount, bool CanGrow, BumpPtrAllocator &Allocator) : Allocator(Allocator), IsGrowable(CanGrow), BlockSize(BlockSize), MininumBlocks(MinBlockCount), BlockMapAddr(kDefaultBlockMapAddr), @@ -33,31 +33,31 @@ MSFBuilder::MSFBuilder(uint32_t BlockSize, uint32_t MinBlockCount, bool CanGrow, FreeBlocks[BlockMapAddr] = false; } -Expected MSFBuilder::create(BumpPtrAllocator &Allocator, +Expected MsfBuilder::create(BumpPtrAllocator &Allocator, uint32_t BlockSize, uint32_t MinBlockCount, bool CanGrow) { if (!isValidBlockSize(BlockSize)) - return make_error(msf_error_code::invalid_format, + return make_error(msf_error_code::invalid_format, "The requested block size is unsupported"); - return MSFBuilder(BlockSize, + return MsfBuilder(BlockSize, std::max(MinBlockCount, msf::getMinimumBlockCount()), CanGrow, Allocator); } -Error MSFBuilder::setBlockMapAddr(uint32_t Addr) { +Error MsfBuilder::setBlockMapAddr(uint32_t Addr) { if (Addr == BlockMapAddr) return Error::success(); if (Addr >= FreeBlocks.size()) { if (!IsGrowable) - return make_error(msf_error_code::insufficient_buffer, + return make_error(msf_error_code::insufficient_buffer, "Cannot grow the number of blocks"); FreeBlocks.resize(Addr + 1); } if (!isBlockFree(Addr)) - return make_error( + return make_error( msf_error_code::block_in_use, "Requested block map address is already in use"); FreeBlocks[BlockMapAddr] = true; @@ -66,16 +66,16 @@ Error MSFBuilder::setBlockMapAddr(uint32_t Addr) { return Error::success(); } -void MSFBuilder::setFreePageMap(uint32_t Fpm) { FreePageMap = Fpm; } +void MsfBuilder::setFreePageMap(uint32_t Fpm) { FreePageMap = Fpm; } -void MSFBuilder::setUnknown1(uint32_t Unk1) { Unknown1 = Unk1; } +void MsfBuilder::setUnknown1(uint32_t Unk1) { Unknown1 = Unk1; } -Error MSFBuilder::setDirectoryBlocksHint(ArrayRef DirBlocks) { +Error MsfBuilder::setDirectoryBlocksHint(ArrayRef DirBlocks) { for (auto B : DirectoryBlocks) FreeBlocks[B] = true; for (auto B : DirBlocks) { if (!isBlockFree(B)) { - return make_error(msf_error_code::unspecified, + return make_error(msf_error_code::unspecified, "Attempt to reuse an allocated block"); } FreeBlocks[B] = false; @@ -85,7 +85,7 @@ Error MSFBuilder::setDirectoryBlocksHint(ArrayRef DirBlocks) { return Error::success(); } -Error MSFBuilder::allocateBlocks(uint32_t NumBlocks, +Error MsfBuilder::allocateBlocks(uint32_t NumBlocks, MutableArrayRef Blocks) { if (NumBlocks == 0) return Error::success(); @@ -93,7 +93,7 @@ Error MSFBuilder::allocateBlocks(uint32_t NumBlocks, uint32_t NumFreeBlocks = FreeBlocks.count(); if (NumFreeBlocks < NumBlocks) { if (!IsGrowable) - return make_error(msf_error_code::insufficient_buffer, + return make_error(msf_error_code::insufficient_buffer, "There are no free Blocks in the file"); uint32_t AllocBlocks = NumBlocks - NumFreeBlocks; FreeBlocks.resize(AllocBlocks + FreeBlocks.size(), true); @@ -112,23 +112,23 @@ Error MSFBuilder::allocateBlocks(uint32_t NumBlocks, return Error::success(); } -uint32_t MSFBuilder::getNumUsedBlocks() const { +uint32_t MsfBuilder::getNumUsedBlocks() const { return getTotalBlockCount() - getNumFreeBlocks(); } -uint32_t MSFBuilder::getNumFreeBlocks() const { return FreeBlocks.count(); } +uint32_t MsfBuilder::getNumFreeBlocks() const { return FreeBlocks.count(); } -uint32_t MSFBuilder::getTotalBlockCount() const { return FreeBlocks.size(); } +uint32_t MsfBuilder::getTotalBlockCount() const { return FreeBlocks.size(); } -bool MSFBuilder::isBlockFree(uint32_t Idx) const { return FreeBlocks[Idx]; } +bool MsfBuilder::isBlockFree(uint32_t Idx) const { return FreeBlocks[Idx]; } -Error MSFBuilder::addStream(uint32_t Size, ArrayRef Blocks) { +Error MsfBuilder::addStream(uint32_t Size, ArrayRef Blocks) { // Add a new stream mapped to the specified blocks. Verify that the specified // blocks are both necessary and sufficient for holding the requested number // of bytes, and verify that all requested blocks are free. uint32_t ReqBlocks = bytesToBlocks(Size, BlockSize); if (ReqBlocks != Blocks.size()) - return make_error( + return make_error( msf_error_code::invalid_format, "Incorrect number of blocks for requested stream size"); for (auto Block : Blocks) { @@ -136,7 +136,7 @@ Error MSFBuilder::addStream(uint32_t Size, ArrayRef Blocks) { FreeBlocks.resize(Block + 1, true); if (!FreeBlocks.test(Block)) - return make_error( + return make_error( msf_error_code::unspecified, "Attempt to re-use an already allocated block"); } @@ -148,7 +148,7 @@ Error MSFBuilder::addStream(uint32_t Size, ArrayRef Blocks) { return Error::success(); } -Error MSFBuilder::addStream(uint32_t Size) { +Error MsfBuilder::addStream(uint32_t Size) { uint32_t ReqBlocks = bytesToBlocks(Size, BlockSize); std::vector NewBlocks; NewBlocks.resize(ReqBlocks); @@ -158,7 +158,7 @@ Error MSFBuilder::addStream(uint32_t Size) { return Error::success(); } -Error MSFBuilder::setStreamSize(uint32_t Idx, uint32_t Size) { +Error MsfBuilder::setStreamSize(uint32_t Idx, uint32_t Size) { uint32_t OldSize = getStreamSize(Idx); if (OldSize == Size) return Error::success(); @@ -191,17 +191,17 @@ Error MSFBuilder::setStreamSize(uint32_t Idx, uint32_t Size) { return Error::success(); } -uint32_t MSFBuilder::getNumStreams() const { return StreamData.size(); } +uint32_t MsfBuilder::getNumStreams() const { return StreamData.size(); } -uint32_t MSFBuilder::getStreamSize(uint32_t StreamIdx) const { +uint32_t MsfBuilder::getStreamSize(uint32_t StreamIdx) const { return StreamData[StreamIdx].first; } -ArrayRef MSFBuilder::getStreamBlocks(uint32_t StreamIdx) const { +ArrayRef MsfBuilder::getStreamBlocks(uint32_t StreamIdx) const { return StreamData[StreamIdx].second; } -uint32_t MSFBuilder::computeDirectoryByteSize() const { +uint32_t MsfBuilder::computeDirectoryByteSize() const { // The directory has the following layout, where each item is a ulittle32_t: // NumStreams // StreamSizes[NumStreams] @@ -217,9 +217,9 @@ uint32_t MSFBuilder::computeDirectoryByteSize() const { return Size; } -Expected MSFBuilder::build() { +Expected MsfBuilder::build() { SuperBlock *SB = Allocator.Allocate(); - MSFLayout L; + MsfLayout L; L.SB = SB; std::memcpy(SB->MagicBytes, Magic, sizeof(Magic)); diff --git a/lib/DebugInfo/MSF/MsfCommon.cpp b/lib/DebugInfo/Msf/MsfCommon.cpp similarity index 76% rename from lib/DebugInfo/MSF/MsfCommon.cpp rename to lib/DebugInfo/Msf/MsfCommon.cpp index d79ccafe898..e22087f705f 100644 --- a/lib/DebugInfo/MSF/MsfCommon.cpp +++ b/lib/DebugInfo/Msf/MsfCommon.cpp @@ -1,4 +1,4 @@ -//===- MSFCommon.cpp - Common types and functions for MSF files -*- C++ -*-===// +//===- MsfCommon.cpp - Common types and functions for MSF files -*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -7,8 +7,8 @@ // //===----------------------------------------------------------------------===// -#include "llvm/DebugInfo/MSF/MSFCommon.h" -#include "llvm/DebugInfo/MSF/MSFError.h" +#include "llvm/DebugInfo/Msf/MsfCommon.h" +#include "llvm/DebugInfo/Msf/MsfError.h" using namespace llvm; using namespace llvm::msf; @@ -16,16 +16,16 @@ using namespace llvm::msf; Error llvm::msf::validateSuperBlock(const SuperBlock &SB) { // Check the magic bytes. if (std::memcmp(SB.MagicBytes, Magic, sizeof(Magic)) != 0) - return make_error(msf_error_code::invalid_format, + return make_error(msf_error_code::invalid_format, "MSF magic header doesn't match"); if (!isValidBlockSize(SB.BlockSize)) - return make_error(msf_error_code::invalid_format, + return make_error(msf_error_code::invalid_format, "Unsupported block size."); // We don't support directories whose sizes aren't a multiple of four bytes. if (SB.NumDirectoryBytes % sizeof(support::ulittle32_t) != 0) - return make_error(msf_error_code::invalid_format, + return make_error(msf_error_code::invalid_format, "Directory size is not multiple of 4."); // The number of blocks which comprise the directory is a simple function of @@ -37,11 +37,11 @@ Error llvm::msf::validateSuperBlock(const SuperBlock &SB) { // block numbers. It is unclear what would happen if the number of blocks // couldn't fit on a single block. if (NumDirectoryBlocks > SB.BlockSize / sizeof(support::ulittle32_t)) - return make_error(msf_error_code::invalid_format, + return make_error(msf_error_code::invalid_format, "Too many directory blocks."); if (SB.BlockMapAddr == 0) - return make_error(msf_error_code::invalid_format, + return make_error(msf_error_code::invalid_format, "Block 0 is reserved"); return Error::success(); diff --git a/lib/DebugInfo/MSF/MsfError.cpp b/lib/DebugInfo/Msf/MsfError.cpp similarity index 73% rename from lib/DebugInfo/MSF/MsfError.cpp rename to lib/DebugInfo/Msf/MsfError.cpp index 5272cad3890..246beb9b0de 100644 --- a/lib/DebugInfo/MSF/MsfError.cpp +++ b/lib/DebugInfo/Msf/MsfError.cpp @@ -1,4 +1,4 @@ -//===- MSFError.cpp - Error extensions for MSF files ------------*- C++ -*-===// +//===- MsfError.cpp - Error extensions for Msf files ------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -#include "llvm/DebugInfo/MSF/MSFError.h" +#include "llvm/DebugInfo/Msf/MsfError.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/ManagedStatic.h" @@ -18,7 +18,7 @@ namespace { // FIXME: This class is only here to support the transition to llvm::Error. It // will be removed once this transition is complete. Clients should prefer to // deal with the Error value directly, rather than converting to error_code. -class MSFErrorCategory : public std::error_category { +class MsfErrorCategory : public std::error_category { public: const char *name() const LLVM_NOEXCEPT override { return "llvm.msf"; } @@ -43,17 +43,17 @@ public: }; } // end anonymous namespace -static ManagedStatic Category; +static ManagedStatic Category; -char MSFError::ID = 0; +char MsfError::ID = 0; -MSFError::MSFError(msf_error_code C) : MSFError(C, "") {} +MsfError::MsfError(msf_error_code C) : MsfError(C, "") {} -MSFError::MSFError(const std::string &Context) - : MSFError(msf_error_code::unspecified, Context) {} +MsfError::MsfError(const std::string &Context) + : MsfError(msf_error_code::unspecified, Context) {} -MSFError::MSFError(msf_error_code C, const std::string &Context) : Code(C) { - ErrMsg = "MSF Error: "; +MsfError::MsfError(msf_error_code C, const std::string &Context) : Code(C) { + ErrMsg = "Msf Error: "; std::error_code EC = convertToErrorCode(); if (Code != msf_error_code::unspecified) ErrMsg += EC.message() + " "; @@ -61,10 +61,10 @@ MSFError::MSFError(msf_error_code C, const std::string &Context) : Code(C) { ErrMsg += Context; } -void MSFError::log(raw_ostream &OS) const { OS << ErrMsg << "\n"; } +void MsfError::log(raw_ostream &OS) const { OS << ErrMsg << "\n"; } -const std::string &MSFError::getErrorMessage() const { return ErrMsg; } +const std::string &MsfError::getErrorMessage() const { return ErrMsg; } -std::error_code MSFError::convertToErrorCode() const { +std::error_code MsfError::convertToErrorCode() const { return std::error_code(static_cast(Code), *Category); } diff --git a/lib/DebugInfo/MSF/StreamReader.cpp b/lib/DebugInfo/Msf/StreamReader.cpp similarity index 92% rename from lib/DebugInfo/MSF/StreamReader.cpp rename to lib/DebugInfo/Msf/StreamReader.cpp index eb3d3e82d4d..1c7e8352130 100644 --- a/lib/DebugInfo/MSF/StreamReader.cpp +++ b/lib/DebugInfo/Msf/StreamReader.cpp @@ -7,10 +7,10 @@ // //===----------------------------------------------------------------------===// -#include "llvm/DebugInfo/MSF/StreamReader.h" +#include "llvm/DebugInfo/Msf/StreamReader.h" -#include "llvm/DebugInfo/MSF/MSFError.h" -#include "llvm/DebugInfo/MSF/StreamRef.h" +#include "llvm/DebugInfo/Msf/MsfError.h" +#include "llvm/DebugInfo/Msf/StreamRef.h" using namespace llvm; using namespace llvm::msf; @@ -86,7 +86,7 @@ Error StreamReader::readStreamRef(ReadableStreamRef &Ref) { Error StreamReader::readStreamRef(ReadableStreamRef &Ref, uint32_t Length) { if (bytesRemaining() < Length) - return make_error(msf_error_code::insufficient_buffer); + return make_error(msf_error_code::insufficient_buffer); Ref = Stream.slice(Offset, Length); Offset += Length; return Error::success(); diff --git a/lib/DebugInfo/MSF/StreamWriter.cpp b/lib/DebugInfo/Msf/StreamWriter.cpp similarity index 92% rename from lib/DebugInfo/MSF/StreamWriter.cpp rename to lib/DebugInfo/Msf/StreamWriter.cpp index a91cffe840f..40bc0394b11 100644 --- a/lib/DebugInfo/MSF/StreamWriter.cpp +++ b/lib/DebugInfo/Msf/StreamWriter.cpp @@ -7,11 +7,11 @@ // //===----------------------------------------------------------------------===// -#include "llvm/DebugInfo/MSF/StreamWriter.h" +#include "llvm/DebugInfo/Msf/StreamWriter.h" -#include "llvm/DebugInfo/MSF/MSFError.h" -#include "llvm/DebugInfo/MSF/StreamReader.h" -#include "llvm/DebugInfo/MSF/StreamRef.h" +#include "llvm/DebugInfo/Msf/MsfError.h" +#include "llvm/DebugInfo/Msf/StreamReader.h" +#include "llvm/DebugInfo/Msf/StreamRef.h" using namespace llvm; using namespace llvm::msf; diff --git a/lib/DebugInfo/PDB/LLVMBuild.txt b/lib/DebugInfo/PDB/LLVMBuild.txt index d9af656b511..a2196837723 100644 --- a/lib/DebugInfo/PDB/LLVMBuild.txt +++ b/lib/DebugInfo/PDB/LLVMBuild.txt @@ -19,5 +19,5 @@ type = Library name = DebugInfoPDB parent = DebugInfo -required_libraries = Object Support DebugInfoCodeView DebugInfoMSF +required_libraries = Object Support DebugInfoCodeView DebugInfoMsf diff --git a/lib/DebugInfo/PDB/Raw/DbiStream.cpp b/lib/DebugInfo/PDB/Raw/DbiStream.cpp index 9ed34701c8f..564246a332d 100644 --- a/lib/DebugInfo/PDB/Raw/DbiStream.cpp +++ b/lib/DebugInfo/PDB/Raw/DbiStream.cpp @@ -9,9 +9,9 @@ #include "llvm/DebugInfo/PDB/Raw/DbiStream.h" -#include "llvm/DebugInfo/MSF/StreamArray.h" -#include "llvm/DebugInfo/MSF/StreamReader.h" -#include "llvm/DebugInfo/MSF/StreamWriter.h" +#include "llvm/DebugInfo/Msf/StreamArray.h" +#include "llvm/DebugInfo/Msf/StreamReader.h" +#include "llvm/DebugInfo/Msf/StreamWriter.h" #include "llvm/DebugInfo/PDB/Raw/ISectionContribVisitor.h" #include "llvm/DebugInfo/PDB/Raw/InfoStream.h" #include "llvm/DebugInfo/PDB/Raw/ModInfo.h" diff --git a/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp b/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp index 711295da91b..b68f1dca091 100644 --- a/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp +++ b/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp @@ -9,8 +9,8 @@ #include "llvm/DebugInfo/PDB/Raw/DbiStreamBuilder.h" -#include "llvm/DebugInfo/MSF/MappedBlockStream.h" -#include "llvm/DebugInfo/MSF/StreamWriter.h" +#include "llvm/DebugInfo/Msf/MappedBlockStream.h" +#include "llvm/DebugInfo/Msf/StreamWriter.h" #include "llvm/DebugInfo/PDB/Raw/DbiStream.h" #include "llvm/DebugInfo/PDB/Raw/RawError.h" @@ -248,7 +248,7 @@ DbiStreamBuilder::build(PDBFile &File, const msf::WritableStream &Buffer) { return std::move(Dbi); } -Error DbiStreamBuilder::commit(const msf::MSFLayout &Layout, +Error DbiStreamBuilder::commit(const msf::MsfLayout &Layout, const msf::WritableStream &Buffer) const { auto InfoS = WritableMappedBlockStream::createIndexedStream(Layout, Buffer, StreamDBI); diff --git a/lib/DebugInfo/PDB/Raw/InfoStream.cpp b/lib/DebugInfo/PDB/Raw/InfoStream.cpp index f19535d1180..4df24f240f3 100644 --- a/lib/DebugInfo/PDB/Raw/InfoStream.cpp +++ b/lib/DebugInfo/PDB/Raw/InfoStream.cpp @@ -10,8 +10,8 @@ #include "llvm/DebugInfo/PDB/Raw/InfoStream.h" #include "llvm/ADT/BitVector.h" #include "llvm/ADT/SmallVector.h" -#include "llvm/DebugInfo/MSF/StreamReader.h" -#include "llvm/DebugInfo/MSF/StreamWriter.h" +#include "llvm/DebugInfo/Msf/StreamReader.h" +#include "llvm/DebugInfo/Msf/StreamWriter.h" #include "llvm/DebugInfo/PDB/Raw/PDBFile.h" #include "llvm/DebugInfo/PDB/Raw/RawConstants.h" #include "llvm/DebugInfo/PDB/Raw/RawError.h" diff --git a/lib/DebugInfo/PDB/Raw/InfoStreamBuilder.cpp b/lib/DebugInfo/PDB/Raw/InfoStreamBuilder.cpp index a06c8fdfc5a..d20c37d9f29 100644 --- a/lib/DebugInfo/PDB/Raw/InfoStreamBuilder.cpp +++ b/lib/DebugInfo/PDB/Raw/InfoStreamBuilder.cpp @@ -9,8 +9,8 @@ #include "llvm/DebugInfo/PDB/Raw/InfoStreamBuilder.h" -#include "llvm/DebugInfo/MSF/MappedBlockStream.h" -#include "llvm/DebugInfo/MSF/StreamWriter.h" +#include "llvm/DebugInfo/Msf/MappedBlockStream.h" +#include "llvm/DebugInfo/Msf/StreamWriter.h" #include "llvm/DebugInfo/PDB/Raw/InfoStream.h" #include "llvm/DebugInfo/PDB/Raw/RawError.h" #include "llvm/DebugInfo/PDB/Raw/RawTypes.h" @@ -55,7 +55,7 @@ InfoStreamBuilder::build(PDBFile &File, const msf::WritableStream &Buffer) { return std::move(Info); } -Error InfoStreamBuilder::commit(const msf::MSFLayout &Layout, +Error InfoStreamBuilder::commit(const msf::MsfLayout &Layout, const msf::WritableStream &Buffer) const { auto InfoS = WritableMappedBlockStream::createIndexedStream(Layout, Buffer, StreamPDB); diff --git a/lib/DebugInfo/PDB/Raw/ModInfo.cpp b/lib/DebugInfo/PDB/Raw/ModInfo.cpp index 436aa8428f9..7b77bcda421 100644 --- a/lib/DebugInfo/PDB/Raw/ModInfo.cpp +++ b/lib/DebugInfo/PDB/Raw/ModInfo.cpp @@ -9,7 +9,7 @@ #include "llvm/DebugInfo/PDB/Raw/ModInfo.h" -#include "llvm/DebugInfo/MSF/StreamReader.h" +#include "llvm/DebugInfo/Msf/StreamReader.h" #include "llvm/DebugInfo/PDB/Raw/PDBFile.h" #include "llvm/Support/Endian.h" diff --git a/lib/DebugInfo/PDB/Raw/ModStream.cpp b/lib/DebugInfo/PDB/Raw/ModStream.cpp index 3810b29dba1..25bb9d15165 100644 --- a/lib/DebugInfo/PDB/Raw/ModStream.cpp +++ b/lib/DebugInfo/PDB/Raw/ModStream.cpp @@ -9,7 +9,7 @@ #include "llvm/DebugInfo/PDB/Raw/ModStream.h" -#include "llvm/DebugInfo/MSF/StreamReader.h" +#include "llvm/DebugInfo/Msf/StreamReader.h" #include "llvm/DebugInfo/PDB/Raw/ModInfo.h" #include "llvm/DebugInfo/PDB/Raw/PDBFile.h" #include "llvm/DebugInfo/PDB/Raw/RawError.h" diff --git a/lib/DebugInfo/PDB/Raw/NameHashTable.cpp b/lib/DebugInfo/PDB/Raw/NameHashTable.cpp index 84cccb354bd..3e22e7686bd 100644 --- a/lib/DebugInfo/PDB/Raw/NameHashTable.cpp +++ b/lib/DebugInfo/PDB/Raw/NameHashTable.cpp @@ -10,7 +10,7 @@ #include "llvm/DebugInfo/PDB/Raw/NameHashTable.h" #include "llvm/ADT/ArrayRef.h" -#include "llvm/DebugInfo/MSF/StreamReader.h" +#include "llvm/DebugInfo/Msf/StreamReader.h" #include "llvm/DebugInfo/PDB/Raw/Hash.h" #include "llvm/DebugInfo/PDB/Raw/RawError.h" #include "llvm/Support/Endian.h" diff --git a/lib/DebugInfo/PDB/Raw/NameMap.cpp b/lib/DebugInfo/PDB/Raw/NameMap.cpp index 40992e9a96e..70b810f1522 100644 --- a/lib/DebugInfo/PDB/Raw/NameMap.cpp +++ b/lib/DebugInfo/PDB/Raw/NameMap.cpp @@ -9,8 +9,8 @@ #include "llvm/DebugInfo/PDB/Raw/NameMap.h" #include "llvm/ADT/SparseBitVector.h" -#include "llvm/DebugInfo/MSF/StreamReader.h" -#include "llvm/DebugInfo/MSF/StreamWriter.h" +#include "llvm/DebugInfo/Msf/StreamReader.h" +#include "llvm/DebugInfo/Msf/StreamWriter.h" #include "llvm/DebugInfo/PDB/Raw/RawError.h" using namespace llvm; diff --git a/lib/DebugInfo/PDB/Raw/NameMapBuilder.cpp b/lib/DebugInfo/PDB/Raw/NameMapBuilder.cpp index 918a828d035..3bb4503fe6a 100644 --- a/lib/DebugInfo/PDB/Raw/NameMapBuilder.cpp +++ b/lib/DebugInfo/PDB/Raw/NameMapBuilder.cpp @@ -9,7 +9,7 @@ #include "llvm/DebugInfo/PDB/Raw/NameMapBuilder.h" -#include "llvm/DebugInfo/MSF/StreamWriter.h" +#include "llvm/DebugInfo/Msf/StreamWriter.h" #include "llvm/DebugInfo/PDB/Raw/NameMap.h" #include "llvm/Support/Endian.h" diff --git a/lib/DebugInfo/PDB/Raw/PDBFile.cpp b/lib/DebugInfo/PDB/Raw/PDBFile.cpp index ddc8102d1fe..3529860899e 100644 --- a/lib/DebugInfo/PDB/Raw/PDBFile.cpp +++ b/lib/DebugInfo/PDB/Raw/PDBFile.cpp @@ -10,10 +10,10 @@ #include "llvm/DebugInfo/PDB/Raw/PDBFile.h" #include "llvm/ADT/ArrayRef.h" -#include "llvm/DebugInfo/MSF/StreamArray.h" -#include "llvm/DebugInfo/MSF/StreamInterface.h" -#include "llvm/DebugInfo/MSF/StreamReader.h" -#include "llvm/DebugInfo/MSF/StreamWriter.h" +#include "llvm/DebugInfo/Msf/StreamArray.h" +#include "llvm/DebugInfo/Msf/StreamInterface.h" +#include "llvm/DebugInfo/Msf/StreamReader.h" +#include "llvm/DebugInfo/Msf/StreamWriter.h" #include "llvm/DebugInfo/PDB/Raw/DbiStream.h" #include "llvm/DebugInfo/PDB/Raw/InfoStream.h" #include "llvm/DebugInfo/PDB/Raw/NameHashTable.h" diff --git a/lib/DebugInfo/PDB/Raw/PDBFileBuilder.cpp b/lib/DebugInfo/PDB/Raw/PDBFileBuilder.cpp index 6e4bb16479f..1a0503fcbde 100644 --- a/lib/DebugInfo/PDB/Raw/PDBFileBuilder.cpp +++ b/lib/DebugInfo/PDB/Raw/PDBFileBuilder.cpp @@ -11,9 +11,9 @@ #include "llvm/ADT/BitVector.h" -#include "llvm/DebugInfo/MSF/MSFBuilder.h" -#include "llvm/DebugInfo/MSF/StreamInterface.h" -#include "llvm/DebugInfo/MSF/StreamWriter.h" +#include "llvm/DebugInfo/Msf/MsfBuilder.h" +#include "llvm/DebugInfo/Msf/StreamInterface.h" +#include "llvm/DebugInfo/Msf/StreamWriter.h" #include "llvm/DebugInfo/PDB/Raw/DbiStream.h" #include "llvm/DebugInfo/PDB/Raw/DbiStreamBuilder.h" #include "llvm/DebugInfo/PDB/Raw/InfoStream.h" @@ -31,20 +31,20 @@ PDBFileBuilder::PDBFileBuilder(BumpPtrAllocator &Allocator) Error PDBFileBuilder::initialize(const msf::SuperBlock &Super) { auto ExpectedMsf = - MSFBuilder::create(Allocator, Super.BlockSize, Super.NumBlocks); + MsfBuilder::create(Allocator, Super.BlockSize, Super.NumBlocks); if (!ExpectedMsf) return ExpectedMsf.takeError(); auto &MsfResult = *ExpectedMsf; if (auto EC = MsfResult.setBlockMapAddr(Super.BlockMapAddr)) return EC; - Msf = llvm::make_unique(std::move(MsfResult)); + Msf = llvm::make_unique(std::move(MsfResult)); Msf->setFreePageMap(Super.FreeBlockMapBlock); Msf->setUnknown1(Super.Unknown1); return Error::success(); } -MSFBuilder &PDBFileBuilder::getMsfBuilder() { return *Msf; } +MsfBuilder &PDBFileBuilder::getMsfBuilder() { return *Msf; } InfoStreamBuilder &PDBFileBuilder::getInfoBuilder() { if (!Info) @@ -58,7 +58,7 @@ DbiStreamBuilder &PDBFileBuilder::getDbiBuilder() { return *Dbi; } -Expected PDBFileBuilder::finalizeMsfLayout() const { +Expected PDBFileBuilder::finalizeMsfLayout() const { if (Info) { uint32_t Length = Info->calculateSerializedLength(); if (auto EC = Msf->setStreamSize(StreamPDB, Length)) diff --git a/lib/DebugInfo/PDB/Raw/PublicsStream.cpp b/lib/DebugInfo/PDB/Raw/PublicsStream.cpp index 5d4431dd044..8f96e5e61f5 100644 --- a/lib/DebugInfo/PDB/Raw/PublicsStream.cpp +++ b/lib/DebugInfo/PDB/Raw/PublicsStream.cpp @@ -26,8 +26,8 @@ #include "llvm/DebugInfo/CodeView/CodeView.h" #include "llvm/DebugInfo/CodeView/TypeRecord.h" -#include "llvm/DebugInfo/MSF/MappedBlockStream.h" -#include "llvm/DebugInfo/MSF/StreamReader.h" +#include "llvm/DebugInfo/Msf/MappedBlockStream.h" +#include "llvm/DebugInfo/Msf/StreamReader.h" #include "llvm/DebugInfo/PDB/Raw/PDBFile.h" #include "llvm/DebugInfo/PDB/Raw/RawConstants.h" #include "llvm/DebugInfo/PDB/Raw/RawError.h" diff --git a/lib/DebugInfo/PDB/Raw/RawSession.cpp b/lib/DebugInfo/PDB/Raw/RawSession.cpp index ad7a3fc14de..a83689f5741 100644 --- a/lib/DebugInfo/PDB/Raw/RawSession.cpp +++ b/lib/DebugInfo/PDB/Raw/RawSession.cpp @@ -9,8 +9,8 @@ #include "llvm/DebugInfo/PDB/Raw/RawSession.h" -#include "llvm/DebugInfo/MSF/ByteStream.h" -#include "llvm/DebugInfo/MSF/StreamInterface.h" +#include "llvm/DebugInfo/Msf/ByteStream.h" +#include "llvm/DebugInfo/Msf/StreamInterface.h" #include "llvm/DebugInfo/PDB/GenericError.h" #include "llvm/DebugInfo/PDB/IPDBEnumChildren.h" #include "llvm/DebugInfo/PDB/IPDBSourceFile.h" diff --git a/lib/DebugInfo/PDB/Raw/SymbolStream.cpp b/lib/DebugInfo/PDB/Raw/SymbolStream.cpp index 2f3ac3497f3..a604df3ae9a 100644 --- a/lib/DebugInfo/PDB/Raw/SymbolStream.cpp +++ b/lib/DebugInfo/PDB/Raw/SymbolStream.cpp @@ -11,8 +11,8 @@ #include "llvm/DebugInfo/CodeView/CodeView.h" #include "llvm/DebugInfo/CodeView/TypeRecord.h" -#include "llvm/DebugInfo/MSF/MappedBlockStream.h" -#include "llvm/DebugInfo/MSF/StreamReader.h" +#include "llvm/DebugInfo/Msf/MappedBlockStream.h" +#include "llvm/DebugInfo/Msf/StreamReader.h" #include "llvm/DebugInfo/PDB/Raw/PDBFile.h" #include "llvm/DebugInfo/PDB/Raw/RawConstants.h" #include "llvm/DebugInfo/PDB/Raw/RawError.h" diff --git a/lib/DebugInfo/PDB/Raw/TpiStream.cpp b/lib/DebugInfo/PDB/Raw/TpiStream.cpp index 1398628f231..a39a040705b 100644 --- a/lib/DebugInfo/PDB/Raw/TpiStream.cpp +++ b/lib/DebugInfo/PDB/Raw/TpiStream.cpp @@ -13,8 +13,8 @@ #include "llvm/DebugInfo/CodeView/CodeView.h" #include "llvm/DebugInfo/CodeView/TypeIndex.h" #include "llvm/DebugInfo/CodeView/TypeRecord.h" -#include "llvm/DebugInfo/MSF/MappedBlockStream.h" -#include "llvm/DebugInfo/MSF/StreamReader.h" +#include "llvm/DebugInfo/Msf/MappedBlockStream.h" +#include "llvm/DebugInfo/Msf/StreamReader.h" #include "llvm/DebugInfo/PDB/Raw/Hash.h" #include "llvm/DebugInfo/PDB/Raw/PDBFile.h" #include "llvm/DebugInfo/PDB/Raw/RawConstants.h" diff --git a/tools/llvm-pdbdump/CMakeLists.txt b/tools/llvm-pdbdump/CMakeLists.txt index 56324e83a63..3a630ab55f8 100644 --- a/tools/llvm-pdbdump/CMakeLists.txt +++ b/tools/llvm-pdbdump/CMakeLists.txt @@ -1,6 +1,6 @@ set(LLVM_LINK_COMPONENTS DebugInfoCodeView - DebugInfoMSF + DebugInfoMsf DebugInfoPDB Object Support diff --git a/tools/llvm-pdbdump/LLVMBuild.txt b/tools/llvm-pdbdump/LLVMBuild.txt index 4043e13ceae..38f6e54fbcf 100644 --- a/tools/llvm-pdbdump/LLVMBuild.txt +++ b/tools/llvm-pdbdump/LLVMBuild.txt @@ -19,5 +19,5 @@ type = Tool name = llvm-pdbdump parent = Tools -required_libraries = DebugInfoMSF DebugInfoPDB +required_libraries = DebugInfoMsf DebugInfoPDB diff --git a/tools/llvm-pdbdump/LLVMOutputStyle.cpp b/tools/llvm-pdbdump/LLVMOutputStyle.cpp index 9ce6a51ca91..95ea48d8f43 100644 --- a/tools/llvm-pdbdump/LLVMOutputStyle.cpp +++ b/tools/llvm-pdbdump/LLVMOutputStyle.cpp @@ -13,8 +13,8 @@ #include "llvm/DebugInfo/CodeView/EnumTables.h" #include "llvm/DebugInfo/CodeView/ModuleSubstreamVisitor.h" #include "llvm/DebugInfo/CodeView/SymbolDumper.h" -#include "llvm/DebugInfo/MSF/MappedBlockStream.h" -#include "llvm/DebugInfo/MSF/StreamReader.h" +#include "llvm/DebugInfo/Msf/MappedBlockStream.h" +#include "llvm/DebugInfo/Msf/StreamReader.h" #include "llvm/DebugInfo/PDB/PDBExtras.h" #include "llvm/DebugInfo/PDB/Raw/DbiStream.h" #include "llvm/DebugInfo/PDB/Raw/EnumTables.h" diff --git a/tools/llvm-pdbdump/PdbYaml.cpp b/tools/llvm-pdbdump/PdbYaml.cpp index 44609a8787b..efbfa2ea93a 100644 --- a/tools/llvm-pdbdump/PdbYaml.cpp +++ b/tools/llvm-pdbdump/PdbYaml.cpp @@ -113,7 +113,7 @@ void MappingTraits::mapping(IO &IO, PdbObject &Obj) { IO.mapOptional("DbiStream", Obj.DbiStream); } -void MappingTraits::mapping(IO &IO, MSFHeaders &Obj) { +void MappingTraits::mapping(IO &IO, MsfHeaders &Obj) { IO.mapRequired("SuperBlock", Obj.SuperBlock); IO.mapRequired("NumDirectoryBlocks", Obj.NumDirectoryBlocks); IO.mapRequired("DirectoryBlocks", Obj.DirectoryBlocks); diff --git a/tools/llvm-pdbdump/PdbYaml.h b/tools/llvm-pdbdump/PdbYaml.h index 5dbc5686282..a21236b3279 100644 --- a/tools/llvm-pdbdump/PdbYaml.h +++ b/tools/llvm-pdbdump/PdbYaml.h @@ -13,7 +13,7 @@ #include "OutputStyle.h" #include "llvm/ADT/Optional.h" -#include "llvm/DebugInfo/MSF/MSFCommon.h" +#include "llvm/DebugInfo/Msf/MsfCommon.h" #include "llvm/DebugInfo/PDB/PDBTypes.h" #include "llvm/DebugInfo/PDB/Raw/PDBFile.h" #include "llvm/DebugInfo/PDB/Raw/RawConstants.h" @@ -26,7 +26,7 @@ namespace llvm { namespace pdb { namespace yaml { -struct MSFHeaders { +struct MsfHeaders { msf::SuperBlock SuperBlock; uint32_t NumDirectoryBlocks; std::vector DirectoryBlocks; @@ -70,7 +70,7 @@ struct PdbDbiStream { }; struct PdbObject { - Optional Headers; + Optional Headers; Optional> StreamSizes; Optional> StreamMap; Optional PdbStream; @@ -87,8 +87,8 @@ template <> struct MappingTraits { static void mapping(IO &IO, pdb::yaml::PdbObject &Obj); }; -template <> struct MappingTraits { - static void mapping(IO &IO, pdb::yaml::MSFHeaders &Obj); +template <> struct MappingTraits { + static void mapping(IO &IO, pdb::yaml::MsfHeaders &Obj); }; template <> struct MappingTraits { diff --git a/tools/llvm-pdbdump/YAMLOutputStyle.cpp b/tools/llvm-pdbdump/YAMLOutputStyle.cpp index ff3d5d1cfd9..745cfa7b0d1 100644 --- a/tools/llvm-pdbdump/YAMLOutputStyle.cpp +++ b/tools/llvm-pdbdump/YAMLOutputStyle.cpp @@ -53,7 +53,7 @@ Error YAMLOutputStyle::dumpFileHeaders() { if (opts::pdb2yaml::NoFileHeaders) return Error::success(); - yaml::MSFHeaders Headers; + yaml::MsfHeaders Headers; Obj.Headers.emplace(); Obj.Headers->SuperBlock.NumBlocks = File.getBlockCount(); Obj.Headers->SuperBlock.BlockMapAddr = File.getBlockMapIndex(); diff --git a/tools/llvm-pdbdump/llvm-pdbdump.cpp b/tools/llvm-pdbdump/llvm-pdbdump.cpp index 896c9cee557..e8951886215 100644 --- a/tools/llvm-pdbdump/llvm-pdbdump.cpp +++ b/tools/llvm-pdbdump/llvm-pdbdump.cpp @@ -29,8 +29,8 @@ #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Config/config.h" -#include "llvm/DebugInfo/MSF/ByteStream.h" -#include "llvm/DebugInfo/MSF/MSFBuilder.h" +#include "llvm/DebugInfo/Msf/ByteStream.h" +#include "llvm/DebugInfo/Msf/MsfBuilder.h" #include "llvm/DebugInfo/PDB/GenericError.h" #include "llvm/DebugInfo/PDB/IPDBEnumChildren.h" #include "llvm/DebugInfo/PDB/IPDBRawSymbol.h" diff --git a/tools/llvm-readobj/CMakeLists.txt b/tools/llvm-readobj/CMakeLists.txt index 0f8336ffd32..24ac2d85c7a 100644 --- a/tools/llvm-readobj/CMakeLists.txt +++ b/tools/llvm-readobj/CMakeLists.txt @@ -3,7 +3,7 @@ set(LLVM_LINK_COMPONENTS Object Support DebugInfoCodeView - DebugInfoMSF + DebugInfoMsf ) add_llvm_tool(llvm-readobj diff --git a/tools/llvm-readobj/COFFDumper.cpp b/tools/llvm-readobj/COFFDumper.cpp index 28addfabd6e..12a4292e238 100644 --- a/tools/llvm-readobj/COFFDumper.cpp +++ b/tools/llvm-readobj/COFFDumper.cpp @@ -33,7 +33,7 @@ #include "llvm/DebugInfo/CodeView/TypeIndex.h" #include "llvm/DebugInfo/CodeView/TypeRecord.h" #include "llvm/DebugInfo/CodeView/TypeStreamMerger.h" -#include "llvm/DebugInfo/MSF/ByteStream.h" +#include "llvm/DebugInfo/Msf/ByteStream.h" #include "llvm/Object/COFF.h" #include "llvm/Object/ObjectFile.h" #include "llvm/Support/COFF.h" diff --git a/tools/llvm-readobj/LLVMBuild.txt b/tools/llvm-readobj/LLVMBuild.txt index 76dd436e21d..c7219ac5f35 100644 --- a/tools/llvm-readobj/LLVMBuild.txt +++ b/tools/llvm-readobj/LLVMBuild.txt @@ -19,4 +19,4 @@ type = Tool name = llvm-readobj parent = Tools -required_libraries = all-targets BitReader Object DebugInfoCodeView DebugInfoMSF +required_libraries = all-targets BitReader Object DebugInfoCodeView DebugInfoMsf diff --git a/unittests/DebugInfo/PDB/CMakeLists.txt b/unittests/DebugInfo/PDB/CMakeLists.txt index 406b487e7a1..43f17add592 100644 --- a/unittests/DebugInfo/PDB/CMakeLists.txt +++ b/unittests/DebugInfo/PDB/CMakeLists.txt @@ -1,12 +1,12 @@ set(LLVM_LINK_COMPONENTS DebugInfoCodeView - DebugInfoMSF + DebugInfoMsf DebugInfoPDB ) set(DebugInfoPDBSources MappedBlockStreamTest.cpp - MSFBuilderTest.cpp + MsfBuilderTest.cpp PDBApiTest.cpp ) diff --git a/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp b/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp index 07591ca69d3..2d7814e55b6 100644 --- a/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp +++ b/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp @@ -9,13 +9,13 @@ #include "ErrorChecking.h" -#include "llvm/DebugInfo/MSF/ByteStream.h" -#include "llvm/DebugInfo/MSF/IMSFFile.h" -#include "llvm/DebugInfo/MSF/MappedBlockStream.h" -#include "llvm/DebugInfo/MSF/MSFStreamLayout.h" -#include "llvm/DebugInfo/MSF/StreamReader.h" -#include "llvm/DebugInfo/MSF/StreamRef.h" -#include "llvm/DebugInfo/MSF/StreamWriter.h" +#include "llvm/DebugInfo/Msf/ByteStream.h" +#include "llvm/DebugInfo/Msf/IMsfFile.h" +#include "llvm/DebugInfo/Msf/MappedBlockStream.h" +#include "llvm/DebugInfo/Msf/MsfStreamLayout.h" +#include "llvm/DebugInfo/Msf/StreamReader.h" +#include "llvm/DebugInfo/Msf/StreamRef.h" +#include "llvm/DebugInfo/Msf/StreamWriter.h" #include "gtest/gtest.h" #include @@ -39,7 +39,7 @@ public: Error readBytes(uint32_t Offset, uint32_t Size, ArrayRef &Buffer) const override { if (Offset + Size > Data.size()) - return make_error(msf_error_code::insufficient_buffer); + return make_error(msf_error_code::insufficient_buffer); Buffer = Data.slice(Offset, Size); return Error::success(); } @@ -47,7 +47,7 @@ public: Error readLongestContiguousChunk(uint32_t Offset, ArrayRef &Buffer) const override { if (Offset >= Data.size()) - return make_error(msf_error_code::insufficient_buffer); + return make_error(msf_error_code::insufficient_buffer); Buffer = Data.drop_front(Offset); return Error::success(); } @@ -56,14 +56,14 @@ public: Error writeBytes(uint32_t Offset, ArrayRef SrcData) const override { if (Offset + SrcData.size() > Data.size()) - return make_error(msf_error_code::insufficient_buffer); + return make_error(msf_error_code::insufficient_buffer); ::memcpy(&Data[Offset], SrcData.data(), SrcData.size()); return Error::success(); } Error commit() const override { return Error::success(); } - MSFStreamLayout layout() const { - return MSFStreamLayout{static_cast(Data.size()), Blocks}; + MsfStreamLayout layout() const { + return MsfStreamLayout{static_cast(Data.size()), Blocks}; } private: diff --git a/unittests/DebugInfo/PDB/MsfBuilderTest.cpp b/unittests/DebugInfo/PDB/MsfBuilderTest.cpp index 04bd9410306..2f4e9aaa96e 100644 --- a/unittests/DebugInfo/PDB/MsfBuilderTest.cpp +++ b/unittests/DebugInfo/PDB/MsfBuilderTest.cpp @@ -1,4 +1,4 @@ -//===- MSFBuilderTest.cpp Tests manipulation of MSF stream metadata ------===// +//===- MsfBuilderTest.cpp Tests manipulation of MSF stream metadata ------===// // // The LLVM Compiler Infrastructure // @@ -9,8 +9,8 @@ #include "ErrorChecking.h" -#include "llvm/DebugInfo/MSF/MSFBuilder.h" -#include "llvm/DebugInfo/MSF/MSFCommon.h" +#include "llvm/DebugInfo/Msf/MsfBuilder.h" +#include "llvm/DebugInfo/Msf/MsfCommon.h" #include "gtest/gtest.h" @@ -18,7 +18,7 @@ using namespace llvm; using namespace llvm::msf; namespace { -class MSFBuilderTest : public testing::Test { +class MsfBuilderTest : public testing::Test { protected: void initializeSimpleSuperBlock(msf::SuperBlock &SB) { initializeSuperBlock(SB); @@ -40,7 +40,7 @@ protected: }; } -TEST_F(MSFBuilderTest, ValidateSuperBlockAccept) { +TEST_F(MsfBuilderTest, ValidateSuperBlockAccept) { // Test that a known good super block passes validation. SuperBlock SB; initializeSuperBlock(SB); @@ -48,7 +48,7 @@ TEST_F(MSFBuilderTest, ValidateSuperBlockAccept) { EXPECT_NO_ERROR(msf::validateSuperBlock(SB)); } -TEST_F(MSFBuilderTest, ValidateSuperBlockReject) { +TEST_F(MsfBuilderTest, ValidateSuperBlockReject) { // Test that various known problems cause a super block to be rejected. SuperBlock SB; initializeSimpleSuperBlock(SB); @@ -75,7 +75,7 @@ TEST_F(MSFBuilderTest, ValidateSuperBlockReject) { EXPECT_ERROR(msf::validateSuperBlock(SB)); } -TEST_F(MSFBuilderTest, TestUsedBlocksMarkedAsUsed) { +TEST_F(MsfBuilderTest, TestUsedBlocksMarkedAsUsed) { // Test that when assigning a stream to a known list of blocks, the blocks // are correctly marked as used after adding, but no other incorrect blocks // are accidentally marked as used. @@ -84,7 +84,7 @@ TEST_F(MSFBuilderTest, TestUsedBlocksMarkedAsUsed) { // Allocate some extra blocks at the end so we can verify that they're free // after the initialization. uint32_t NumBlocks = msf::getMinimumBlockCount() + Blocks.size() + 10; - auto ExpectedMsf = MSFBuilder::create(Allocator, 4096, NumBlocks); + auto ExpectedMsf = MsfBuilder::create(Allocator, 4096, NumBlocks); EXPECT_EXPECTED(ExpectedMsf); auto &Msf = *ExpectedMsf; @@ -100,22 +100,22 @@ TEST_F(MSFBuilderTest, TestUsedBlocksMarkedAsUsed) { } } -TEST_F(MSFBuilderTest, TestAddStreamNoDirectoryBlockIncrease) { +TEST_F(MsfBuilderTest, TestAddStreamNoDirectoryBlockIncrease) { // Test that adding a new stream correctly updates the directory. This only // tests the case where the directory *DOES NOT* grow large enough that it // crosses a Block boundary. - auto ExpectedMsf = MSFBuilder::create(Allocator, 4096); + auto ExpectedMsf = MsfBuilder::create(Allocator, 4096); EXPECT_EXPECTED(ExpectedMsf); auto &Msf = *ExpectedMsf; auto ExpectedL1 = Msf.build(); EXPECT_EXPECTED(ExpectedL1); - MSFLayout &L1 = *ExpectedL1; + MsfLayout &L1 = *ExpectedL1; auto OldDirBlocks = L1.DirectoryBlocks; EXPECT_EQ(1U, OldDirBlocks.size()); - auto ExpectedMsf2 = MSFBuilder::create(Allocator, 4096); + auto ExpectedMsf2 = MsfBuilder::create(Allocator, 4096); EXPECT_EXPECTED(ExpectedMsf2); auto &Msf2 = *ExpectedMsf2; @@ -127,18 +127,18 @@ TEST_F(MSFBuilderTest, TestAddStreamNoDirectoryBlockIncrease) { auto ExpectedL2 = Msf2.build(); EXPECT_EXPECTED(ExpectedL2); - MSFLayout &L2 = *ExpectedL2; + MsfLayout &L2 = *ExpectedL2; auto NewDirBlocks = L2.DirectoryBlocks; EXPECT_EQ(1U, NewDirBlocks.size()); } -TEST_F(MSFBuilderTest, TestAddStreamWithDirectoryBlockIncrease) { +TEST_F(MsfBuilderTest, TestAddStreamWithDirectoryBlockIncrease) { // Test that adding a new stream correctly updates the directory. This only // tests the case where the directory *DOES* grow large enough that it // crosses a Block boundary. This is because the newly added stream occupies // so many Blocks that need to be indexed in the directory that the directory // crosses a Block boundary. - auto ExpectedMsf = MSFBuilder::create(Allocator, 4096); + auto ExpectedMsf = MsfBuilder::create(Allocator, 4096); EXPECT_EXPECTED(ExpectedMsf); auto &Msf = *ExpectedMsf; @@ -146,15 +146,15 @@ TEST_F(MSFBuilderTest, TestAddStreamWithDirectoryBlockIncrease) { auto ExpectedL1 = Msf.build(); EXPECT_EXPECTED(ExpectedL1); - MSFLayout &L1 = *ExpectedL1; + MsfLayout &L1 = *ExpectedL1; auto DirBlocks = L1.DirectoryBlocks; EXPECT_EQ(2U, DirBlocks.size()); } -TEST_F(MSFBuilderTest, TestGrowStreamNoBlockIncrease) { +TEST_F(MsfBuilderTest, TestGrowStreamNoBlockIncrease) { // Test growing an existing stream by a value that does not affect the number // of blocks it occupies. - auto ExpectedMsf = MSFBuilder::create(Allocator, 4096); + auto ExpectedMsf = MsfBuilder::create(Allocator, 4096); EXPECT_EXPECTED(ExpectedMsf); auto &Msf = *ExpectedMsf; @@ -171,12 +171,12 @@ TEST_F(MSFBuilderTest, TestGrowStreamNoBlockIncrease) { EXPECT_EQ(OldStreamBlocks, NewStreamBlocks); } -TEST_F(MSFBuilderTest, TestGrowStreamWithBlockIncrease) { +TEST_F(MsfBuilderTest, TestGrowStreamWithBlockIncrease) { // Test that growing an existing stream to a value large enough that it causes // the need to allocate new Blocks to the stream correctly updates the // stream's // block list. - auto ExpectedMsf = MSFBuilder::create(Allocator, 4096); + auto ExpectedMsf = MsfBuilder::create(Allocator, 4096); EXPECT_EXPECTED(ExpectedMsf); auto &Msf = *ExpectedMsf; @@ -194,10 +194,10 @@ TEST_F(MSFBuilderTest, TestGrowStreamWithBlockIncrease) { EXPECT_NE(NewStreamBlocks[0], NewStreamBlocks[1]); } -TEST_F(MSFBuilderTest, TestShrinkStreamNoBlockDecrease) { +TEST_F(MsfBuilderTest, TestShrinkStreamNoBlockDecrease) { // Test that shrinking an existing stream by a value that does not affect the // number of Blocks it occupies makes no changes to stream's block list. - auto ExpectedMsf = MSFBuilder::create(Allocator, 4096); + auto ExpectedMsf = MsfBuilder::create(Allocator, 4096); EXPECT_EXPECTED(ExpectedMsf); auto &Msf = *ExpectedMsf; @@ -214,11 +214,11 @@ TEST_F(MSFBuilderTest, TestShrinkStreamNoBlockDecrease) { EXPECT_EQ(OldStreamBlocks, NewStreamBlocks); } -TEST_F(MSFBuilderTest, TestShrinkStreamWithBlockDecrease) { +TEST_F(MsfBuilderTest, TestShrinkStreamWithBlockDecrease) { // Test that shrinking an existing stream to a value large enough that it // causes the need to deallocate new Blocks to the stream correctly updates // the stream's block list. - auto ExpectedMsf = MSFBuilder::create(Allocator, 4096); + auto ExpectedMsf = MsfBuilder::create(Allocator, 4096); EXPECT_EXPECTED(ExpectedMsf); auto &Msf = *ExpectedMsf; @@ -235,10 +235,10 @@ TEST_F(MSFBuilderTest, TestShrinkStreamWithBlockDecrease) { EXPECT_EQ(OldStreamBlocks[0], NewStreamBlocks[0]); } -TEST_F(MSFBuilderTest, TestRejectReusedStreamBlock) { +TEST_F(MsfBuilderTest, TestRejectReusedStreamBlock) { // Test that attempting to add a stream and assigning a block that is already // in use by another stream fails. - auto ExpectedMsf = MSFBuilder::create(Allocator, 4096); + auto ExpectedMsf = MsfBuilder::create(Allocator, 4096); EXPECT_EXPECTED(ExpectedMsf); auto &Msf = *ExpectedMsf; @@ -248,10 +248,10 @@ TEST_F(MSFBuilderTest, TestRejectReusedStreamBlock) { EXPECT_ERROR(Msf.addStream(6144, Blocks)); } -TEST_F(MSFBuilderTest, TestBlockCountsWhenAddingStreams) { +TEST_F(MsfBuilderTest, TestBlockCountsWhenAddingStreams) { // Test that when adding multiple streams, the number of used and free Blocks // allocated to the MSF file are as expected. - auto ExpectedMsf = MSFBuilder::create(Allocator, 4096); + auto ExpectedMsf = MsfBuilder::create(Allocator, 4096); EXPECT_EXPECTED(ExpectedMsf); auto &Msf = *ExpectedMsf; @@ -269,10 +269,10 @@ TEST_F(MSFBuilderTest, TestBlockCountsWhenAddingStreams) { } } -TEST_F(MSFBuilderTest, BuildMsfLayout) { - // Test that we can generate an MSFLayout structure from a valid layout +TEST_F(MsfBuilderTest, BuildMsfLayout) { + // Test that we can generate an Msf MsfLayout structure from a valid layout // specification. - auto ExpectedMsf = MSFBuilder::create(Allocator, 4096); + auto ExpectedMsf = MsfBuilder::create(Allocator, 4096); EXPECT_EXPECTED(ExpectedMsf); auto &Msf = *ExpectedMsf; @@ -286,7 +286,7 @@ TEST_F(MSFBuilderTest, BuildMsfLayout) { auto ExpectedLayout = Msf.build(); EXPECT_EXPECTED(ExpectedLayout); - MSFLayout &L = *ExpectedLayout; + MsfLayout &L = *ExpectedLayout; EXPECT_EQ(4096U, L.SB->BlockSize); EXPECT_EQ(ExpectedNumBlocks, L.SB->NumBlocks); @@ -301,8 +301,8 @@ TEST_F(MSFBuilderTest, BuildMsfLayout) { } } -TEST_F(MSFBuilderTest, UseDirectoryBlockHint) { - Expected ExpectedMsf = MSFBuilder::create( +TEST_F(MsfBuilderTest, UseDirectoryBlockHint) { + Expected ExpectedMsf = MsfBuilder::create( Allocator, 4096, msf::getMinimumBlockCount() + 1, false); EXPECT_EXPECTED(ExpectedMsf); auto &Msf = *ExpectedMsf; @@ -313,7 +313,7 @@ TEST_F(MSFBuilderTest, UseDirectoryBlockHint) { auto ExpectedLayout = Msf.build(); EXPECT_EXPECTED(ExpectedLayout); - MSFLayout &L = *ExpectedLayout; + MsfLayout &L = *ExpectedLayout; EXPECT_EQ(msf::getMinimumBlockCount() + 2, L.SB->NumBlocks); EXPECT_EQ(1U, L.DirectoryBlocks.size()); EXPECT_EQ(1U, L.StreamMap[0].size()); @@ -322,9 +322,9 @@ TEST_F(MSFBuilderTest, UseDirectoryBlockHint) { EXPECT_EQ(B + 2, L.StreamMap[0].front()); } -TEST_F(MSFBuilderTest, DirectoryBlockHintInsufficient) { - Expected ExpectedMsf = - MSFBuilder::create(Allocator, 4096, msf::getMinimumBlockCount() + 2); +TEST_F(MsfBuilderTest, DirectoryBlockHintInsufficient) { + Expected ExpectedMsf = + MsfBuilder::create(Allocator, 4096, msf::getMinimumBlockCount() + 2); EXPECT_EXPECTED(ExpectedMsf); auto &Msf = *ExpectedMsf; uint32_t B = msf::getFirstUnreservedBlock(); @@ -335,14 +335,14 @@ TEST_F(MSFBuilderTest, DirectoryBlockHintInsufficient) { auto ExpectedLayout = Msf.build(); EXPECT_EXPECTED(ExpectedLayout); - MSFLayout &L = *ExpectedLayout; + MsfLayout &L = *ExpectedLayout; EXPECT_EQ(2U, L.DirectoryBlocks.size()); EXPECT_EQ(B + 1, L.DirectoryBlocks[0]); } -TEST_F(MSFBuilderTest, DirectoryBlockHintOverestimated) { - Expected ExpectedMsf = - MSFBuilder::create(Allocator, 4096, msf::getMinimumBlockCount() + 2); +TEST_F(MsfBuilderTest, DirectoryBlockHintOverestimated) { + Expected ExpectedMsf = + MsfBuilder::create(Allocator, 4096, msf::getMinimumBlockCount() + 2); EXPECT_EXPECTED(ExpectedMsf); auto &Msf = *ExpectedMsf; @@ -353,7 +353,7 @@ TEST_F(MSFBuilderTest, DirectoryBlockHintOverestimated) { auto ExpectedLayout = Msf.build(); EXPECT_EXPECTED(ExpectedLayout); - MSFLayout &L = *ExpectedLayout; + MsfLayout &L = *ExpectedLayout; EXPECT_EQ(1U, L.DirectoryBlocks.size()); EXPECT_EQ(B + 1, L.DirectoryBlocks[0]); }