From: Zachary Turner Date: Fri, 29 Jul 2016 20:56:36 +0000 (+0000) Subject: [msf] Resubmit "Rename Msf -> MSF". X-Git-Tag: llvmorg-4.0.0-rc1~13778 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a3225b0451cc68788db10c62a66bb189817658b1;p=platform%2Fupstream%2Fllvm.git [msf] Resubmit "Rename Msf -> MSF". Previously this change was submitted from a Windows machine, so changes made to the case of filenames and directory names did not survive the commit, and as a result the CMake source file names and the on-disk file names did not match on case-sensitive file systems. I'm resubmitting this patch from a Linux system, which hopefully allows the case changes to make it through unfettered. llvm-svn: 277213 --- diff --git a/llvm/include/llvm/DebugInfo/CodeView/CVRecord.h b/llvm/include/llvm/DebugInfo/CodeView/CVRecord.h index 7cd6b45..39433dd 100644 --- a/llvm/include/llvm/DebugInfo/CodeView/CVRecord.h +++ b/llvm/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/llvm/include/llvm/DebugInfo/CodeView/ModuleSubstream.h b/llvm/include/llvm/DebugInfo/CodeView/ModuleSubstream.h index 073031f..8860ae4 100644 --- a/llvm/include/llvm/DebugInfo/CodeView/ModuleSubstream.h +++ b/llvm/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/llvm/include/llvm/DebugInfo/CodeView/ModuleSubstreamVisitor.h b/llvm/include/llvm/DebugInfo/CodeView/ModuleSubstreamVisitor.h index e1bc68f..bbdf820 100644 --- a/llvm/include/llvm/DebugInfo/CodeView/ModuleSubstreamVisitor.h +++ b/llvm/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/llvm/include/llvm/DebugInfo/CodeView/SymbolRecord.h b/llvm/include/llvm/DebugInfo/CodeView/SymbolRecord.h index b3974ec..21ad71f 100644 --- a/llvm/include/llvm/DebugInfo/CodeView/SymbolRecord.h +++ b/llvm/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/llvm/include/llvm/DebugInfo/Msf/ByteStream.h b/llvm/include/llvm/DebugInfo/MSF/ByteStream.h similarity index 91% rename from llvm/include/llvm/DebugInfo/Msf/ByteStream.h rename to llvm/include/llvm/DebugInfo/MSF/ByteStream.h index 78ea111..737693a 100644 --- a/llvm/include/llvm/DebugInfo/Msf/ByteStream.h +++ b/llvm/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/llvm/include/llvm/DebugInfo/Msf/IMsfFile.h b/llvm/include/llvm/DebugInfo/MSF/IMSFFile.h similarity index 88% rename from llvm/include/llvm/DebugInfo/Msf/IMsfFile.h rename to llvm/include/llvm/DebugInfo/MSF/IMSFFile.h index 1c7eeb9..6c5754f 100644 --- a/llvm/include/llvm/DebugInfo/Msf/IMsfFile.h +++ b/llvm/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/llvm/include/llvm/DebugInfo/Msf/MsfBuilder.h b/llvm/include/llvm/DebugInfo/MSF/MSFBuilder.h similarity index 94% rename from llvm/include/llvm/DebugInfo/Msf/MsfBuilder.h rename to llvm/include/llvm/DebugInfo/MSF/MSFBuilder.h index 0ccdd6f..bf29e62 100644 --- a/llvm/include/llvm/DebugInfo/Msf/MsfBuilder.h +++ b/llvm/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/llvm/include/llvm/DebugInfo/Msf/MsfCommon.h b/llvm/include/llvm/DebugInfo/MSF/MSFCommon.h similarity index 96% rename from llvm/include/llvm/DebugInfo/Msf/MsfCommon.h rename to llvm/include/llvm/DebugInfo/MSF/MSFCommon.h index 86f20bd..58e6a1a 100644 --- a/llvm/include/llvm/DebugInfo/Msf/MsfCommon.h +++ b/llvm/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/llvm/include/llvm/DebugInfo/Msf/MsfError.h b/llvm/include/llvm/DebugInfo/MSF/MSFError.h similarity index 79% rename from llvm/include/llvm/DebugInfo/Msf/MsfError.h rename to llvm/include/llvm/DebugInfo/MSF/MSFError.h index 4cdbaec..e66aeca 100644 --- a/llvm/include/llvm/DebugInfo/Msf/MsfError.h +++ b/llvm/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/llvm/include/llvm/DebugInfo/Msf/MsfStreamLayout.h b/llvm/include/llvm/DebugInfo/MSF/MSFStreamLayout.h similarity index 79% rename from llvm/include/llvm/DebugInfo/Msf/MsfStreamLayout.h rename to llvm/include/llvm/DebugInfo/MSF/MSFStreamLayout.h index 68a3ca3..1b987aa 100644 --- a/llvm/include/llvm/DebugInfo/Msf/MsfStreamLayout.h +++ b/llvm/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/llvm/include/llvm/DebugInfo/Msf/MappedBlockStream.h b/llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h similarity index 76% rename from llvm/include/llvm/DebugInfo/Msf/MappedBlockStream.h rename to llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h index f66826b..aef6b01 100644 --- a/llvm/include/llvm/DebugInfo/Msf/MappedBlockStream.h +++ b/llvm/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 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 +/// 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 /// 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/llvm/include/llvm/DebugInfo/Msf/StreamArray.h b/llvm/include/llvm/DebugInfo/MSF/StreamArray.h similarity index 99% rename from llvm/include/llvm/DebugInfo/Msf/StreamArray.h rename to llvm/include/llvm/DebugInfo/MSF/StreamArray.h index 569fb9b..88f41dd 100644 --- a/llvm/include/llvm/DebugInfo/Msf/StreamArray.h +++ b/llvm/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/llvm/include/llvm/DebugInfo/Msf/StreamInterface.h b/llvm/include/llvm/DebugInfo/MSF/StreamInterface.h similarity index 100% rename from llvm/include/llvm/DebugInfo/Msf/StreamInterface.h rename to llvm/include/llvm/DebugInfo/MSF/StreamInterface.h diff --git a/llvm/include/llvm/DebugInfo/Msf/StreamReader.h b/llvm/include/llvm/DebugInfo/MSF/StreamReader.h similarity index 89% rename from llvm/include/llvm/DebugInfo/Msf/StreamReader.h rename to llvm/include/llvm/DebugInfo/MSF/StreamReader.h index 31f437f..ac43aaa 100644 --- a/llvm/include/llvm/DebugInfo/Msf/StreamReader.h +++ b/llvm/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/llvm/include/llvm/DebugInfo/Msf/StreamRef.h b/llvm/include/llvm/DebugInfo/MSF/StreamRef.h similarity index 92% rename from llvm/include/llvm/DebugInfo/Msf/StreamRef.h rename to llvm/include/llvm/DebugInfo/MSF/StreamRef.h index ff280c0..c25fd38 100644 --- a/llvm/include/llvm/DebugInfo/Msf/StreamRef.h +++ b/llvm/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/llvm/include/llvm/DebugInfo/Msf/StreamWriter.h b/llvm/include/llvm/DebugInfo/MSF/StreamWriter.h similarity index 91% rename from llvm/include/llvm/DebugInfo/Msf/StreamWriter.h rename to llvm/include/llvm/DebugInfo/MSF/StreamWriter.h index 0419489..88043c7 100644 --- a/llvm/include/llvm/DebugInfo/Msf/StreamWriter.h +++ b/llvm/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/llvm/include/llvm/DebugInfo/PDB/Raw/DbiStream.h b/llvm/include/llvm/DebugInfo/PDB/Raw/DbiStream.h index 7802f48..c97ca32 100644 --- a/llvm/include/llvm/DebugInfo/PDB/Raw/DbiStream.h +++ b/llvm/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/llvm/include/llvm/DebugInfo/PDB/Raw/DbiStreamBuilder.h b/llvm/include/llvm/DebugInfo/PDB/Raw/DbiStreamBuilder.h index a3c8fc5..9b93efe 100644 --- a/llvm/include/llvm/DebugInfo/PDB/Raw/DbiStreamBuilder.h +++ b/llvm/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/llvm/include/llvm/DebugInfo/PDB/Raw/InfoStream.h b/llvm/include/llvm/DebugInfo/PDB/Raw/InfoStream.h index e71c63d..6b8b94f 100644 --- a/llvm/include/llvm/DebugInfo/PDB/Raw/InfoStream.h +++ b/llvm/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/llvm/include/llvm/DebugInfo/PDB/Raw/InfoStreamBuilder.h b/llvm/include/llvm/DebugInfo/PDB/Raw/InfoStreamBuilder.h index f3c3ead..870c5d5 100644 --- a/llvm/include/llvm/DebugInfo/PDB/Raw/InfoStreamBuilder.h +++ b/llvm/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/llvm/include/llvm/DebugInfo/PDB/Raw/ModInfo.h b/llvm/include/llvm/DebugInfo/PDB/Raw/ModInfo.h index e48b6aa..b084f5b 100644 --- a/llvm/include/llvm/DebugInfo/PDB/Raw/ModInfo.h +++ b/llvm/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/llvm/include/llvm/DebugInfo/PDB/Raw/ModStream.h b/llvm/include/llvm/DebugInfo/PDB/Raw/ModStream.h index 57e84ed..f5296e0 100644 --- a/llvm/include/llvm/DebugInfo/PDB/Raw/ModStream.h +++ b/llvm/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/llvm/include/llvm/DebugInfo/PDB/Raw/NameHashTable.h b/llvm/include/llvm/DebugInfo/PDB/Raw/NameHashTable.h index c9dd95d..00d022d 100644 --- a/llvm/include/llvm/DebugInfo/PDB/Raw/NameHashTable.h +++ b/llvm/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/llvm/include/llvm/DebugInfo/PDB/Raw/PDBFile.h b/llvm/include/llvm/DebugInfo/PDB/Raw/PDBFile.h index b0be4fb..29e931f 100644 --- a/llvm/include/llvm/DebugInfo/PDB/Raw/PDBFile.h +++ b/llvm/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/llvm/include/llvm/DebugInfo/PDB/Raw/PDBFileBuilder.h b/llvm/include/llvm/DebugInfo/PDB/Raw/PDBFileBuilder.h index 6242f42..b9c06db 100644 --- a/llvm/include/llvm/DebugInfo/PDB/Raw/PDBFileBuilder.h +++ b/llvm/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/llvm/include/llvm/DebugInfo/PDB/Raw/PublicsStream.h b/llvm/include/llvm/DebugInfo/PDB/Raw/PublicsStream.h index a302d85..ba8ed11 100644 --- a/llvm/include/llvm/DebugInfo/PDB/Raw/PublicsStream.h +++ b/llvm/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/llvm/include/llvm/DebugInfo/PDB/Raw/TpiStream.h b/llvm/include/llvm/DebugInfo/PDB/Raw/TpiStream.h index 31c0267..e518333 100644 --- a/llvm/include/llvm/DebugInfo/PDB/Raw/TpiStream.h +++ b/llvm/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/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp index 874a154..9d5d212 100644 --- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/llvm/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/llvm/lib/CodeGen/AsmPrinter/LLVMBuild.txt b/llvm/lib/CodeGen/AsmPrinter/LLVMBuild.txt index 3b240f2..c40c5e7 100644 --- a/llvm/lib/CodeGen/AsmPrinter/LLVMBuild.txt +++ b/llvm/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/llvm/lib/DebugInfo/CMakeLists.txt b/llvm/lib/DebugInfo/CMakeLists.txt index 944dfb6..e7be0a0 100644 --- a/llvm/lib/DebugInfo/CMakeLists.txt +++ b/llvm/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/llvm/lib/DebugInfo/CodeView/LLVMBuild.txt b/llvm/lib/DebugInfo/CodeView/LLVMBuild.txt index c1e35ab..f799a9e 100644 --- a/llvm/lib/DebugInfo/CodeView/LLVMBuild.txt +++ b/llvm/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/llvm/lib/DebugInfo/CodeView/ModuleSubstream.cpp b/llvm/lib/DebugInfo/CodeView/ModuleSubstream.cpp index 6473338..768ebaa 100644 --- a/llvm/lib/DebugInfo/CodeView/ModuleSubstream.cpp +++ b/llvm/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/llvm/lib/DebugInfo/CodeView/ModuleSubstreamVisitor.cpp b/llvm/lib/DebugInfo/CodeView/ModuleSubstreamVisitor.cpp index f5afe61..5247932 100644 --- a/llvm/lib/DebugInfo/CodeView/ModuleSubstreamVisitor.cpp +++ b/llvm/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/llvm/lib/DebugInfo/CodeView/TypeDumper.cpp b/llvm/lib/DebugInfo/CodeView/TypeDumper.cpp index 428914b..5ceaa59 100644 --- a/llvm/lib/DebugInfo/CodeView/TypeDumper.cpp +++ b/llvm/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/llvm/lib/DebugInfo/LLVMBuild.txt b/llvm/lib/DebugInfo/LLVMBuild.txt index 876c43a..86503e1 100644 --- a/llvm/lib/DebugInfo/LLVMBuild.txt +++ b/llvm/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/llvm/lib/DebugInfo/Msf/CMakeLists.txt b/llvm/lib/DebugInfo/MSF/CMakeLists.txt similarity index 62% rename from llvm/lib/DebugInfo/Msf/CMakeLists.txt rename to llvm/lib/DebugInfo/MSF/CMakeLists.txt index 5342c54..dcb2a8e 100644 --- a/llvm/lib/DebugInfo/Msf/CMakeLists.txt +++ b/llvm/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/llvm/lib/DebugInfo/Msf/LLVMBuild.txt b/llvm/lib/DebugInfo/MSF/LLVMBuild.txt similarity index 87% rename from llvm/lib/DebugInfo/Msf/LLVMBuild.txt rename to llvm/lib/DebugInfo/MSF/LLVMBuild.txt index 4598c43..391547c 100644 --- a/llvm/lib/DebugInfo/Msf/LLVMBuild.txt +++ b/llvm/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/llvm/lib/DebugInfo/Msf/MsfBuilder.cpp b/llvm/lib/DebugInfo/MSF/MSFBuilder.cpp similarity index 84% rename from llvm/lib/DebugInfo/Msf/MsfBuilder.cpp rename to llvm/lib/DebugInfo/MSF/MSFBuilder.cpp index 0128264..62960b6 100644 --- a/llvm/lib/DebugInfo/Msf/MsfBuilder.cpp +++ b/llvm/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/llvm/lib/DebugInfo/Msf/MsfCommon.cpp b/llvm/lib/DebugInfo/MSF/MSFCommon.cpp similarity index 76% rename from llvm/lib/DebugInfo/Msf/MsfCommon.cpp rename to llvm/lib/DebugInfo/MSF/MSFCommon.cpp index e22087f..d79ccaf 100644 --- a/llvm/lib/DebugInfo/Msf/MsfCommon.cpp +++ b/llvm/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/llvm/lib/DebugInfo/Msf/MsfError.cpp b/llvm/lib/DebugInfo/MSF/MSFError.cpp similarity index 73% rename from llvm/lib/DebugInfo/Msf/MsfError.cpp rename to llvm/lib/DebugInfo/MSF/MSFError.cpp index 246beb9..5272cad 100644 --- a/llvm/lib/DebugInfo/Msf/MsfError.cpp +++ b/llvm/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/llvm/lib/DebugInfo/Msf/MappedBlockStream.cpp b/llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp similarity index 91% rename from llvm/lib/DebugInfo/Msf/MappedBlockStream.cpp rename to llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp index 7d5be88..0a3b2b9 100644 --- a/llvm/lib/DebugInfo/Msf/MappedBlockStream.cpp +++ b/llvm/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/llvm/lib/DebugInfo/Msf/StreamReader.cpp b/llvm/lib/DebugInfo/MSF/StreamReader.cpp similarity index 92% rename from llvm/lib/DebugInfo/Msf/StreamReader.cpp rename to llvm/lib/DebugInfo/MSF/StreamReader.cpp index 1c7e835..eb3d3e8 100644 --- a/llvm/lib/DebugInfo/Msf/StreamReader.cpp +++ b/llvm/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/llvm/lib/DebugInfo/Msf/StreamWriter.cpp b/llvm/lib/DebugInfo/MSF/StreamWriter.cpp similarity index 92% rename from llvm/lib/DebugInfo/Msf/StreamWriter.cpp rename to llvm/lib/DebugInfo/MSF/StreamWriter.cpp index 40bc0394..a91cffe 100644 --- a/llvm/lib/DebugInfo/Msf/StreamWriter.cpp +++ b/llvm/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/llvm/lib/DebugInfo/PDB/LLVMBuild.txt b/llvm/lib/DebugInfo/PDB/LLVMBuild.txt index a219683..d9af656 100644 --- a/llvm/lib/DebugInfo/PDB/LLVMBuild.txt +++ b/llvm/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/llvm/lib/DebugInfo/PDB/Raw/DbiStream.cpp b/llvm/lib/DebugInfo/PDB/Raw/DbiStream.cpp index 564246a..9ed3470 100644 --- a/llvm/lib/DebugInfo/PDB/Raw/DbiStream.cpp +++ b/llvm/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/llvm/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp b/llvm/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp index b68f1dc..711295d 100644 --- a/llvm/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp +++ b/llvm/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/llvm/lib/DebugInfo/PDB/Raw/InfoStream.cpp b/llvm/lib/DebugInfo/PDB/Raw/InfoStream.cpp index 4df24f24..f19535d 100644 --- a/llvm/lib/DebugInfo/PDB/Raw/InfoStream.cpp +++ b/llvm/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/llvm/lib/DebugInfo/PDB/Raw/InfoStreamBuilder.cpp b/llvm/lib/DebugInfo/PDB/Raw/InfoStreamBuilder.cpp index d20c37d..a06c8fd 100644 --- a/llvm/lib/DebugInfo/PDB/Raw/InfoStreamBuilder.cpp +++ b/llvm/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/llvm/lib/DebugInfo/PDB/Raw/ModInfo.cpp b/llvm/lib/DebugInfo/PDB/Raw/ModInfo.cpp index 7b77bcd..436aa84 100644 --- a/llvm/lib/DebugInfo/PDB/Raw/ModInfo.cpp +++ b/llvm/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/llvm/lib/DebugInfo/PDB/Raw/ModStream.cpp b/llvm/lib/DebugInfo/PDB/Raw/ModStream.cpp index 25bb9d1..3810b29 100644 --- a/llvm/lib/DebugInfo/PDB/Raw/ModStream.cpp +++ b/llvm/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/llvm/lib/DebugInfo/PDB/Raw/NameHashTable.cpp b/llvm/lib/DebugInfo/PDB/Raw/NameHashTable.cpp index 3e22e76..84cccb3 100644 --- a/llvm/lib/DebugInfo/PDB/Raw/NameHashTable.cpp +++ b/llvm/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/llvm/lib/DebugInfo/PDB/Raw/NameMap.cpp b/llvm/lib/DebugInfo/PDB/Raw/NameMap.cpp index 70b810f..40992e9 100644 --- a/llvm/lib/DebugInfo/PDB/Raw/NameMap.cpp +++ b/llvm/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/llvm/lib/DebugInfo/PDB/Raw/NameMapBuilder.cpp b/llvm/lib/DebugInfo/PDB/Raw/NameMapBuilder.cpp index 3bb4503..918a828 100644 --- a/llvm/lib/DebugInfo/PDB/Raw/NameMapBuilder.cpp +++ b/llvm/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/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp b/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp index 3529860..ddc8102 100644 --- a/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp +++ b/llvm/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/llvm/lib/DebugInfo/PDB/Raw/PDBFileBuilder.cpp b/llvm/lib/DebugInfo/PDB/Raw/PDBFileBuilder.cpp index 1a0503f..6e4bb16 100644 --- a/llvm/lib/DebugInfo/PDB/Raw/PDBFileBuilder.cpp +++ b/llvm/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/llvm/lib/DebugInfo/PDB/Raw/PublicsStream.cpp b/llvm/lib/DebugInfo/PDB/Raw/PublicsStream.cpp index 8f96e5e..5d4431d 100644 --- a/llvm/lib/DebugInfo/PDB/Raw/PublicsStream.cpp +++ b/llvm/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/llvm/lib/DebugInfo/PDB/Raw/RawSession.cpp b/llvm/lib/DebugInfo/PDB/Raw/RawSession.cpp index a83689f5..ad7a3fc 100644 --- a/llvm/lib/DebugInfo/PDB/Raw/RawSession.cpp +++ b/llvm/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/llvm/lib/DebugInfo/PDB/Raw/SymbolStream.cpp b/llvm/lib/DebugInfo/PDB/Raw/SymbolStream.cpp index a604df3..2f3ac34 100644 --- a/llvm/lib/DebugInfo/PDB/Raw/SymbolStream.cpp +++ b/llvm/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/llvm/lib/DebugInfo/PDB/Raw/TpiStream.cpp b/llvm/lib/DebugInfo/PDB/Raw/TpiStream.cpp index a39a040..1398628 100644 --- a/llvm/lib/DebugInfo/PDB/Raw/TpiStream.cpp +++ b/llvm/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/llvm/tools/llvm-pdbdump/CMakeLists.txt b/llvm/tools/llvm-pdbdump/CMakeLists.txt index 3a630ab..56324e8 100644 --- a/llvm/tools/llvm-pdbdump/CMakeLists.txt +++ b/llvm/tools/llvm-pdbdump/CMakeLists.txt @@ -1,6 +1,6 @@ set(LLVM_LINK_COMPONENTS DebugInfoCodeView - DebugInfoMsf + DebugInfoMSF DebugInfoPDB Object Support diff --git a/llvm/tools/llvm-pdbdump/LLVMBuild.txt b/llvm/tools/llvm-pdbdump/LLVMBuild.txt index 38f6e54..4043e13 100644 --- a/llvm/tools/llvm-pdbdump/LLVMBuild.txt +++ b/llvm/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/llvm/tools/llvm-pdbdump/LLVMOutputStyle.cpp b/llvm/tools/llvm-pdbdump/LLVMOutputStyle.cpp index 95ea48d..9ce6a51 100644 --- a/llvm/tools/llvm-pdbdump/LLVMOutputStyle.cpp +++ b/llvm/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/llvm/tools/llvm-pdbdump/PdbYaml.cpp b/llvm/tools/llvm-pdbdump/PdbYaml.cpp index efbfa2e..44609a8 100644 --- a/llvm/tools/llvm-pdbdump/PdbYaml.cpp +++ b/llvm/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/llvm/tools/llvm-pdbdump/PdbYaml.h b/llvm/tools/llvm-pdbdump/PdbYaml.h index a21236b..5dbc568 100644 --- a/llvm/tools/llvm-pdbdump/PdbYaml.h +++ b/llvm/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/llvm/tools/llvm-pdbdump/YAMLOutputStyle.cpp b/llvm/tools/llvm-pdbdump/YAMLOutputStyle.cpp index 745cfa7..ff3d5d1 100644 --- a/llvm/tools/llvm-pdbdump/YAMLOutputStyle.cpp +++ b/llvm/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/llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp b/llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp index e895188..896c9ce 100644 --- a/llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp +++ b/llvm/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/llvm/tools/llvm-readobj/CMakeLists.txt b/llvm/tools/llvm-readobj/CMakeLists.txt index 24ac2d8..0f8336f 100644 --- a/llvm/tools/llvm-readobj/CMakeLists.txt +++ b/llvm/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/llvm/tools/llvm-readobj/COFFDumper.cpp b/llvm/tools/llvm-readobj/COFFDumper.cpp index 12a4292..28addfa 100644 --- a/llvm/tools/llvm-readobj/COFFDumper.cpp +++ b/llvm/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/llvm/tools/llvm-readobj/LLVMBuild.txt b/llvm/tools/llvm-readobj/LLVMBuild.txt index c7219ac..76dd436 100644 --- a/llvm/tools/llvm-readobj/LLVMBuild.txt +++ b/llvm/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/llvm/unittests/DebugInfo/PDB/CMakeLists.txt b/llvm/unittests/DebugInfo/PDB/CMakeLists.txt index 43f17ad..406b487 100644 --- a/llvm/unittests/DebugInfo/PDB/CMakeLists.txt +++ b/llvm/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/llvm/unittests/DebugInfo/PDB/MsfBuilderTest.cpp b/llvm/unittests/DebugInfo/PDB/MSFBuilderTest.cpp similarity index 81% rename from llvm/unittests/DebugInfo/PDB/MsfBuilderTest.cpp rename to llvm/unittests/DebugInfo/PDB/MSFBuilderTest.cpp index 2f4e9aa..04bd941 100644 --- a/llvm/unittests/DebugInfo/PDB/MsfBuilderTest.cpp +++ b/llvm/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 Msf MsfLayout structure from a valid layout +TEST_F(MSFBuilderTest, BuildMsfLayout) { + // Test that we can generate an 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]); } diff --git a/llvm/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp b/llvm/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp index 2d7814e..07591ca 100644 --- a/llvm/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp +++ b/llvm/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: