[llvm] r277190 - [msf] Rename Msf to MSF.
Bruno Cardoso Lopes via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 29 11:47:13 PDT 2016
Hi Zachary,
Looks like this is causing CMAKE issues:
http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_build/28283
Can you take a look?
On Fri, Jul 29, 2016 at 11:24 AM, Zachary Turner via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: zturner
> Date: Fri Jul 29 13:24:26 2016
> New Revision: 277190
>
> URL: http://llvm.org/viewvc/llvm-project?rev=277190&view=rev
> Log:
> [msf] Rename Msf to MSF.
>
> In a previous patch, it was suggested to use all caps instead of
> rolling caps for initialisms, so this patch changes everything
> to do this.
>
> Added:
> llvm/trunk/include/llvm/DebugInfo/MSF/
> llvm/trunk/include/llvm/DebugInfo/MSF/ByteStream.h
> - copied, changed from r277188, llvm/trunk/include/llvm/DebugInfo/Msf/ByteStream.h
> llvm/trunk/include/llvm/DebugInfo/MSF/IMsfFile.h
> - copied, changed from r277188, llvm/trunk/include/llvm/DebugInfo/Msf/IMsfFile.h
> llvm/trunk/include/llvm/DebugInfo/MSF/MappedBlockStream.h
> - copied, changed from r277188, llvm/trunk/include/llvm/DebugInfo/Msf/MappedBlockStream.h
> llvm/trunk/include/llvm/DebugInfo/MSF/MsfBuilder.h
> - copied, changed from r277188, llvm/trunk/include/llvm/DebugInfo/Msf/MsfBuilder.h
> llvm/trunk/include/llvm/DebugInfo/MSF/MsfCommon.h
> - copied, changed from r277188, llvm/trunk/include/llvm/DebugInfo/Msf/MsfCommon.h
> llvm/trunk/include/llvm/DebugInfo/MSF/MsfError.h
> - copied, changed from r277188, llvm/trunk/include/llvm/DebugInfo/Msf/MsfError.h
> llvm/trunk/include/llvm/DebugInfo/MSF/MsfStreamLayout.h
> - copied, changed from r277188, llvm/trunk/include/llvm/DebugInfo/Msf/MsfStreamLayout.h
> llvm/trunk/include/llvm/DebugInfo/MSF/StreamArray.h
> - copied, changed from r277188, llvm/trunk/include/llvm/DebugInfo/Msf/StreamArray.h
> llvm/trunk/include/llvm/DebugInfo/MSF/StreamInterface.h
> - copied, changed from r277188, llvm/trunk/include/llvm/DebugInfo/Msf/StreamInterface.h
> llvm/trunk/include/llvm/DebugInfo/MSF/StreamReader.h
> - copied, changed from r277188, llvm/trunk/include/llvm/DebugInfo/Msf/StreamReader.h
> llvm/trunk/include/llvm/DebugInfo/MSF/StreamRef.h
> - copied, changed from r277188, llvm/trunk/include/llvm/DebugInfo/Msf/StreamRef.h
> llvm/trunk/include/llvm/DebugInfo/MSF/StreamWriter.h
> - copied, changed from r277188, llvm/trunk/include/llvm/DebugInfo/Msf/StreamWriter.h
> llvm/trunk/lib/DebugInfo/MSF/
> llvm/trunk/lib/DebugInfo/MSF/CMakeLists.txt
> - copied, changed from r277188, llvm/trunk/lib/DebugInfo/Msf/CMakeLists.txt
> llvm/trunk/lib/DebugInfo/MSF/LLVMBuild.txt
> - copied, changed from r277188, llvm/trunk/lib/DebugInfo/Msf/LLVMBuild.txt
> llvm/trunk/lib/DebugInfo/MSF/MappedBlockStream.cpp
> - copied, changed from r277188, llvm/trunk/lib/DebugInfo/Msf/MappedBlockStream.cpp
> llvm/trunk/lib/DebugInfo/MSF/MsfBuilder.cpp
> - copied, changed from r277188, llvm/trunk/lib/DebugInfo/Msf/MsfBuilder.cpp
> llvm/trunk/lib/DebugInfo/MSF/MsfCommon.cpp
> - copied, changed from r277188, llvm/trunk/lib/DebugInfo/Msf/MsfCommon.cpp
> llvm/trunk/lib/DebugInfo/MSF/MsfError.cpp
> - copied, changed from r277188, llvm/trunk/lib/DebugInfo/Msf/MsfError.cpp
> llvm/trunk/lib/DebugInfo/MSF/StreamReader.cpp
> - copied, changed from r277188, llvm/trunk/lib/DebugInfo/Msf/StreamReader.cpp
> llvm/trunk/lib/DebugInfo/MSF/StreamWriter.cpp
> - copied, changed from r277188, llvm/trunk/lib/DebugInfo/Msf/StreamWriter.cpp
> Removed:
> llvm/trunk/include/llvm/DebugInfo/Msf/ByteStream.h
> llvm/trunk/include/llvm/DebugInfo/Msf/IMsfFile.h
> llvm/trunk/include/llvm/DebugInfo/Msf/MappedBlockStream.h
> llvm/trunk/include/llvm/DebugInfo/Msf/MsfBuilder.h
> llvm/trunk/include/llvm/DebugInfo/Msf/MsfCommon.h
> llvm/trunk/include/llvm/DebugInfo/Msf/MsfError.h
> llvm/trunk/include/llvm/DebugInfo/Msf/MsfStreamLayout.h
> llvm/trunk/include/llvm/DebugInfo/Msf/StreamArray.h
> llvm/trunk/include/llvm/DebugInfo/Msf/StreamInterface.h
> llvm/trunk/include/llvm/DebugInfo/Msf/StreamReader.h
> llvm/trunk/include/llvm/DebugInfo/Msf/StreamRef.h
> llvm/trunk/include/llvm/DebugInfo/Msf/StreamWriter.h
> llvm/trunk/lib/DebugInfo/Msf/CMakeLists.txt
> llvm/trunk/lib/DebugInfo/Msf/LLVMBuild.txt
> llvm/trunk/lib/DebugInfo/Msf/MappedBlockStream.cpp
> llvm/trunk/lib/DebugInfo/Msf/MsfBuilder.cpp
> llvm/trunk/lib/DebugInfo/Msf/MsfCommon.cpp
> llvm/trunk/lib/DebugInfo/Msf/MsfError.cpp
> llvm/trunk/lib/DebugInfo/Msf/StreamReader.cpp
> llvm/trunk/lib/DebugInfo/Msf/StreamWriter.cpp
> Modified:
> llvm/trunk/include/llvm/DebugInfo/CodeView/CVRecord.h
> llvm/trunk/include/llvm/DebugInfo/CodeView/ModuleSubstream.h
> llvm/trunk/include/llvm/DebugInfo/CodeView/ModuleSubstreamVisitor.h
> llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecord.h
> llvm/trunk/include/llvm/DebugInfo/PDB/Raw/DbiStream.h
> llvm/trunk/include/llvm/DebugInfo/PDB/Raw/DbiStreamBuilder.h
> llvm/trunk/include/llvm/DebugInfo/PDB/Raw/InfoStream.h
> llvm/trunk/include/llvm/DebugInfo/PDB/Raw/InfoStreamBuilder.h
> llvm/trunk/include/llvm/DebugInfo/PDB/Raw/ModInfo.h
> llvm/trunk/include/llvm/DebugInfo/PDB/Raw/ModStream.h
> llvm/trunk/include/llvm/DebugInfo/PDB/Raw/NameHashTable.h
> llvm/trunk/include/llvm/DebugInfo/PDB/Raw/PDBFile.h
> llvm/trunk/include/llvm/DebugInfo/PDB/Raw/PDBFileBuilder.h
> llvm/trunk/include/llvm/DebugInfo/PDB/Raw/PublicsStream.h
> llvm/trunk/include/llvm/DebugInfo/PDB/Raw/TpiStream.h
> llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
> llvm/trunk/lib/CodeGen/AsmPrinter/LLVMBuild.txt
> llvm/trunk/lib/DebugInfo/CMakeLists.txt
> llvm/trunk/lib/DebugInfo/CodeView/LLVMBuild.txt
> llvm/trunk/lib/DebugInfo/CodeView/ModuleSubstream.cpp
> llvm/trunk/lib/DebugInfo/CodeView/ModuleSubstreamVisitor.cpp
> llvm/trunk/lib/DebugInfo/CodeView/TypeDumper.cpp
> llvm/trunk/lib/DebugInfo/LLVMBuild.txt
> llvm/trunk/lib/DebugInfo/PDB/LLVMBuild.txt
> llvm/trunk/lib/DebugInfo/PDB/Raw/DbiStream.cpp
> llvm/trunk/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp
> llvm/trunk/lib/DebugInfo/PDB/Raw/InfoStream.cpp
> llvm/trunk/lib/DebugInfo/PDB/Raw/InfoStreamBuilder.cpp
> llvm/trunk/lib/DebugInfo/PDB/Raw/ModInfo.cpp
> llvm/trunk/lib/DebugInfo/PDB/Raw/ModStream.cpp
> llvm/trunk/lib/DebugInfo/PDB/Raw/NameHashTable.cpp
> llvm/trunk/lib/DebugInfo/PDB/Raw/NameMap.cpp
> llvm/trunk/lib/DebugInfo/PDB/Raw/NameMapBuilder.cpp
> llvm/trunk/lib/DebugInfo/PDB/Raw/PDBFile.cpp
> llvm/trunk/lib/DebugInfo/PDB/Raw/PDBFileBuilder.cpp
> llvm/trunk/lib/DebugInfo/PDB/Raw/PublicsStream.cpp
> llvm/trunk/lib/DebugInfo/PDB/Raw/RawSession.cpp
> llvm/trunk/lib/DebugInfo/PDB/Raw/SymbolStream.cpp
> llvm/trunk/lib/DebugInfo/PDB/Raw/TpiStream.cpp
> llvm/trunk/tools/llvm-pdbdump/CMakeLists.txt
> llvm/trunk/tools/llvm-pdbdump/LLVMBuild.txt
> llvm/trunk/tools/llvm-pdbdump/LLVMOutputStyle.cpp
> llvm/trunk/tools/llvm-pdbdump/PdbYaml.cpp
> llvm/trunk/tools/llvm-pdbdump/PdbYaml.h
> llvm/trunk/tools/llvm-pdbdump/YAMLOutputStyle.cpp
> llvm/trunk/tools/llvm-pdbdump/llvm-pdbdump.cpp
> llvm/trunk/tools/llvm-readobj/CMakeLists.txt
> llvm/trunk/tools/llvm-readobj/COFFDumper.cpp
> llvm/trunk/tools/llvm-readobj/LLVMBuild.txt
> llvm/trunk/unittests/DebugInfo/PDB/CMakeLists.txt
> llvm/trunk/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp
> llvm/trunk/unittests/DebugInfo/PDB/MsfBuilderTest.cpp
>
> Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/CVRecord.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/CVRecord.h?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/CodeView/CVRecord.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/CodeView/CVRecord.h Fri Jul 29 13:24:26 2016
> @@ -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 {
>
> Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/ModuleSubstream.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/ModuleSubstream.h?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/CodeView/ModuleSubstream.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/CodeView/ModuleSubstream.h Fri Jul 29 13:24:26 2016
> @@ -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"
>
>
> Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/ModuleSubstreamVisitor.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/ModuleSubstreamVisitor.h?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/CodeView/ModuleSubstreamVisitor.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/CodeView/ModuleSubstreamVisitor.h Fri Jul 29 13:24:26 2016
> @@ -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 {
>
> Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecord.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecord.h?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecord.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecord.h Fri Jul 29 13:24:26 2016
> @@ -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"
>
>
> Copied: llvm/trunk/include/llvm/DebugInfo/MSF/ByteStream.h (from r277188, llvm/trunk/include/llvm/DebugInfo/Msf/ByteStream.h)
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/MSF/ByteStream.h?p2=llvm/trunk/include/llvm/DebugInfo/MSF/ByteStream.h&p1=llvm/trunk/include/llvm/DebugInfo/Msf/ByteStream.h&r1=277188&r2=277190&rev=277190&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/Msf/ByteStream.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/MSF/ByteStream.h Fri Jul 29 13:24:26 2016
> @@ -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<uint8_t> &Buffer) const override {
> if (Offset > Data.size())
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> + return make_error<MSFError>(msf_error_code::insufficient_buffer);
> if (Data.size() < Size + Offset)
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> + return make_error<MSFError>(msf_error_code::insufficient_buffer);
> Buffer = Data.slice(Offset, Size);
> return Error::success();
> }
> Error readLongestContiguousChunk(uint32_t Offset,
> ArrayRef<uint8_t> &Buffer) const override {
> if (Offset >= Data.size())
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> + return make_error<MSFError>(msf_error_code::insufficient_buffer);
> Buffer = Data.slice(Offset);
> return Error::success();
> }
> @@ -90,9 +90,9 @@ public:
>
> Error writeBytes(uint32_t Offset, ArrayRef<uint8_t> Buffer) const override {
> if (Data.size() < Buffer.size())
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> + return make_error<MSFError>(msf_error_code::insufficient_buffer);
> if (Offset > Buffer.size() - Data.size())
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> + return make_error<MSFError>(msf_error_code::insufficient_buffer);
>
> uint8_t *DataPtr = const_cast<uint8_t *>(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<MsfError>(msf_error_code::not_writable);
> + return llvm::make_error<MSFError>(msf_error_code::not_writable);
> return Error::success();
> }
>
>
> Copied: llvm/trunk/include/llvm/DebugInfo/MSF/IMsfFile.h (from r277188, llvm/trunk/include/llvm/DebugInfo/Msf/IMsfFile.h)
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/MSF/IMsfFile.h?p2=llvm/trunk/include/llvm/DebugInfo/MSF/IMsfFile.h&p1=llvm/trunk/include/llvm/DebugInfo/Msf/IMsfFile.h&r1=277188&r2=277190&rev=277190&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/Msf/IMsfFile.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/MSF/IMsfFile.h Fri Jul 29 13:24:26 2016
> @@ -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;
>
> Copied: llvm/trunk/include/llvm/DebugInfo/MSF/MappedBlockStream.h (from r277188, llvm/trunk/include/llvm/DebugInfo/Msf/MappedBlockStream.h)
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/MSF/MappedBlockStream.h?p2=llvm/trunk/include/llvm/DebugInfo/MSF/MappedBlockStream.h&p1=llvm/trunk/include/llvm/DebugInfo/Msf/MappedBlockStream.h&r1=277188&r2=277190&rev=277190&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/Msf/MappedBlockStream.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/MSF/MappedBlockStream.h Fri Jul 29 13:24:26 2016
> @@ -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 Readabl
> public:
> static std::unique_ptr<MappedBlockStream>
> createStream(uint32_t BlockSize, uint32_t NumBlocks,
> - const MsfStreamLayout &Layout, const ReadableStream &MsfData);
> + const MSFStreamLayout &Layout, const ReadableStream &MsfData);
>
> static std::unique_ptr<MappedBlockStream>
> - createIndexedStream(const MsfLayout &Layout, const ReadableStream &MsfData,
> + createIndexedStream(const MSFLayout &Layout, const ReadableStream &MsfData,
> uint32_t StreamIndex);
>
> static std::unique_ptr<MappedBlockStream>
> - createDirectoryStream(const MsfLayout &Layout, const ReadableStream &MsfData);
> + createDirectoryStream(const MSFLayout &Layout, const ReadableStream &MsfData);
>
> Error readBytes(uint32_t Offset, uint32_t Size,
> ArrayRef<uint8_t> &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<uint8_t> Data) const;
>
> Error readBytes(uint32_t Offset, MutableArrayRef<uint8_t> 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<uint8_t> CacheEntry;
> @@ -96,14 +96,14 @@ class WritableMappedBlockStream : public
> public:
> static std::unique_ptr<WritableMappedBlockStream>
> createStream(uint32_t BlockSize, uint32_t NumBlocks,
> - const MsfStreamLayout &Layout, const WritableStream &MsfData);
> + const MSFStreamLayout &Layout, const WritableStream &MsfData);
>
> static std::unique_ptr<WritableMappedBlockStream>
> - createIndexedStream(const MsfLayout &Layout, const WritableStream &MsfData,
> + createIndexedStream(const MSFLayout &Layout, const WritableStream &MsfData,
> uint32_t StreamIndex);
>
> static std::unique_ptr<WritableMappedBlockStream>
> - createDirectoryStream(const MsfLayout &Layout, const WritableStream &MsfData);
> + createDirectoryStream(const MSFLayout &Layout, const WritableStream &MsfData);
>
> Error readBytes(uint32_t Offset, uint32_t Size,
> ArrayRef<uint8_t> &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:
>
> Copied: llvm/trunk/include/llvm/DebugInfo/MSF/MsfBuilder.h (from r277188, llvm/trunk/include/llvm/DebugInfo/Msf/MsfBuilder.h)
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/MSF/MsfBuilder.h?p2=llvm/trunk/include/llvm/DebugInfo/MSF/MsfBuilder.h&p1=llvm/trunk/include/llvm/DebugInfo/Msf/MsfBuilder.h&r1=277188&r2=277190&rev=277190&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/Msf/MsfBuilder.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/MSF/MsfBuilder.h Fri Jul 29 13:24:26 2016
> @@ -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<MsfBuilder> create(BumpPtrAllocator &Allocator,
> + static Expected<MSFBuilder> 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<MsfLayout> build();
> + Expected<MSFLayout> 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<uint32_t> Blocks);
>
> Copied: llvm/trunk/include/llvm/DebugInfo/MSF/MsfCommon.h (from r277188, llvm/trunk/include/llvm/DebugInfo/Msf/MsfCommon.h)
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/MSF/MsfCommon.h?p2=llvm/trunk/include/llvm/DebugInfo/MSF/MsfCommon.h&p1=llvm/trunk/include/llvm/DebugInfo/Msf/MsfCommon.h&r1=277188&r2=277190&rev=277190&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/Msf/MsfCommon.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/MSF/MsfCommon.h Fri Jul 29 13:24:26 2016
> @@ -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<support::ulittle32_t> DirectoryBlocks;
> ArrayRef<support::ulittle32_t> StreamSizes;
>
> Copied: llvm/trunk/include/llvm/DebugInfo/MSF/MsfError.h (from r277188, llvm/trunk/include/llvm/DebugInfo/Msf/MsfError.h)
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/MSF/MsfError.h?p2=llvm/trunk/include/llvm/DebugInfo/MSF/MsfError.h&p1=llvm/trunk/include/llvm/DebugInfo/Msf/MsfError.h&r1=277188&r2=277190&rev=277190&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/Msf/MsfError.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/MSF/MsfError.h Fri Jul 29 13:24:26 2016
> @@ -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<MsfError> {
> +class MSFError : public ErrorInfo<MSFError> {
> 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;
>
> Copied: llvm/trunk/include/llvm/DebugInfo/MSF/MsfStreamLayout.h (from r277188, llvm/trunk/include/llvm/DebugInfo/Msf/MsfStreamLayout.h)
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/MSF/MsfStreamLayout.h?p2=llvm/trunk/include/llvm/DebugInfo/MSF/MsfStreamLayout.h&p1=llvm/trunk/include/llvm/DebugInfo/Msf/MsfStreamLayout.h&r1=277188&r2=277190&rev=277190&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/Msf/MsfStreamLayout.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/MSF/MsfStreamLayout.h Fri Jul 29 13:24:26 2016
> @@ -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<support::ulittle32_t> Blocks;
>
> Copied: llvm/trunk/include/llvm/DebugInfo/MSF/StreamArray.h (from r277188, llvm/trunk/include/llvm/DebugInfo/Msf/StreamArray.h)
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/MSF/StreamArray.h?p2=llvm/trunk/include/llvm/DebugInfo/MSF/StreamArray.h&p1=llvm/trunk/include/llvm/DebugInfo/Msf/StreamArray.h&r1=277188&r2=277190&rev=277190&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/Msf/StreamArray.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/MSF/StreamArray.h Fri Jul 29 13:24:26 2016
> @@ -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 <functional>
>
> Copied: llvm/trunk/include/llvm/DebugInfo/MSF/StreamInterface.h (from r277188, llvm/trunk/include/llvm/DebugInfo/Msf/StreamInterface.h)
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/MSF/StreamInterface.h?p2=llvm/trunk/include/llvm/DebugInfo/MSF/StreamInterface.h&p1=llvm/trunk/include/llvm/DebugInfo/Msf/StreamInterface.h&r1=277188&r2=277190&rev=277190&view=diff
> ==============================================================================
> (empty)
>
> Copied: llvm/trunk/include/llvm/DebugInfo/MSF/StreamReader.h (from r277188, llvm/trunk/include/llvm/DebugInfo/Msf/StreamReader.h)
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/MSF/StreamReader.h?p2=llvm/trunk/include/llvm/DebugInfo/MSF/StreamReader.h&p1=llvm/trunk/include/llvm/DebugInfo/Msf/StreamReader.h&r1=277188&r2=277190&rev=277190&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/Msf/StreamReader.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/MSF/StreamReader.h Fri Jul 29 13:24:26 2016
> @@ -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<MsfError>(msf_error_code::insufficient_buffer);
> + return make_error<MSFError>(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<MsfError>(msf_error_code::invalid_format);
> + return make_error<MSFError>(msf_error_code::invalid_format);
> if (Offset + Length > Stream.getLength())
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> + return make_error<MSFError>(msf_error_code::insufficient_buffer);
> ReadableStreamRef View = Stream.slice(Offset, Length);
> Array = FixedStreamArray<T>(View);
> Offset += Length;
>
> Copied: llvm/trunk/include/llvm/DebugInfo/MSF/StreamRef.h (from r277188, llvm/trunk/include/llvm/DebugInfo/Msf/StreamRef.h)
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/MSF/StreamRef.h?p2=llvm/trunk/include/llvm/DebugInfo/MSF/StreamRef.h&p1=llvm/trunk/include/llvm/DebugInfo/Msf/StreamRef.h&r1=277188&r2=277190&rev=277190&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/Msf/StreamRef.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/MSF/StreamRef.h Fri Jul 29 13:24:26 2016
> @@ -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<uint8_t> &Buffer) const {
> if (ViewOffset + Offset < Offset)
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> + return make_error<MSFError>(msf_error_code::insufficient_buffer);
> if (Size + Offset > Length)
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> + return make_error<MSFError>(msf_error_code::insufficient_buffer);
> return Stream->readBytes(ViewOffset + Offset, Size, Buffer);
> }
>
> @@ -87,7 +87,7 @@ public:
> Error readLongestContiguousChunk(uint32_t Offset,
> ArrayRef<uint8_t> &Buffer) const {
> if (Offset >= Length)
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> + return make_error<MSFError>(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<uint8_t> Data) const {
> if (Data.size() + Offset > Length)
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> + return make_error<MSFError>(msf_error_code::insufficient_buffer);
> return Stream->writeBytes(ViewOffset + Offset, Data);
> }
>
>
> Copied: llvm/trunk/include/llvm/DebugInfo/MSF/StreamWriter.h (from r277188, llvm/trunk/include/llvm/DebugInfo/Msf/StreamWriter.h)
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/MSF/StreamWriter.h?p2=llvm/trunk/include/llvm/DebugInfo/MSF/StreamWriter.h&p1=llvm/trunk/include/llvm/DebugInfo/Msf/StreamWriter.h&r1=277188&r2=277190&rev=277190&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/Msf/StreamWriter.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/MSF/StreamWriter.h Fri Jul 29 13:24:26 2016
> @@ -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<MsfError>(msf_error_code::insufficient_buffer);
> + return make_error<MSFError>(msf_error_code::insufficient_buffer);
>
> return writeBytes(
> ArrayRef<uint8_t>(reinterpret_cast<const uint8_t *>(Array.data()),
>
> Removed: llvm/trunk/include/llvm/DebugInfo/Msf/ByteStream.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/Msf/ByteStream.h?rev=277189&view=auto
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/Msf/ByteStream.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/Msf/ByteStream.h (removed)
> @@ -1,160 +0,0 @@
> -//===- ByteStream.h - Reads stream data from a byte sequence ----*- C++ -*-===//
> -//
> -// The LLVM Compiler Infrastructure
> -//
> -// This file is distributed under the University of Illinois Open Source
> -// License. See LICENSE.TXT for details.
> -//
> -//===----------------------------------------------------------------------===//
> -
> -#ifndef LLVM_DEBUGINFO_MSF_BYTESTREAM_H
> -#define LLVM_DEBUGINFO_MSF_BYTESTREAM_H
> -
> -#include "llvm/ADT/ArrayRef.h"
> -#include "llvm/ADT/StringRef.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"
> -#include <cstdint>
> -#include <memory>
> -#include <type_traits>
> -
> -namespace llvm {
> -namespace msf {
> -
> -class ByteStream : public ReadableStream {
> -public:
> - ByteStream() {}
> - explicit ByteStream(ArrayRef<uint8_t> Data) : Data(Data) {}
> -
> - Error readBytes(uint32_t Offset, uint32_t Size,
> - ArrayRef<uint8_t> &Buffer) const override {
> - if (Offset > Data.size())
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> - if (Data.size() < Size + Offset)
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> - Buffer = Data.slice(Offset, Size);
> - return Error::success();
> - }
> - Error readLongestContiguousChunk(uint32_t Offset,
> - ArrayRef<uint8_t> &Buffer) const override {
> - if (Offset >= Data.size())
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> - Buffer = Data.slice(Offset);
> - return Error::success();
> - }
> -
> - uint32_t getLength() const override { return Data.size(); }
> -
> - ArrayRef<uint8_t> data() const { return Data; }
> -
> - StringRef str() const {
> - const char *CharData = reinterpret_cast<const char *>(Data.data());
> - return StringRef(CharData, Data.size());
> - }
> -
> -protected:
> - ArrayRef<uint8_t> Data;
> -};
> -
> -// MemoryBufferByteStream behaves like a read-only ByteStream, but has its data
> -// backed by an llvm::MemoryBuffer. It also owns the underlying MemoryBuffer.
> -class MemoryBufferByteStream : public ByteStream {
> -public:
> - explicit MemoryBufferByteStream(std::unique_ptr<MemoryBuffer> Buffer)
> - : ByteStream(ArrayRef<uint8_t>(Buffer->getBuffer().bytes_begin(),
> - Buffer->getBuffer().bytes_end())),
> - MemBuffer(std::move(Buffer)) {}
> -
> - std::unique_ptr<MemoryBuffer> MemBuffer;
> -};
> -
> -class MutableByteStream : public WritableStream {
> -public:
> - MutableByteStream() {}
> - explicit MutableByteStream(MutableArrayRef<uint8_t> Data)
> - : Data(Data), ImmutableStream(Data) {}
> -
> - Error readBytes(uint32_t Offset, uint32_t Size,
> - ArrayRef<uint8_t> &Buffer) const override {
> - return ImmutableStream.readBytes(Offset, Size, Buffer);
> - }
> - Error readLongestContiguousChunk(uint32_t Offset,
> - ArrayRef<uint8_t> &Buffer) const override {
> - return ImmutableStream.readLongestContiguousChunk(Offset, Buffer);
> - }
> -
> - uint32_t getLength() const override { return ImmutableStream.getLength(); }
> -
> - Error writeBytes(uint32_t Offset, ArrayRef<uint8_t> Buffer) const override {
> - if (Data.size() < Buffer.size())
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> - if (Offset > Buffer.size() - Data.size())
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> -
> - uint8_t *DataPtr = const_cast<uint8_t *>(Data.data());
> - ::memcpy(DataPtr + Offset, Buffer.data(), Buffer.size());
> - return Error::success();
> - }
> -
> - Error commit() const override { return Error::success(); }
> -
> - MutableArrayRef<uint8_t> data() const { return Data; }
> -
> -private:
> - MutableArrayRef<uint8_t> Data;
> - ByteStream ImmutableStream;
> -};
> -
> -// A simple adapter that acts like a ByteStream but holds ownership over
> -// and underlying FileOutputBuffer.
> -class FileBufferByteStream : public WritableStream {
> -private:
> - class StreamImpl : public MutableByteStream {
> - public:
> - StreamImpl(std::unique_ptr<FileOutputBuffer> Buffer)
> - : MutableByteStream(MutableArrayRef<uint8_t>(Buffer->getBufferStart(),
> - Buffer->getBufferEnd())),
> - FileBuffer(std::move(Buffer)) {}
> -
> - Error commit() const override {
> - if (FileBuffer->commit())
> - return llvm::make_error<MsfError>(msf_error_code::not_writable);
> - return Error::success();
> - }
> -
> - private:
> - std::unique_ptr<FileOutputBuffer> FileBuffer;
> - };
> -
> -public:
> - explicit FileBufferByteStream(std::unique_ptr<FileOutputBuffer> Buffer)
> - : Impl(std::move(Buffer)) {}
> -
> - Error readBytes(uint32_t Offset, uint32_t Size,
> - ArrayRef<uint8_t> &Buffer) const override {
> - return Impl.readBytes(Offset, Size, Buffer);
> - }
> - Error readLongestContiguousChunk(uint32_t Offset,
> - ArrayRef<uint8_t> &Buffer) const override {
> - return Impl.readLongestContiguousChunk(Offset, Buffer);
> - }
> -
> - uint32_t getLength() const override { return Impl.getLength(); }
> -
> - Error writeBytes(uint32_t Offset, ArrayRef<uint8_t> Data) const override {
> - return Impl.writeBytes(Offset, Data);
> - }
> - Error commit() const override { return Impl.commit(); }
> -
> -private:
> - StreamImpl Impl;
> -};
> -
> -
> -} // end namespace msf
> -} // end namespace llvm
> -
> -#endif // LLVM_DEBUGINFO_MSF_BYTESTREAM_H
>
> Removed: llvm/trunk/include/llvm/DebugInfo/Msf/IMsfFile.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/Msf/IMsfFile.h?rev=277189&view=auto
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/Msf/IMsfFile.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/Msf/IMsfFile.h (removed)
> @@ -1,44 +0,0 @@
> -//===- IMsfFile.h - Abstract base class for an MSF file ---------*- C++ -*-===//
> -//
> -// The LLVM Compiler Infrastructure
> -//
> -// This file is distributed under the University of Illinois Open Source
> -// License. See LICENSE.TXT for details.
> -//
> -//===----------------------------------------------------------------------===//
> -
> -#ifndef LLVM_DEBUGINFO_MSF_IMSFFILE_H
> -#define LLVM_DEBUGINFO_MSF_IMSFFILE_H
> -
> -#include "llvm/ADT/ArrayRef.h"
> -#include "llvm/ADT/StringRef.h"
> -#include "llvm/DebugInfo/Msf/StreamArray.h"
> -#include "llvm/Support/Endian.h"
> -#include "llvm/Support/Error.h"
> -
> -#include <stdint.h>
> -
> -namespace llvm {
> -namespace msf {
> -
> -class IMsfFile {
> -public:
> - virtual ~IMsfFile() {}
> -
> - virtual uint32_t getBlockSize() const = 0;
> - virtual uint32_t getBlockCount() const = 0;
> -
> - virtual uint32_t getNumStreams() const = 0;
> - virtual uint32_t getStreamByteSize(uint32_t StreamIndex) const = 0;
> - virtual ArrayRef<support::ulittle32_t>
> - getStreamBlockList(uint32_t StreamIndex) const = 0;
> -
> - virtual Expected<ArrayRef<uint8_t>> getBlockData(uint32_t BlockIndex,
> - uint32_t NumBytes) const = 0;
> - virtual Error setBlockData(uint32_t BlockIndex, uint32_t Offset,
> - ArrayRef<uint8_t> Data) const = 0;
> -};
> -}
> -}
> -
> -#endif // LLVM_DEBUGINFO_MSF_IMSFFILE_H
>
> Removed: llvm/trunk/include/llvm/DebugInfo/Msf/MappedBlockStream.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/Msf/MappedBlockStream.h?rev=277189&view=auto
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/Msf/MappedBlockStream.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/Msf/MappedBlockStream.h (removed)
> @@ -1,139 +0,0 @@
> -//===- MappedBlockStream.h - Discontiguous stream data in an Msf -*- C++
> -//-*-===//
> -//
> -// The LLVM Compiler Infrastructure
> -//
> -// This file is distributed under the University of Illinois Open Source
> -// License. See LICENSE.TXT for details.
> -//
> -//===----------------------------------------------------------------------===//
> -
> -#ifndef LLVM_DEBUGINFO_MSF_MAPPEDBLOCKSTREAM_H
> -#define LLVM_DEBUGINFO_MSF_MAPPEDBLOCKSTREAM_H
> -
> -#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/Support/Allocator.h"
> -#include "llvm/Support/Endian.h"
> -#include "llvm/Support/Error.h"
> -#include <cstdint>
> -#include <vector>
> -
> -namespace llvm {
> -namespace msf {
> -
> -struct MsfLayout;
> -
> -/// 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
> -/// itself, the layout is described by an array at a fixed location within
> -/// 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 {
> - friend class WritableMappedBlockStream;
> -
> -public:
> - static std::unique_ptr<MappedBlockStream>
> - createStream(uint32_t BlockSize, uint32_t NumBlocks,
> - const MsfStreamLayout &Layout, const ReadableStream &MsfData);
> -
> - static std::unique_ptr<MappedBlockStream>
> - createIndexedStream(const MsfLayout &Layout, const ReadableStream &MsfData,
> - uint32_t StreamIndex);
> -
> - static std::unique_ptr<MappedBlockStream>
> - createDirectoryStream(const MsfLayout &Layout, const ReadableStream &MsfData);
> -
> - Error readBytes(uint32_t Offset, uint32_t Size,
> - ArrayRef<uint8_t> &Buffer) const override;
> - Error readLongestContiguousChunk(uint32_t Offset,
> - ArrayRef<uint8_t> &Buffer) const override;
> -
> - uint32_t getLength() const override;
> -
> - uint32_t getNumBytesCopied() const;
> -
> - llvm::BumpPtrAllocator &getAllocator() { return Pool; }
> -
> - void invalidateCache();
> -
> - uint32_t getBlockSize() const { return BlockSize; }
> - uint32_t getNumBlocks() const { return NumBlocks; }
> - uint32_t getStreamLength() const { return StreamLayout.Length; }
> -
> -protected:
> - MappedBlockStream(uint32_t BlockSize, uint32_t NumBlocks,
> - const MsfStreamLayout &StreamLayout,
> - const ReadableStream &MsfData);
> -
> -private:
> - const MsfStreamLayout &getStreamLayout() const { return StreamLayout; }
> - void fixCacheAfterWrite(uint32_t Offset, ArrayRef<uint8_t> Data) const;
> -
> - Error readBytes(uint32_t Offset, MutableArrayRef<uint8_t> Buffer) const;
> - bool tryReadContiguously(uint32_t Offset, uint32_t Size,
> - ArrayRef<uint8_t> &Buffer) const;
> -
> - const uint32_t BlockSize;
> - const uint32_t NumBlocks;
> - const MsfStreamLayout StreamLayout;
> - const ReadableStream &MsfData;
> -
> - typedef MutableArrayRef<uint8_t> CacheEntry;
> - mutable llvm::BumpPtrAllocator Pool;
> - mutable DenseMap<uint32_t, std::vector<CacheEntry>> CacheMap;
> -};
> -
> -class WritableMappedBlockStream : public WritableStream {
> -public:
> - static std::unique_ptr<WritableMappedBlockStream>
> - createStream(uint32_t BlockSize, uint32_t NumBlocks,
> - const MsfStreamLayout &Layout, const WritableStream &MsfData);
> -
> - static std::unique_ptr<WritableMappedBlockStream>
> - createIndexedStream(const MsfLayout &Layout, const WritableStream &MsfData,
> - uint32_t StreamIndex);
> -
> - static std::unique_ptr<WritableMappedBlockStream>
> - createDirectoryStream(const MsfLayout &Layout, const WritableStream &MsfData);
> -
> - Error readBytes(uint32_t Offset, uint32_t Size,
> - ArrayRef<uint8_t> &Buffer) const override;
> - Error readLongestContiguousChunk(uint32_t Offset,
> - ArrayRef<uint8_t> &Buffer) const override;
> - uint32_t getLength() const override;
> -
> - Error writeBytes(uint32_t Offset, ArrayRef<uint8_t> Buffer) const override;
> -
> - Error commit() const override;
> -
> - const MsfStreamLayout &getStreamLayout() const {
> - return ReadInterface.getStreamLayout();
> - }
> - uint32_t getBlockSize() const { return ReadInterface.getBlockSize(); }
> - uint32_t getNumBlocks() const { return ReadInterface.getNumBlocks(); }
> - uint32_t getStreamLength() const { return ReadInterface.getStreamLength(); }
> -
> -protected:
> - WritableMappedBlockStream(uint32_t BlockSize, uint32_t NumBlocks,
> - const MsfStreamLayout &StreamLayout,
> - const WritableStream &MsfData);
> -
> -private:
> - MappedBlockStream ReadInterface;
> -
> - const WritableStream &WriteInterface;
> -};
> -
> -} // end namespace pdb
> -} // end namespace llvm
> -
> -#endif // LLVM_DEBUGINFO_MSF_MAPPEDBLOCKSTREAM_H
>
> Removed: llvm/trunk/include/llvm/DebugInfo/Msf/MsfBuilder.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/Msf/MsfBuilder.h?rev=277189&view=auto
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/Msf/MsfBuilder.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/Msf/MsfBuilder.h (removed)
> @@ -1,140 +0,0 @@
> -//===- MSFBuilder.h - MSF Directory & Metadata Builder ----------*- C++ -*-===//
> -//
> -// The LLVM Compiler Infrastructure
> -//
> -// This file is distributed under the University of Illinois Open Source
> -// License. See LICENSE.TXT for details.
> -//
> -//===----------------------------------------------------------------------===//
> -
> -#ifndef LLVM_DEBUGINFO_MSF_MSFBUILDER_H
> -#define LLVM_DEBUGINFO_MSF_MSFBUILDER_H
> -
> -#include "llvm/ADT/ArrayRef.h"
> -#include "llvm/ADT/BitVector.h"
> -
> -#include "llvm/DebugInfo/Msf/MsfCommon.h"
> -
> -#include "llvm/Support/Allocator.h"
> -#include "llvm/Support/Endian.h"
> -#include "llvm/Support/Error.h"
> -
> -#include <utility>
> -#include <vector>
> -
> -namespace llvm {
> -namespace msf {
> -class MsfBuilder {
> -public:
> - /// \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`
> - /// 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
> - /// will contain. Furthermore, it is actually necessary in this case. To
> - /// preserve stability of the file's layout, it is helpful to try to keep
> - /// all streams mapped to their original block numbers. To ensure that this
> - /// is possible, space for all blocks must be allocated beforehand so that
> - /// streams can be assigned to them.
> - ///
> - /// \param CanGrow If true, any operation which results in an attempt to
> - /// locate a free block when all available blocks have been exhausted will
> - /// allocate a new block, thereby growing the size of the final MSF file.
> - /// When false, any such attempt will result in an error. This is especially
> - /// useful in testing scenarios when you know your test isn't going to do
> - /// anything to increase the size of the file, so having an Error returned if
> - /// it were to happen would catch a programming error
> - ///
> - /// \returns an llvm::Error representing whether the operation succeeded or
> - /// 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<MsfBuilder> create(BumpPtrAllocator &Allocator,
> - uint32_t BlockSize,
> - uint32_t MinBlockCount = 0,
> - bool CanGrow = true);
> -
> - /// Request the block map to be at a specific block address. This is useful
> - /// when editing a MSF and you want the layout to be as stable as possible.
> - Error setBlockMapAddr(uint32_t Addr);
> - Error setDirectoryBlocksHint(ArrayRef<uint32_t> DirBlocks);
> - void setFreePageMap(uint32_t Fpm);
> - void setUnknown1(uint32_t Unk1);
> -
> - /// Add a stream to the MSF file with the given size, occupying the given
> - /// list of blocks. This is useful when reading a MSF file and you want a
> - /// particular stream to occupy the original set of blocks. If the given
> - /// blocks are already allocated, or if the number of blocks specified is
> - /// incorrect for the given stream size, this function will return an Error.
> - Error addStream(uint32_t Size, ArrayRef<uint32_t> Blocks);
> -
> - /// Add a stream to the MSF file with the given size, occupying any available
> - /// blocks that the builder decides to use. This is useful when building a
> - /// new PDB file from scratch and you don't care what blocks a stream occupies
> - /// but you just want it to work.
> - Error addStream(uint32_t Size);
> -
> - /// 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`.
> - Error setStreamSize(uint32_t Idx, uint32_t Size);
> -
> - /// Get the total number of streams in the MSF layout. This should return 1
> - /// for every call to `addStream`.
> - uint32_t getNumStreams() const;
> -
> - /// Get the size of a stream by index.
> - uint32_t getStreamSize(uint32_t StreamIdx) const;
> -
> - /// Get the list of blocks allocated to a particular stream.
> - ArrayRef<uint32_t> getStreamBlocks(uint32_t StreamIdx) const;
> -
> - /// Get the total number of blocks that will be allocated to actual data in
> - /// this MSF file.
> - uint32_t getNumUsedBlocks() const;
> -
> - /// Get the total number of blocks that exist in the MSF file but are not
> - /// allocated to any valid data.
> - uint32_t getNumFreeBlocks() const;
> -
> - /// Get the total number of blocks in the MSF file. In practice this is equal
> - /// to `getNumUsedBlocks() + getNumFreeBlocks()`.
> - uint32_t getTotalBlockCount() const;
> -
> - /// Check whether a particular block is allocated or free.
> - bool isBlockFree(uint32_t Idx) const;
> -
> - /// Finalize the layout and build the headers and structures that describe the
> - /// MSF layout and can be written directly to the MSF file.
> - Expected<MsfLayout> build();
> -
> -private:
> - MsfBuilder(uint32_t BlockSize, uint32_t MinBlockCount, bool CanGrow,
> - BumpPtrAllocator &Allocator);
> -
> - Error allocateBlocks(uint32_t NumBlocks, MutableArrayRef<uint32_t> Blocks);
> - uint32_t computeDirectoryByteSize() const;
> -
> - typedef std::vector<uint32_t> BlockList;
> -
> - BumpPtrAllocator &Allocator;
> -
> - bool IsGrowable;
> - uint32_t FreePageMap;
> - uint32_t Unknown1;
> - uint32_t BlockSize;
> - uint32_t MininumBlocks;
> - uint32_t BlockMapAddr;
> - BitVector FreeBlocks;
> - std::vector<uint32_t> DirectoryBlocks;
> - std::vector<std::pair<uint32_t, BlockList>> StreamData;
> -};
> -} // namespace msf
> -} // namespace llvm
> -
> -#endif // LLVM_DEBUGINFO_MSF_MSFBUILDER_H
>
> Removed: llvm/trunk/include/llvm/DebugInfo/Msf/MsfCommon.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/Msf/MsfCommon.h?rev=277189&view=auto
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/Msf/MsfCommon.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/Msf/MsfCommon.h (removed)
> @@ -1,89 +0,0 @@
> -//===- MsfCommon.h - Common types and functions for MSF files ---*- C++ -*-===//
> -//
> -// The LLVM Compiler Infrastructure
> -//
> -// This file is distributed under the University of Illinois Open Source
> -// License. See LICENSE.TXT for details.
> -//
> -//===----------------------------------------------------------------------===//
> -
> -#ifndef LLVM_DEBUGINFO_MSF_MSFCOMMON_H
> -#define LLVM_DEBUGINFO_MSF_MSFCOMMON_H
> -
> -#include "llvm/ADT/ArrayRef.h"
> -
> -#include "llvm/Support/Endian.h"
> -#include "llvm/Support/Error.h"
> -#include "llvm/Support/MathExtras.h"
> -
> -#include <vector>
> -
> -namespace llvm {
> -namespace msf {
> -static const char Magic[] = {'M', 'i', 'c', 'r', 'o', 's', 'o', 'f',
> - 't', ' ', 'C', '/', 'C', '+', '+', ' ',
> - 'M', 'S', 'F', ' ', '7', '.', '0', '0',
> - '\r', '\n', '\x1a', 'D', 'S', '\0', '\0', '\0'};
> -
> -// The superblock is overlaid at the beginning of the file (offset 0).
> -// It starts with a magic header and is followed by information which
> -// describes the layout of the file system.
> -struct SuperBlock {
> - char MagicBytes[sizeof(Magic)];
> - // The file system is split into a variable number of fixed size elements.
> - // These elements are referred to as blocks. The size of a block may vary
> - // from system to system.
> - support::ulittle32_t BlockSize;
> - // The index of the free block map.
> - support::ulittle32_t FreeBlockMapBlock;
> - // This contains the number of blocks resident in the file system. In
> - // practice, NumBlocks * BlockSize is equivalent to the size of the MSF
> - // file.
> - support::ulittle32_t NumBlocks;
> - // This contains the number of bytes which make up the directory.
> - support::ulittle32_t NumDirectoryBytes;
> - // This field's purpose is not yet known.
> - support::ulittle32_t Unknown1;
> - // This contains the block # of the block map.
> - support::ulittle32_t BlockMapAddr;
> -};
> -
> -struct MsfLayout {
> - MsfLayout() : SB(nullptr) {}
> - const SuperBlock *SB;
> - ArrayRef<support::ulittle32_t> DirectoryBlocks;
> - ArrayRef<support::ulittle32_t> StreamSizes;
> - std::vector<ArrayRef<support::ulittle32_t>> StreamMap;
> -};
> -
> -inline bool isValidBlockSize(uint32_t Size) {
> - switch (Size) {
> - case 512:
> - case 1024:
> - case 2048:
> - case 4096:
> - return true;
> - }
> - return false;
> -}
> -
> -// Super Block, Fpm0, Fpm1, and Block Map
> -inline uint32_t getMinimumBlockCount() { return 4; }
> -
> -// Super Block, Fpm0, and Fpm1 are reserved. The Block Map, although required
> -// need not be at block 3.
> -inline uint32_t getFirstUnreservedBlock() { return 3; }
> -
> -inline uint64_t bytesToBlocks(uint64_t NumBytes, uint64_t BlockSize) {
> - return alignTo(NumBytes, BlockSize) / BlockSize;
> -}
> -
> -inline uint64_t blockToOffset(uint64_t BlockNumber, uint64_t BlockSize) {
> - return BlockNumber * BlockSize;
> -}
> -
> -Error validateSuperBlock(const SuperBlock &SB);
> -} // namespace msf
> -} // namespace llvm
> -
> -#endif // LLVM_DEBUGINFO_MSF_MSFCOMMON_H
>
> Removed: llvm/trunk/include/llvm/DebugInfo/Msf/MsfError.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/Msf/MsfError.h?rev=277189&view=auto
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/Msf/MsfError.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/Msf/MsfError.h (removed)
> @@ -1,47 +0,0 @@
> -//===- MsfError.h - Error extensions for Msf Files --------------*- C++ -*-===//
> -//
> -// The LLVM Compiler Infrastructure
> -//
> -// This file is distributed under the University of Illinois Open Source
> -// License. See LICENSE.TXT for details.
> -//
> -//===----------------------------------------------------------------------===//
> -
> -#ifndef LLVM_DEBUGINFO_MSF_MSFERROR_H
> -#define LLVM_DEBUGINFO_MSF_MSFERROR_H
> -
> -#include "llvm/Support/Error.h"
> -
> -#include <string>
> -
> -namespace llvm {
> -namespace msf {
> -enum class msf_error_code {
> - unspecified = 1,
> - insufficient_buffer,
> - not_writable,
> - no_stream,
> - invalid_format,
> - block_in_use
> -};
> -
> -/// Base class for errors originating when parsing raw PDB files
> -class MsfError : public ErrorInfo<MsfError> {
> -public:
> - static char ID;
> - 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;
> - std::error_code convertToErrorCode() const override;
> -
> -private:
> - std::string ErrMsg;
> - msf_error_code Code;
> -};
> -} // namespace msf
> -} // namespace llvm
> -
> -#endif // LLVM_DEBUGINFO_MSF_MSFERROR_H
>
> Removed: llvm/trunk/include/llvm/DebugInfo/Msf/MsfStreamLayout.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/Msf/MsfStreamLayout.h?rev=277189&view=auto
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/Msf/MsfStreamLayout.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/Msf/MsfStreamLayout.h (removed)
> @@ -1,35 +0,0 @@
> -//===- MsfStreamLayout.h - Describes the layout of a stream -----*- C++ -*-===//
> -//
> -// The LLVM Compiler Infrastructure
> -//
> -// This file is distributed under the University of Illinois Open Source
> -// License. See LICENSE.TXT for details.
> -//
> -//===----------------------------------------------------------------------===//
> -
> -#ifndef LLVM_DEBUGINFO_MSF_MSFSTREAMLAYOUT_H
> -#define LLVM_DEBUGINFO_MSF_MSFSTREAMLAYOUT_H
> -
> -#include "llvm/ADT/ArrayRef.h"
> -#include "llvm/Support/Endian.h"
> -
> -#include <cstdint>
> -
> -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
> -/// 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
> -/// the data, so that it can be pieced together in the right order.
> -class MsfStreamLayout {
> -public:
> - uint32_t Length;
> - ArrayRef<support::ulittle32_t> Blocks;
> -};
> -} // namespace msf
> -} // namespace llvm
> -
> -#endif // LLVM_DEBUGINFO_MSF_MSFSTREAMLAYOUT_H
>
> Removed: llvm/trunk/include/llvm/DebugInfo/Msf/StreamArray.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/Msf/StreamArray.h?rev=277189&view=auto
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/Msf/StreamArray.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/Msf/StreamArray.h (removed)
> @@ -1,277 +0,0 @@
> -//===- StreamArray.h - Array backed by an arbitrary stream ----------------===//
> -//
> -// The LLVM Compiler Infrastructure
> -//
> -// This file is distributed under the University of Illinois Open Source
> -// License. See LICENSE.TXT for details.
> -//
> -//===----------------------------------------------------------------------===//
> -
> -#ifndef LLVM_DEBUGINFO_MSF_STREAMARRAY_H
> -#define LLVM_DEBUGINFO_MSF_STREAMARRAY_H
> -
> -#include "llvm/DebugInfo/Msf/StreamRef.h"
> -#include "llvm/Support/Error.h"
> -
> -#include <functional>
> -#include <type_traits>
> -
> -namespace llvm {
> -namespace msf {
> -
> -/// VarStreamArrayExtractor is intended to be specialized to provide customized
> -/// extraction logic. On input it receives a StreamRef pointing to the
> -/// beginning of the next record, but where the length of the record is not yet
> -/// known. Upon completion, it should return an appropriate Error instance if
> -/// a record could not be extracted, or if one could be extracted it should
> -/// return success and set Len to the number of bytes this record occupied in
> -/// the underlying stream, and it should fill out the fields of the value type
> -/// Item appropriately to represent the current record.
> -///
> -/// You can specialize this template for your own custom value types to avoid
> -/// having to specify a second template argument to VarStreamArray (documented
> -/// below).
> -template <typename T> struct VarStreamArrayExtractor {
> - // Method intentionally deleted. You must provide an explicit specialization
> - // with the following method implemented.
> - Error operator()(ReadableStreamRef Stream, uint32_t &Len,
> - T &Item) const = delete;
> -};
> -
> -/// VarStreamArray represents an array of variable length records backed by a
> -/// stream. This could be a contiguous sequence of bytes in memory, it could
> -/// be a file on disk, or it could be a PDB stream where bytes are stored as
> -/// discontiguous blocks in a file. Usually it is desirable to treat arrays
> -/// as contiguous blocks of memory, but doing so with large PDB files, for
> -/// example, could mean allocating huge amounts of memory just to allow
> -/// re-ordering of stream data to be contiguous before iterating over it. By
> -/// abstracting this out, we need not duplicate this memory, and we can
> -/// iterate over arrays in arbitrarily formatted streams. Elements are parsed
> -/// lazily on iteration, so there is no upfront cost associated with building
> -/// a VarStreamArray, no matter how large it may be.
> -///
> -/// You create a VarStreamArray by specifying a ValueType and an Extractor type.
> -/// If you do not specify an Extractor type, it expects you to specialize
> -/// VarStreamArrayExtractor<T> for your ValueType.
> -///
> -/// By default an Extractor is default constructed in the class, but in some
> -/// cases you might find it useful for an Extractor to maintain state across
> -/// extractions. In this case you can provide your own Extractor through a
> -/// secondary constructor. The following examples show various ways of
> -/// creating a VarStreamArray.
> -///
> -/// // Will use VarStreamArrayExtractor<MyType> as the extractor.
> -/// VarStreamArray<MyType> MyTypeArray;
> -///
> -/// // Will use a default-constructed MyExtractor as the extractor.
> -/// VarStreamArray<MyType, MyExtractor> MyTypeArray2;
> -///
> -/// // Will use the specific instance of MyExtractor provided.
> -/// // MyExtractor need not be default-constructible in this case.
> -/// MyExtractor E(SomeContext);
> -/// VarStreamArray<MyType, MyExtractor> MyTypeArray3(E);
> -///
> -template <typename ValueType, typename Extractor> class VarStreamArrayIterator;
> -
> -template <typename ValueType,
> - typename Extractor = VarStreamArrayExtractor<ValueType>>
> -class VarStreamArray {
> - friend class VarStreamArrayIterator<ValueType, Extractor>;
> -
> -public:
> - typedef VarStreamArrayIterator<ValueType, Extractor> Iterator;
> -
> - VarStreamArray() {}
> - explicit VarStreamArray(const Extractor &E) : E(E) {}
> -
> - explicit VarStreamArray(ReadableStreamRef Stream) : Stream(Stream) {}
> - VarStreamArray(ReadableStreamRef Stream, const Extractor &E)
> - : Stream(Stream), E(E) {}
> -
> - VarStreamArray(const VarStreamArray<ValueType, Extractor> &Other)
> - : Stream(Other.Stream), E(Other.E) {}
> -
> - Iterator begin(bool *HadError = nullptr) const {
> - return Iterator(*this, E, HadError);
> - }
> -
> - Iterator end() const { return Iterator(E); }
> -
> - const Extractor &getExtractor() const { return E; }
> -
> - ReadableStreamRef getUnderlyingStream() const { return Stream; }
> -
> -private:
> - ReadableStreamRef Stream;
> - Extractor E;
> -};
> -
> -template <typename ValueType, typename Extractor> class VarStreamArrayIterator {
> - typedef VarStreamArrayIterator<ValueType, Extractor> IterType;
> - typedef VarStreamArray<ValueType, Extractor> ArrayType;
> -
> -public:
> - VarStreamArrayIterator(const ArrayType &Array, const Extractor &E,
> - bool *HadError = nullptr)
> - : IterRef(Array.Stream), Array(&Array), HadError(HadError), Extract(E) {
> - if (IterRef.getLength() == 0)
> - moveToEnd();
> - else {
> - auto EC = Extract(IterRef, ThisLen, ThisValue);
> - if (EC) {
> - consumeError(std::move(EC));
> - markError();
> - }
> - }
> - }
> - VarStreamArrayIterator() {}
> - explicit VarStreamArrayIterator(const Extractor &E) : Extract(E) {}
> - ~VarStreamArrayIterator() {}
> -
> - bool operator==(const IterType &R) const {
> - if (Array && R.Array) {
> - // Both have a valid array, make sure they're same.
> - assert(Array == R.Array);
> - return IterRef == R.IterRef;
> - }
> -
> - // Both iterators are at the end.
> - if (!Array && !R.Array)
> - return true;
> -
> - // One is not at the end and one is.
> - return false;
> - }
> -
> - bool operator!=(const IterType &R) { return !(*this == R); }
> -
> - const ValueType &operator*() const {
> - assert(Array && !HasError);
> - return ThisValue;
> - }
> -
> - IterType &operator++() {
> - // We are done with the current record, discard it so that we are
> - // positioned at the next record.
> - IterRef = IterRef.drop_front(ThisLen);
> - if (IterRef.getLength() == 0) {
> - // There is nothing after the current record, we must make this an end
> - // iterator.
> - moveToEnd();
> - } else {
> - // There is some data after the current record.
> - auto EC = Extract(IterRef, ThisLen, ThisValue);
> - if (EC) {
> - consumeError(std::move(EC));
> - markError();
> - } else if (ThisLen == 0) {
> - // An empty record? Make this an end iterator.
> - moveToEnd();
> - }
> - }
> - return *this;
> - }
> -
> - IterType operator++(int) {
> - IterType Original = *this;
> - ++*this;
> - return Original;
> - }
> -
> -private:
> - void moveToEnd() {
> - Array = nullptr;
> - ThisLen = 0;
> - }
> - void markError() {
> - moveToEnd();
> - HasError = true;
> - if (HadError != nullptr)
> - *HadError = true;
> - }
> -
> - ValueType ThisValue;
> - ReadableStreamRef IterRef;
> - const ArrayType *Array{nullptr};
> - uint32_t ThisLen{0};
> - bool HasError{false};
> - bool *HadError{nullptr};
> - Extractor Extract;
> -};
> -
> -template <typename T> class FixedStreamArrayIterator;
> -
> -template <typename T> class FixedStreamArray {
> - friend class FixedStreamArrayIterator<T>;
> -
> -public:
> - FixedStreamArray() : Stream() {}
> - FixedStreamArray(ReadableStreamRef Stream) : Stream(Stream) {
> - assert(Stream.getLength() % sizeof(T) == 0);
> - }
> -
> - const T &operator[](uint32_t Index) const {
> - assert(Index < size());
> - uint32_t Off = Index * sizeof(T);
> - ArrayRef<uint8_t> Data;
> - if (auto EC = Stream.readBytes(Off, sizeof(T), Data)) {
> - assert(false && "Unexpected failure reading from stream");
> - // This should never happen since we asserted that the stream length was
> - // an exact multiple of the element size.
> - consumeError(std::move(EC));
> - }
> - return *reinterpret_cast<const T *>(Data.data());
> - }
> -
> - uint32_t size() const { return Stream.getLength() / sizeof(T); }
> -
> - FixedStreamArrayIterator<T> begin() const {
> - return FixedStreamArrayIterator<T>(*this, 0);
> - }
> - FixedStreamArrayIterator<T> end() const {
> - return FixedStreamArrayIterator<T>(*this, size());
> - }
> -
> - ReadableStreamRef getUnderlyingStream() const { return Stream; }
> -
> -private:
> - ReadableStreamRef Stream;
> -};
> -
> -template <typename T> class FixedStreamArrayIterator {
> -public:
> - FixedStreamArrayIterator(const FixedStreamArray<T> &Array, uint32_t Index)
> - : Array(Array), Index(Index) {}
> -
> - bool operator==(const FixedStreamArrayIterator<T> &R) {
> - assert(&Array == &R.Array);
> - return Index == R.Index;
> - }
> -
> - bool operator!=(const FixedStreamArrayIterator<T> &R) {
> - return !(*this == R);
> - }
> -
> - const T &operator*() const { return Array[Index]; }
> -
> - FixedStreamArrayIterator<T> &operator++() {
> - assert(Index < Array.size());
> - ++Index;
> - return *this;
> - }
> -
> - FixedStreamArrayIterator<T> operator++(int) {
> - FixedStreamArrayIterator<T> Original = *this;
> - ++*this;
> - return Original;
> - }
> -
> -private:
> - const FixedStreamArray<T> &Array;
> - uint32_t Index;
> -};
> -
> -} // namespace msf
> -} // namespace llvm
> -
> -#endif // LLVM_DEBUGINFO_MSF_STREAMARRAY_H
>
> Removed: llvm/trunk/include/llvm/DebugInfo/Msf/StreamInterface.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/Msf/StreamInterface.h?rev=277189&view=auto
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/Msf/StreamInterface.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/Msf/StreamInterface.h (removed)
> @@ -1,53 +0,0 @@
> -//===- StreamInterface.h - Base interface for a stream of data --*- C++ -*-===//
> -//
> -// The LLVM Compiler Infrastructure
> -//
> -// This file is distributed under the University of Illinois Open Source
> -// License. See LICENSE.TXT for details.
> -//
> -//===----------------------------------------------------------------------===//
> -
> -#ifndef LLVM_DEBUGINFO_MSF_STREAMINTERFACE_H
> -#define LLVM_DEBUGINFO_MSF_STREAMINTERFACE_H
> -
> -#include "llvm/ADT/ArrayRef.h"
> -#include "llvm/Support/Error.h"
> -#include <cstdint>
> -
> -namespace llvm {
> -namespace msf {
> -
> -class ReadableStream {
> -public:
> - virtual ~ReadableStream() {}
> -
> - // Given an offset into the stream and a number of bytes, attempt to read
> - // the bytes and set the output ArrayRef to point to a reference into the
> - // stream, without copying any data.
> - virtual Error readBytes(uint32_t Offset, uint32_t Size,
> - ArrayRef<uint8_t> &Buffer) const = 0;
> -
> - // Given an offset into the stream, read as much as possible without copying
> - // any data.
> - virtual Error readLongestContiguousChunk(uint32_t Offset,
> - ArrayRef<uint8_t> &Buffer) const = 0;
> -
> - virtual uint32_t getLength() const = 0;
> -};
> -
> -class WritableStream : public ReadableStream {
> -public:
> - virtual ~WritableStream() {}
> -
> - // Attempt to write the given bytes into the stream at the desired offset.
> - // This will always necessitate a copy. Cannot shrink or grow the stream,
> - // only writes into existing allocated space.
> - virtual Error writeBytes(uint32_t Offset, ArrayRef<uint8_t> Data) const = 0;
> -
> - virtual Error commit() const = 0;
> -};
> -
> -} // end namespace msf
> -} // end namespace llvm
> -
> -#endif // LLVM_DEBUGINFO_MSF_STREAMINTERFACE_H
>
> Removed: llvm/trunk/include/llvm/DebugInfo/Msf/StreamReader.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/Msf/StreamReader.h?rev=277189&view=auto
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/Msf/StreamReader.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/Msf/StreamReader.h (removed)
> @@ -1,110 +0,0 @@
> -//===- StreamReader.h - Reads bytes and objects from a stream ---*- C++ -*-===//
> -//
> -// The LLVM Compiler Infrastructure
> -//
> -// This file is distributed under the University of Illinois Open Source
> -// License. See LICENSE.TXT for details.
> -//
> -//===----------------------------------------------------------------------===//
> -
> -#ifndef LLVM_DEBUGINFO_MSF_STREAMREADER_H
> -#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/Support/Endian.h"
> -#include "llvm/Support/Error.h"
> -
> -#include <string>
> -
> -namespace llvm {
> -namespace msf {
> -
> -class StreamReader {
> -public:
> - StreamReader(ReadableStreamRef Stream);
> -
> - Error readLongestContiguousChunk(ArrayRef<uint8_t> &Buffer);
> - Error readBytes(ArrayRef<uint8_t> &Buffer, uint32_t Size);
> - Error readInteger(uint16_t &Dest);
> - Error readInteger(uint32_t &Dest);
> - Error readZeroString(StringRef &Dest);
> - Error readFixedString(StringRef &Dest, uint32_t Length);
> - Error readStreamRef(ReadableStreamRef &Ref);
> - Error readStreamRef(ReadableStreamRef &Ref, uint32_t Length);
> -
> - template <typename T> Error readEnum(T &Dest) {
> - typename std::underlying_type<T>::type N;
> - if (auto EC = readInteger(N))
> - return EC;
> - Dest = static_cast<T>(N);
> - return Error::success();
> - }
> -
> - template <typename T> Error readObject(const T *&Dest) {
> - ArrayRef<uint8_t> Buffer;
> - if (auto EC = readBytes(Buffer, sizeof(T)))
> - return EC;
> - Dest = reinterpret_cast<const T *>(Buffer.data());
> - return Error::success();
> - }
> -
> - template <typename T>
> - Error readArray(ArrayRef<T> &Array, uint32_t NumElements) {
> - ArrayRef<uint8_t> Bytes;
> - if (NumElements == 0) {
> - Array = ArrayRef<T>();
> - return Error::success();
> - }
> -
> - if (NumElements > UINT32_MAX / sizeof(T))
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> -
> - if (auto EC = readBytes(Bytes, NumElements * sizeof(T)))
> - return EC;
> - Array = ArrayRef<T>(reinterpret_cast<const T *>(Bytes.data()), NumElements);
> - return Error::success();
> - }
> -
> - template <typename T, typename U>
> - Error readArray(VarStreamArray<T, U> &Array, uint32_t Size) {
> - ReadableStreamRef S;
> - if (auto EC = readStreamRef(S, Size))
> - return EC;
> - Array = VarStreamArray<T, U>(S, Array.getExtractor());
> - return Error::success();
> - }
> -
> - template <typename T>
> - Error readArray(FixedStreamArray<T> &Array, uint32_t NumItems) {
> - if (NumItems == 0) {
> - Array = FixedStreamArray<T>();
> - return Error::success();
> - }
> - uint32_t Length = NumItems * sizeof(T);
> - if (Length / sizeof(T) != NumItems)
> - return make_error<MsfError>(msf_error_code::invalid_format);
> - if (Offset + Length > Stream.getLength())
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> - ReadableStreamRef View = Stream.slice(Offset, Length);
> - Array = FixedStreamArray<T>(View);
> - Offset += Length;
> - return Error::success();
> - }
> -
> - void setOffset(uint32_t Off) { Offset = Off; }
> - uint32_t getOffset() const { return Offset; }
> - uint32_t getLength() const { return Stream.getLength(); }
> - uint32_t bytesRemaining() const { return getLength() - getOffset(); }
> -
> -private:
> - ReadableStreamRef Stream;
> - uint32_t Offset;
> -};
> -} // namespace msf
> -} // namespace llvm
> -
> -#endif // LLVM_DEBUGINFO_MSF_STREAMREADER_H
>
> Removed: llvm/trunk/include/llvm/DebugInfo/Msf/StreamRef.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/Msf/StreamRef.h?rev=277189&view=auto
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/Msf/StreamRef.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/Msf/StreamRef.h (removed)
> @@ -1,130 +0,0 @@
> -//===- StreamRef.h - A copyable reference to a stream -----------*- C++ -*-===//
> -//
> -// The LLVM Compiler Infrastructure
> -//
> -// This file is distributed under the University of Illinois Open Source
> -// License. See LICENSE.TXT for details.
> -//
> -//===----------------------------------------------------------------------===//
> -
> -#ifndef LLVM_DEBUGINFO_MSF_STREAMREF_H
> -#define LLVM_DEBUGINFO_MSF_STREAMREF_H
> -
> -#include "llvm/DebugInfo/Msf/MsfError.h"
> -#include "llvm/DebugInfo/Msf/StreamInterface.h"
> -
> -namespace llvm {
> -namespace msf {
> -template <class StreamType, class RefType> class StreamRefBase {
> -public:
> - StreamRefBase() : Stream(nullptr), ViewOffset(0), Length(0) {}
> - StreamRefBase(const StreamType &Stream, uint32_t Offset, uint32_t Length)
> - : Stream(&Stream), ViewOffset(Offset), Length(Length) {}
> -
> - uint32_t getLength() const { return Length; }
> - const StreamType *getStream() const { return Stream; }
> -
> - RefType drop_front(uint32_t N) const {
> - if (!Stream)
> - return RefType();
> -
> - N = std::min(N, Length);
> - return RefType(*Stream, ViewOffset + N, Length - N);
> - }
> -
> - RefType keep_front(uint32_t N) const {
> - if (!Stream)
> - return RefType();
> - N = std::min(N, Length);
> - return RefType(*Stream, ViewOffset, N);
> - }
> -
> - RefType slice(uint32_t Offset, uint32_t Len) const {
> - return drop_front(Offset).keep_front(Len);
> - }
> -
> - bool operator==(const RefType &Other) const {
> - if (Stream != Other.Stream)
> - return false;
> - if (ViewOffset != Other.ViewOffset)
> - return false;
> - if (Length != Other.Length)
> - return false;
> - return true;
> - }
> -
> -protected:
> - const StreamType *Stream;
> - uint32_t ViewOffset;
> - uint32_t Length;
> -};
> -
> -class ReadableStreamRef
> - : public StreamRefBase<ReadableStream, ReadableStreamRef> {
> -public:
> - ReadableStreamRef() : StreamRefBase() {}
> - ReadableStreamRef(const ReadableStream &Stream)
> - : StreamRefBase(Stream, 0, Stream.getLength()) {}
> - ReadableStreamRef(const ReadableStream &Stream, uint32_t Offset,
> - uint32_t Length)
> - : StreamRefBase(Stream, Offset, Length) {}
> -
> - // Use StreamRef.slice() instead.
> - ReadableStreamRef(const ReadableStreamRef &S, uint32_t Offset,
> - uint32_t Length) = delete;
> -
> - Error readBytes(uint32_t Offset, uint32_t Size,
> - ArrayRef<uint8_t> &Buffer) const {
> - if (ViewOffset + Offset < Offset)
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> - if (Size + Offset > Length)
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> - return Stream->readBytes(ViewOffset + Offset, Size, Buffer);
> - }
> -
> - // Given an offset into the stream, read as much as possible without copying
> - // any data.
> - Error readLongestContiguousChunk(uint32_t Offset,
> - ArrayRef<uint8_t> &Buffer) const {
> - if (Offset >= Length)
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> -
> - if (auto EC = Stream->readLongestContiguousChunk(Offset, Buffer))
> - return EC;
> - // This StreamRef might refer to a smaller window over a larger stream. In
> - // that case we will have read out more bytes than we should return, because
> - // we should not read past the end of the current view.
> - uint32_t MaxLength = Length - Offset;
> - if (Buffer.size() > MaxLength)
> - Buffer = Buffer.slice(0, MaxLength);
> - return Error::success();
> - }
> -};
> -
> -class WritableStreamRef
> - : public StreamRefBase<WritableStream, WritableStreamRef> {
> -public:
> - WritableStreamRef() : StreamRefBase() {}
> - WritableStreamRef(const WritableStream &Stream)
> - : StreamRefBase(Stream, 0, Stream.getLength()) {}
> - WritableStreamRef(const WritableStream &Stream, uint32_t Offset,
> - uint32_t Length)
> - : StreamRefBase(Stream, Offset, Length) {}
> -
> - // Use StreamRef.slice() instead.
> - WritableStreamRef(const WritableStreamRef &S, uint32_t Offset,
> - uint32_t Length) = delete;
> -
> - Error writeBytes(uint32_t Offset, ArrayRef<uint8_t> Data) const {
> - if (Data.size() + Offset > Length)
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> - return Stream->writeBytes(ViewOffset + Offset, Data);
> - }
> -
> - Error commit() const { return Stream->commit(); }
> -};
> -
> -} // namespace msf
> -} // namespace llvm
> -
> -#endif // LLVM_DEBUGINFO_MSF_STREAMREF_H
>
> Removed: llvm/trunk/include/llvm/DebugInfo/Msf/StreamWriter.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/Msf/StreamWriter.h?rev=277189&view=auto
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/Msf/StreamWriter.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/Msf/StreamWriter.h (removed)
> @@ -1,85 +0,0 @@
> -//===- StreamWriter.h - Writes bytes and objects to a stream ----*- C++ -*-===//
> -//
> -// The LLVM Compiler Infrastructure
> -//
> -// This file is distributed under the University of Illinois Open Source
> -// License. See LICENSE.TXT for details.
> -//
> -//===----------------------------------------------------------------------===//
> -
> -#ifndef LLVM_DEBUGINFO_MSF_STREAMWRITER_H
> -#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/Support/Endian.h"
> -#include "llvm/Support/Error.h"
> -
> -#include <string>
> -
> -namespace llvm {
> -namespace msf {
> -
> -class StreamWriter {
> -public:
> - StreamWriter(WritableStreamRef Stream);
> -
> - Error writeBytes(ArrayRef<uint8_t> Buffer);
> - Error writeInteger(uint16_t Dest);
> - Error writeInteger(uint32_t Dest);
> - Error writeZeroString(StringRef Str);
> - Error writeFixedString(StringRef Str);
> - Error writeStreamRef(ReadableStreamRef Ref);
> - Error writeStreamRef(ReadableStreamRef Ref, uint32_t Size);
> -
> - template <typename T> Error writeEnum(T Num) {
> - return writeInteger(
> - static_cast<typename std::underlying_type<T>::type>(Num));
> - }
> -
> - template <typename T> Error writeObject(const T &Obj) {
> - static_assert(!std::is_pointer<T>::value,
> - "writeObject should not be used with pointers, to write "
> - "the pointed-to value dereference the pointer before calling "
> - "writeObject");
> - return writeBytes(
> - ArrayRef<uint8_t>(reinterpret_cast<const uint8_t *>(&Obj), sizeof(T)));
> - }
> -
> - template <typename T> Error writeArray(ArrayRef<T> Array) {
> - if (Array.size() == 0)
> - return Error::success();
> -
> - if (Array.size() > UINT32_MAX / sizeof(T))
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> -
> - return writeBytes(
> - ArrayRef<uint8_t>(reinterpret_cast<const uint8_t *>(Array.data()),
> - Array.size() * sizeof(T)));
> - }
> -
> - template <typename T, typename U>
> - Error writeArray(VarStreamArray<T, U> Array) {
> - return writeStreamRef(Array.getUnderlyingStream());
> - }
> -
> - template <typename T> Error writeArray(FixedStreamArray<T> Array) {
> - return writeStreamRef(Array.getUnderlyingStream());
> - }
> -
> - void setOffset(uint32_t Off) { Offset = Off; }
> - uint32_t getOffset() const { return Offset; }
> - uint32_t getLength() const { return Stream.getLength(); }
> - uint32_t bytesRemaining() const { return getLength() - getOffset(); }
> -
> -private:
> - WritableStreamRef Stream;
> - uint32_t Offset;
> -};
> -} // namespace msf
> -} // namespace llvm
> -
> -#endif // LLVM_DEBUGINFO_MSF_STREAMWRITER_H
>
> Modified: llvm/trunk/include/llvm/DebugInfo/PDB/Raw/DbiStream.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/Raw/DbiStream.h?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/PDB/Raw/DbiStream.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/PDB/Raw/DbiStream.h Fri Jul 29 13:24:26 2016
> @@ -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"
>
> Modified: llvm/trunk/include/llvm/DebugInfo/PDB/Raw/DbiStreamBuilder.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/Raw/DbiStreamBuilder.h?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/PDB/Raw/DbiStreamBuilder.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/PDB/Raw/DbiStreamBuilder.h Fri Jul 29 13:24:26 2016
> @@ -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<std::unique_ptr<DbiStream>> 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:
>
> Modified: llvm/trunk/include/llvm/DebugInfo/PDB/Raw/InfoStream.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/Raw/InfoStream.h?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/PDB/Raw/InfoStream.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/PDB/Raw/InfoStream.h Fri Jul 29 13:24:26 2016
> @@ -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"
>
> Modified: llvm/trunk/include/llvm/DebugInfo/PDB/Raw/InfoStreamBuilder.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/Raw/InfoStreamBuilder.h?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/PDB/Raw/InfoStreamBuilder.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/PDB/Raw/InfoStreamBuilder.h Fri Jul 29 13:24:26 2016
> @@ -43,7 +43,7 @@ public:
> Expected<std::unique_ptr<InfoStream>>
> 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:
>
> Modified: llvm/trunk/include/llvm/DebugInfo/PDB/Raw/ModInfo.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/Raw/ModInfo.h?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/PDB/Raw/ModInfo.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/PDB/Raw/ModInfo.h Fri Jul 29 13:24:26 2016
> @@ -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 <cstdint>
>
> Modified: llvm/trunk/include/llvm/DebugInfo/PDB/Raw/ModStream.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/Raw/ModStream.h?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/PDB/Raw/ModStream.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/PDB/Raw/ModStream.h Fri Jul 29 13:24:26 2016
> @@ -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 {
>
> Modified: llvm/trunk/include/llvm/DebugInfo/PDB/Raw/NameHashTable.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/Raw/NameHashTable.h?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/PDB/Raw/NameHashTable.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/PDB/Raw/NameHashTable.h Fri Jul 29 13:24:26 2016
> @@ -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 <cstdint>
>
> Modified: llvm/trunk/include/llvm/DebugInfo/PDB/Raw/PDBFile.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/Raw/PDBFile.h?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/PDB/Raw/PDBFile.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/PDB/Raw/PDBFile.h Fri Jul 29 13:24:26 2016
> @@ -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<support::ulittle32_t> getDirectoryBlockArray() const;
> @@ -95,7 +95,7 @@ private:
>
> std::unique_ptr<msf::ReadableStream> Buffer;
>
> - msf::MsfLayout ContainerLayout;
> + msf::MSFLayout ContainerLayout;
>
> std::unique_ptr<InfoStream> Info;
> std::unique_ptr<DbiStream> Dbi;
>
> Modified: llvm/trunk/include/llvm/DebugInfo/PDB/Raw/PDBFileBuilder.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/Raw/PDBFileBuilder.h?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/PDB/Raw/PDBFileBuilder.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/PDB/Raw/PDBFileBuilder.h Fri Jul 29 13:24:26 2016
> @@ -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<msf::MsfLayout> finalizeMsfLayout() const;
> + Expected<msf::MSFLayout> finalizeMsfLayout() const;
>
> BumpPtrAllocator &Allocator;
>
> - std::unique_ptr<msf::MsfBuilder> Msf;
> + std::unique_ptr<msf::MSFBuilder> Msf;
> std::unique_ptr<InfoStreamBuilder> Info;
> std::unique_ptr<DbiStreamBuilder> Dbi;
> };
>
> Modified: llvm/trunk/include/llvm/DebugInfo/PDB/Raw/PublicsStream.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/Raw/PublicsStream.h?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/PDB/Raw/PublicsStream.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/PDB/Raw/PublicsStream.h Fri Jul 29 13:24:26 2016
> @@ -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"
>
> Modified: llvm/trunk/include/llvm/DebugInfo/PDB/Raw/TpiStream.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/Raw/TpiStream.h?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/PDB/Raw/TpiStream.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/PDB/Raw/TpiStream.h Fri Jul 29 13:24:26 2016
> @@ -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"
>
> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp (original)
> +++ llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp Fri Jul 29 13:24:26 2016
> @@ -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"
>
> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/LLVMBuild.txt
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/LLVMBuild.txt?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/AsmPrinter/LLVMBuild.txt (original)
> +++ llvm/trunk/lib/CodeGen/AsmPrinter/LLVMBuild.txt Fri Jul 29 13:24:26 2016
> @@ -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
>
> Modified: llvm/trunk/lib/DebugInfo/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/CMakeLists.txt?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/CMakeLists.txt (original)
> +++ llvm/trunk/lib/DebugInfo/CMakeLists.txt Fri Jul 29 13:24:26 2016
> @@ -1,5 +1,5 @@
> add_subdirectory(DWARF)
> -add_subdirectory(Msf)
> +add_subdirectory(MSF)
> add_subdirectory(CodeView)
> add_subdirectory(PDB)
> add_subdirectory(Symbolize)
>
> Modified: llvm/trunk/lib/DebugInfo/CodeView/LLVMBuild.txt
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/CodeView/LLVMBuild.txt?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/CodeView/LLVMBuild.txt (original)
> +++ llvm/trunk/lib/DebugInfo/CodeView/LLVMBuild.txt Fri Jul 29 13:24:26 2016
> @@ -19,4 +19,4 @@
> type = Library
> name = DebugInfoCodeView
> parent = DebugInfo
> -required_libraries = Support DebugInfoMsf
> +required_libraries = Support DebugInfoMSF
>
> Modified: llvm/trunk/lib/DebugInfo/CodeView/ModuleSubstream.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/CodeView/ModuleSubstream.cpp?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/CodeView/ModuleSubstream.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/CodeView/ModuleSubstream.cpp Fri Jul 29 13:24:26 2016
> @@ -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;
>
> Modified: llvm/trunk/lib/DebugInfo/CodeView/ModuleSubstreamVisitor.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/CodeView/ModuleSubstreamVisitor.cpp?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/CodeView/ModuleSubstreamVisitor.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/CodeView/ModuleSubstreamVisitor.cpp Fri Jul 29 13:24:26 2016
> @@ -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;
>
> Modified: llvm/trunk/lib/DebugInfo/CodeView/TypeDumper.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/CodeView/TypeDumper.cpp?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/CodeView/TypeDumper.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/CodeView/TypeDumper.cpp Fri Jul 29 13:24:26 2016
> @@ -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;
>
> Modified: llvm/trunk/lib/DebugInfo/LLVMBuild.txt
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/LLVMBuild.txt?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/LLVMBuild.txt (original)
> +++ llvm/trunk/lib/DebugInfo/LLVMBuild.txt Fri Jul 29 13:24:26 2016
> @@ -16,7 +16,7 @@
> ;===------------------------------------------------------------------------===;
>
> [common]
> -subdirectories = DWARF Msf CodeView PDB Symbolize
> +subdirectories = DWARF MSF CodeView PDB Symbolize
>
> [component_0]
> type = Group
>
> Copied: llvm/trunk/lib/DebugInfo/MSF/CMakeLists.txt (from r277188, llvm/trunk/lib/DebugInfo/Msf/CMakeLists.txt)
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/MSF/CMakeLists.txt?p2=llvm/trunk/lib/DebugInfo/MSF/CMakeLists.txt&p1=llvm/trunk/lib/DebugInfo/Msf/CMakeLists.txt&r1=277188&r2=277190&rev=277190&view=diff
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/Msf/CMakeLists.txt (original)
> +++ llvm/trunk/lib/DebugInfo/MSF/CMakeLists.txt Fri Jul 29 13:24:26 2016
> @@ -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
>
> Copied: llvm/trunk/lib/DebugInfo/MSF/LLVMBuild.txt (from r277188, llvm/trunk/lib/DebugInfo/Msf/LLVMBuild.txt)
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/MSF/LLVMBuild.txt?p2=llvm/trunk/lib/DebugInfo/MSF/LLVMBuild.txt&p1=llvm/trunk/lib/DebugInfo/Msf/LLVMBuild.txt&r1=277188&r2=277190&rev=277190&view=diff
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/Msf/LLVMBuild.txt (original)
> +++ llvm/trunk/lib/DebugInfo/MSF/LLVMBuild.txt Fri Jul 29 13:24:26 2016
> @@ -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
>
> Copied: llvm/trunk/lib/DebugInfo/MSF/MappedBlockStream.cpp (from r277188, llvm/trunk/lib/DebugInfo/Msf/MappedBlockStream.cpp)
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/MSF/MappedBlockStream.cpp?p2=llvm/trunk/lib/DebugInfo/MSF/MappedBlockStream.cpp&p1=llvm/trunk/lib/DebugInfo/Msf/MappedBlockStream.cpp&r1=277188&r2=277190&rev=277190&view=diff
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/Msf/MappedBlockStream.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/MSF/MappedBlockStream.cpp Fri Jul 29 13:24:26 2016
> @@ -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
> }
>
> 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>
> MappedBlockStream::createStream(uint32_t BlockSize, uint32_t NumBlocks,
> - const MsfStreamLayout &Layout,
> + const MSFStreamLayout &Layout,
> const ReadableStream &MsfData) {
> return llvm::make_unique<MappedBlockStreamImpl<MappedBlockStream>>(
> BlockSize, NumBlocks, Layout, MsfData);
> }
>
> std::unique_ptr<MappedBlockStream>
> -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<MappedBlockStreamImpl<MappedBlockStream>>(
> @@ -58,9 +58,9 @@ MappedBlockStream::createIndexedStream(c
> }
>
> std::unique_ptr<MappedBlockStream>
> -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(uint3
> ArrayRef<uint8_t> &Buffer) const {
> // Make sure we aren't trying to read beyond the end of the stream.
> if (Size > StreamLayout.Length)
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> + return make_error<MSFError>(msf_error_code::insufficient_buffer);
> if (Offset > StreamLayout.Length - Size)
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> + return make_error<MSFError>(msf_error_code::insufficient_buffer);
>
> if (tryReadContiguously(Offset, Size, Buffer))
> return Error::success();
> @@ -150,7 +150,7 @@ Error MappedBlockStream::readLongestCont
> uint32_t Offset, ArrayRef<uint8_t> &Buffer) const {
> // Make sure we aren't trying to read beyond the end of the stream.
> if (Offset >= StreamLayout.Length)
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> + return make_error<MSFError>(msf_error_code::insufficient_buffer);
> uint32_t First = Offset / BlockSize;
> uint32_t Last = First;
>
> @@ -221,9 +221,9 @@ Error MappedBlockStream::readBytes(uint3
>
> // Make sure we aren't trying to read beyond the end of the stream.
> if (Buffer.size() > StreamLayout.Length)
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> + return make_error<MSFError>(msf_error_code::insufficient_buffer);
> if (Offset > StreamLayout.Length - Buffer.size())
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> + return make_error<MSFError>(msf_error_code::insufficient_buffer);
>
> uint32_t BytesLeft = Buffer.size();
> uint32_t BytesWritten = 0;
> @@ -292,24 +292,24 @@ void MappedBlockStream::fixCacheAfterWri
> }
>
> 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>
> WritableMappedBlockStream::createStream(uint32_t BlockSize, uint32_t NumBlocks,
> - const MsfStreamLayout &Layout,
> + const MSFStreamLayout &Layout,
> const WritableStream &MsfData) {
> return llvm::make_unique<MappedBlockStreamImpl<WritableMappedBlockStream>>(
> BlockSize, NumBlocks, Layout, MsfData);
> }
>
> std::unique_ptr<WritableMappedBlockStream>
> -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::createIndexed
>
> std::unique_ptr<WritableMappedBlockStream>
> 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::writeBy
> ArrayRef<uint8_t> Buffer) const {
> // Make sure we aren't trying to write beyond the end of the stream.
> if (Buffer.size() > getStreamLength())
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> + return make_error<MSFError>(msf_error_code::insufficient_buffer);
>
> if (Offset > getStreamLayout().Length - Buffer.size())
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> + return make_error<MSFError>(msf_error_code::insufficient_buffer);
>
> uint32_t BlockNum = Offset / getBlockSize();
> uint32_t OffsetInBlock = Offset % getBlockSize();
>
> Copied: llvm/trunk/lib/DebugInfo/MSF/MsfBuilder.cpp (from r277188, llvm/trunk/lib/DebugInfo/Msf/MsfBuilder.cpp)
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/MSF/MsfBuilder.cpp?p2=llvm/trunk/lib/DebugInfo/MSF/MsfBuilder.cpp&p1=llvm/trunk/lib/DebugInfo/Msf/MsfBuilder.cpp&r1=277188&r2=277190&rev=277190&view=diff
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/Msf/MsfBuilder.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/MSF/MsfBuilder.cpp Fri Jul 29 13:24:26 2016
> @@ -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 BlockSiz
> FreeBlocks[BlockMapAddr] = false;
> }
>
> -Expected<MsfBuilder> MsfBuilder::create(BumpPtrAllocator &Allocator,
> +Expected<MSFBuilder> MSFBuilder::create(BumpPtrAllocator &Allocator,
> uint32_t BlockSize,
> uint32_t MinBlockCount, bool CanGrow) {
> if (!isValidBlockSize(BlockSize))
> - return make_error<MsfError>(msf_error_code::invalid_format,
> + return make_error<MSFError>(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<MsfError>(msf_error_code::insufficient_buffer,
> + return make_error<MSFError>(msf_error_code::insufficient_buffer,
> "Cannot grow the number of blocks");
> FreeBlocks.resize(Addr + 1);
> }
>
> if (!isBlockFree(Addr))
> - return make_error<MsfError>(
> + return make_error<MSFError>(
> 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
> 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<uint32_t> DirBlocks) {
> +Error MSFBuilder::setDirectoryBlocksHint(ArrayRef<uint32_t> DirBlocks) {
> for (auto B : DirectoryBlocks)
> FreeBlocks[B] = true;
> for (auto B : DirBlocks) {
> if (!isBlockFree(B)) {
> - return make_error<MsfError>(msf_error_code::unspecified,
> + return make_error<MSFError>(msf_error_code::unspecified,
> "Attempt to reuse an allocated block");
> }
> FreeBlocks[B] = false;
> @@ -85,7 +85,7 @@ Error MsfBuilder::setDirectoryBlocksHint
> return Error::success();
> }
>
> -Error MsfBuilder::allocateBlocks(uint32_t NumBlocks,
> +Error MSFBuilder::allocateBlocks(uint32_t NumBlocks,
> MutableArrayRef<uint32_t> Blocks) {
> if (NumBlocks == 0)
> return Error::success();
> @@ -93,7 +93,7 @@ Error MsfBuilder::allocateBlocks(uint32_
> uint32_t NumFreeBlocks = FreeBlocks.count();
> if (NumFreeBlocks < NumBlocks) {
> if (!IsGrowable)
> - return make_error<MsfError>(msf_error_code::insufficient_buffer,
> + return make_error<MSFError>(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_
> 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<uint32_t> Blocks) {
> +Error MSFBuilder::addStream(uint32_t Size, ArrayRef<uint32_t> 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<MsfError>(
> + return make_error<MSFError>(
> 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 Siz
> FreeBlocks.resize(Block + 1, true);
>
> if (!FreeBlocks.test(Block))
> - return make_error<MsfError>(
> + return make_error<MSFError>(
> msf_error_code::unspecified,
> "Attempt to re-use an already allocated block");
> }
> @@ -148,7 +148,7 @@ Error MsfBuilder::addStream(uint32_t Siz
> return Error::success();
> }
>
> -Error MsfBuilder::addStream(uint32_t Size) {
> +Error MSFBuilder::addStream(uint32_t Size) {
> uint32_t ReqBlocks = bytesToBlocks(Size, BlockSize);
> std::vector<uint32_t> NewBlocks;
> NewBlocks.resize(ReqBlocks);
> @@ -158,7 +158,7 @@ Error MsfBuilder::addStream(uint32_t Siz
> 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
> 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<uint32_t> MsfBuilder::getStreamBlocks(uint32_t StreamIdx) const {
> +ArrayRef<uint32_t> 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::computeDirectoryByt
> return Size;
> }
>
> -Expected<MsfLayout> MsfBuilder::build() {
> +Expected<MSFLayout> MSFBuilder::build() {
> SuperBlock *SB = Allocator.Allocate<SuperBlock>();
> - MsfLayout L;
> + MSFLayout L;
> L.SB = SB;
>
> std::memcpy(SB->MagicBytes, Magic, sizeof(Magic));
>
> Copied: llvm/trunk/lib/DebugInfo/MSF/MsfCommon.cpp (from r277188, llvm/trunk/lib/DebugInfo/Msf/MsfCommon.cpp)
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/MSF/MsfCommon.cpp?p2=llvm/trunk/lib/DebugInfo/MSF/MsfCommon.cpp&p1=llvm/trunk/lib/DebugInfo/Msf/MsfCommon.cpp&r1=277188&r2=277190&rev=277190&view=diff
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/Msf/MsfCommon.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/MSF/MsfCommon.cpp Fri Jul 29 13:24:26 2016
> @@ -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<MsfError>(msf_error_code::invalid_format,
> + return make_error<MSFError>(msf_error_code::invalid_format,
> "MSF magic header doesn't match");
>
> if (!isValidBlockSize(SB.BlockSize))
> - return make_error<MsfError>(msf_error_code::invalid_format,
> + return make_error<MSFError>(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<MsfError>(msf_error_code::invalid_format,
> + return make_error<MSFError>(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(cons
> // 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<MsfError>(msf_error_code::invalid_format,
> + return make_error<MSFError>(msf_error_code::invalid_format,
> "Too many directory blocks.");
>
> if (SB.BlockMapAddr == 0)
> - return make_error<MsfError>(msf_error_code::invalid_format,
> + return make_error<MSFError>(msf_error_code::invalid_format,
> "Block 0 is reserved");
>
> return Error::success();
>
> Copied: llvm/trunk/lib/DebugInfo/MSF/MsfError.cpp (from r277188, llvm/trunk/lib/DebugInfo/Msf/MsfError.cpp)
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/MSF/MsfError.cpp?p2=llvm/trunk/lib/DebugInfo/MSF/MsfError.cpp&p1=llvm/trunk/lib/DebugInfo/Msf/MsfError.cpp&r1=277188&r2=277190&rev=277190&view=diff
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/Msf/MsfError.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/MSF/MsfError.cpp Fri Jul 29 13:24:26 2016
> @@ -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<MsfErrorCategory> Category;
> +static ManagedStatic<MSFErrorCategory> 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, con
> 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<int>(Code), *Category);
> }
>
> Copied: llvm/trunk/lib/DebugInfo/MSF/StreamReader.cpp (from r277188, llvm/trunk/lib/DebugInfo/Msf/StreamReader.cpp)
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/MSF/StreamReader.cpp?p2=llvm/trunk/lib/DebugInfo/MSF/StreamReader.cpp&p1=llvm/trunk/lib/DebugInfo/Msf/StreamReader.cpp&r1=277188&r2=277190&rev=277190&view=diff
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/Msf/StreamReader.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/MSF/StreamReader.cpp Fri Jul 29 13:24:26 2016
> @@ -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(Readab
>
> Error StreamReader::readStreamRef(ReadableStreamRef &Ref, uint32_t Length) {
> if (bytesRemaining() < Length)
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> + return make_error<MSFError>(msf_error_code::insufficient_buffer);
> Ref = Stream.slice(Offset, Length);
> Offset += Length;
> return Error::success();
>
> Copied: llvm/trunk/lib/DebugInfo/MSF/StreamWriter.cpp (from r277188, llvm/trunk/lib/DebugInfo/Msf/StreamWriter.cpp)
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/MSF/StreamWriter.cpp?p2=llvm/trunk/lib/DebugInfo/MSF/StreamWriter.cpp&p1=llvm/trunk/lib/DebugInfo/Msf/StreamWriter.cpp&r1=277188&r2=277190&rev=277190&view=diff
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/Msf/StreamWriter.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/MSF/StreamWriter.cpp Fri Jul 29 13:24:26 2016
> @@ -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;
>
> Removed: llvm/trunk/lib/DebugInfo/Msf/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/Msf/CMakeLists.txt?rev=277189&view=auto
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/Msf/CMakeLists.txt (original)
> +++ llvm/trunk/lib/DebugInfo/Msf/CMakeLists.txt (removed)
> @@ -1,10 +0,0 @@
> -add_llvm_library(LLVMDebugInfoMsf
> - MappedBlockStream.cpp
> - MsfBuilder.cpp
> - MsfCommon.cpp
> - MsfError.cpp
> - StreamReader.cpp
> - StreamWriter.cpp
> - ADDITIONAL_HEADER_DIRS
> - "${LLVM_MAIN_INCLUDE_DIR}/llvm/DebugInfo/MSF"
> - )
>
> Removed: llvm/trunk/lib/DebugInfo/Msf/LLVMBuild.txt
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/Msf/LLVMBuild.txt?rev=277189&view=auto
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/Msf/LLVMBuild.txt (original)
> +++ llvm/trunk/lib/DebugInfo/Msf/LLVMBuild.txt (removed)
> @@ -1,22 +0,0 @@
> -;===- ./lib/DebugInfo/Msf/LLVMBuild.txt -------------------*- Conf -*--===;
> -;
> -; The LLVM Compiler Infrastructure
> -;
> -; This file is distributed under the University of Illinois Open Source
> -; License. See LICENSE.TXT for details.
> -;
> -;===------------------------------------------------------------------------===;
> -;
> -; This is an LLVMBuild description file for the components in this subdirectory.
> -;
> -; For more information on the LLVMBuild system, please see:
> -;
> -; http://llvm.org/docs/LLVMBuild.html
> -;
> -;===------------------------------------------------------------------------===;
> -
> -[component_0]
> -type = Library
> -name = DebugInfoMsf
> -parent = DebugInfo
> -required_libraries = Support
>
> Removed: llvm/trunk/lib/DebugInfo/Msf/MappedBlockStream.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/Msf/MappedBlockStream.cpp?rev=277189&view=auto
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/Msf/MappedBlockStream.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/Msf/MappedBlockStream.cpp (removed)
> @@ -1,380 +0,0 @@
> -//===- MappedBlockStream.cpp - Reads stream data from an MSF file ---------===//
> -//
> -// The LLVM Compiler Infrastructure
> -//
> -// This file is distributed under the University of Illinois Open Source
> -// License. See LICENSE.TXT for details.
> -//
> -//===----------------------------------------------------------------------===//
> -
> -#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"
> -
> -using namespace llvm;
> -using namespace llvm::msf;
> -
> -namespace {
> -template <typename Base> class MappedBlockStreamImpl : public Base {
> -public:
> - template <typename... Args>
> - MappedBlockStreamImpl(Args &&... Params)
> - : Base(std::forward<Args>(Params)...) {}
> -};
> -}
> -
> -typedef std::pair<uint32_t, uint32_t> Interval;
> -static Interval intersect(const Interval &I1, const Interval &I2) {
> - return std::make_pair(std::max(I1.first, I2.first),
> - std::min(I1.second, I2.second));
> -}
> -
> -MappedBlockStream::MappedBlockStream(uint32_t BlockSize, uint32_t NumBlocks,
> - const MsfStreamLayout &Layout,
> - const ReadableStream &MsfData)
> - : BlockSize(BlockSize), NumBlocks(NumBlocks), StreamLayout(Layout),
> - MsfData(MsfData) {}
> -
> -std::unique_ptr<MappedBlockStream>
> -MappedBlockStream::createStream(uint32_t BlockSize, uint32_t NumBlocks,
> - const MsfStreamLayout &Layout,
> - const ReadableStream &MsfData) {
> - return llvm::make_unique<MappedBlockStreamImpl<MappedBlockStream>>(
> - BlockSize, NumBlocks, Layout, MsfData);
> -}
> -
> -std::unique_ptr<MappedBlockStream>
> -MappedBlockStream::createIndexedStream(const MsfLayout &Layout,
> - const ReadableStream &MsfData,
> - uint32_t StreamIndex) {
> - MsfStreamLayout SL;
> - SL.Blocks = Layout.StreamMap[StreamIndex];
> - SL.Length = Layout.StreamSizes[StreamIndex];
> - return llvm::make_unique<MappedBlockStreamImpl<MappedBlockStream>>(
> - Layout.SB->BlockSize, Layout.SB->NumBlocks, SL, MsfData);
> -}
> -
> -std::unique_ptr<MappedBlockStream>
> -MappedBlockStream::createDirectoryStream(const MsfLayout &Layout,
> - const ReadableStream &MsfData) {
> - MsfStreamLayout SL;
> - SL.Blocks = Layout.DirectoryBlocks;
> - SL.Length = Layout.SB->NumDirectoryBytes;
> - return createStream(Layout.SB->BlockSize, Layout.SB->NumBlocks, SL, MsfData);
> -}
> -
> -Error MappedBlockStream::readBytes(uint32_t Offset, uint32_t Size,
> - ArrayRef<uint8_t> &Buffer) const {
> - // Make sure we aren't trying to read beyond the end of the stream.
> - if (Size > StreamLayout.Length)
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> - if (Offset > StreamLayout.Length - Size)
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> -
> - if (tryReadContiguously(Offset, Size, Buffer))
> - return Error::success();
> -
> - auto CacheIter = CacheMap.find(Offset);
> - if (CacheIter != CacheMap.end()) {
> - // Try to find an alloc that was large enough for this request.
> - for (auto &Entry : CacheIter->second) {
> - if (Entry.size() >= Size) {
> - Buffer = Entry.slice(0, Size);
> - return Error::success();
> - }
> - }
> - }
> -
> - // We couldn't find a buffer that started at the correct offset (the most
> - // common scenario). Try to see if there is a buffer that starts at some
> - // other offset but overlaps the desired range.
> - for (auto &CacheItem : CacheMap) {
> - Interval RequestExtent = std::make_pair(Offset, Offset + Size);
> -
> - // We already checked this one on the fast path above.
> - if (CacheItem.first == Offset)
> - continue;
> - // If the initial extent of the cached item is beyond the ending extent
> - // of the request, there is no overlap.
> - if (CacheItem.first >= Offset + Size)
> - continue;
> -
> - // We really only have to check the last item in the list, since we append
> - // in order of increasing length.
> - if (CacheItem.second.empty())
> - continue;
> -
> - auto CachedAlloc = CacheItem.second.back();
> - // If the initial extent of the request is beyond the ending extent of
> - // the cached item, there is no overlap.
> - Interval CachedExtent =
> - std::make_pair(CacheItem.first, CacheItem.first + CachedAlloc.size());
> - if (RequestExtent.first >= CachedExtent.first + CachedExtent.second)
> - continue;
> -
> - Interval Intersection = intersect(CachedExtent, RequestExtent);
> - // Only use this if the entire request extent is contained in the cached
> - // extent.
> - if (Intersection != RequestExtent)
> - continue;
> -
> - uint32_t CacheRangeOffset =
> - AbsoluteDifference(CachedExtent.first, Intersection.first);
> - Buffer = CachedAlloc.slice(CacheRangeOffset, Size);
> - return Error::success();
> - }
> -
> - // Otherwise allocate a large enough buffer in the pool, memcpy the data
> - // into it, and return an ArrayRef to that. Do not touch existing pool
> - // allocations, as existing clients may be holding a pointer which must
> - // not be invalidated.
> - uint8_t *WriteBuffer = static_cast<uint8_t *>(Pool.Allocate(Size, 8));
> - if (auto EC = readBytes(Offset, MutableArrayRef<uint8_t>(WriteBuffer, Size)))
> - return EC;
> -
> - if (CacheIter != CacheMap.end()) {
> - CacheIter->second.emplace_back(WriteBuffer, Size);
> - } else {
> - std::vector<CacheEntry> List;
> - List.emplace_back(WriteBuffer, Size);
> - CacheMap.insert(std::make_pair(Offset, List));
> - }
> - Buffer = ArrayRef<uint8_t>(WriteBuffer, Size);
> - return Error::success();
> -}
> -
> -Error MappedBlockStream::readLongestContiguousChunk(
> - uint32_t Offset, ArrayRef<uint8_t> &Buffer) const {
> - // Make sure we aren't trying to read beyond the end of the stream.
> - if (Offset >= StreamLayout.Length)
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> - uint32_t First = Offset / BlockSize;
> - uint32_t Last = First;
> -
> - while (Last < NumBlocks - 1) {
> - if (StreamLayout.Blocks[Last] != StreamLayout.Blocks[Last + 1] - 1)
> - break;
> - ++Last;
> - }
> -
> - uint32_t OffsetInFirstBlock = Offset % BlockSize;
> - uint32_t BytesFromFirstBlock = BlockSize - OffsetInFirstBlock;
> - uint32_t BlockSpan = Last - First + 1;
> - uint32_t ByteSpan = BytesFromFirstBlock + (BlockSpan - 1) * BlockSize;
> -
> - ArrayRef<uint8_t> BlockData;
> - uint32_t MsfOffset = blockToOffset(StreamLayout.Blocks[First], BlockSize);
> - if (auto EC = MsfData.readBytes(MsfOffset, BlockSize, BlockData))
> - return EC;
> -
> - BlockData = BlockData.drop_front(OffsetInFirstBlock);
> - Buffer = ArrayRef<uint8_t>(BlockData.data(), ByteSpan);
> - return Error::success();
> -}
> -
> -uint32_t MappedBlockStream::getLength() const { return StreamLayout.Length; }
> -
> -bool MappedBlockStream::tryReadContiguously(uint32_t Offset, uint32_t Size,
> - ArrayRef<uint8_t> &Buffer) const {
> - // Attempt to fulfill the request with a reference directly into the stream.
> - // This can work even if the request crosses a block boundary, provided that
> - // all subsequent blocks are contiguous. For example, a 10k read with a 4k
> - // block size can be filled with a reference if, from the starting offset,
> - // 3 blocks in a row are contiguous.
> - uint32_t BlockNum = Offset / BlockSize;
> - uint32_t OffsetInBlock = Offset % BlockSize;
> - uint32_t BytesFromFirstBlock = std::min(Size, BlockSize - OffsetInBlock);
> - uint32_t NumAdditionalBlocks =
> - llvm::alignTo(Size - BytesFromFirstBlock, BlockSize) / BlockSize;
> -
> - uint32_t RequiredContiguousBlocks = NumAdditionalBlocks + 1;
> - uint32_t E = StreamLayout.Blocks[BlockNum];
> - for (uint32_t I = 0; I < RequiredContiguousBlocks; ++I, ++E) {
> - if (StreamLayout.Blocks[I + BlockNum] != E)
> - return false;
> - }
> -
> - // Read out the entire block where the requested offset starts. Then drop
> - // bytes from the beginning so that the actual starting byte lines up with
> - // the requested starting byte. Then, since we know this is a contiguous
> - // cross-block span, explicitly resize the ArrayRef to cover the entire
> - // request length.
> - ArrayRef<uint8_t> BlockData;
> - uint32_t FirstBlockAddr = StreamLayout.Blocks[BlockNum];
> - uint32_t MsfOffset = blockToOffset(FirstBlockAddr, BlockSize);
> - if (auto EC = MsfData.readBytes(MsfOffset, BlockSize, BlockData)) {
> - consumeError(std::move(EC));
> - return false;
> - }
> - BlockData = BlockData.drop_front(OffsetInBlock);
> - Buffer = ArrayRef<uint8_t>(BlockData.data(), Size);
> - return true;
> -}
> -
> -Error MappedBlockStream::readBytes(uint32_t Offset,
> - MutableArrayRef<uint8_t> Buffer) const {
> - uint32_t BlockNum = Offset / BlockSize;
> - uint32_t OffsetInBlock = Offset % BlockSize;
> -
> - // Make sure we aren't trying to read beyond the end of the stream.
> - if (Buffer.size() > StreamLayout.Length)
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> - if (Offset > StreamLayout.Length - Buffer.size())
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> -
> - uint32_t BytesLeft = Buffer.size();
> - uint32_t BytesWritten = 0;
> - uint8_t *WriteBuffer = Buffer.data();
> - while (BytesLeft > 0) {
> - uint32_t StreamBlockAddr = StreamLayout.Blocks[BlockNum];
> -
> - ArrayRef<uint8_t> BlockData;
> - uint32_t Offset = blockToOffset(StreamBlockAddr, BlockSize);
> - if (auto EC = MsfData.readBytes(Offset, BlockSize, BlockData))
> - return EC;
> -
> - const uint8_t *ChunkStart = BlockData.data() + OffsetInBlock;
> - uint32_t BytesInChunk = std::min(BytesLeft, BlockSize - OffsetInBlock);
> - ::memcpy(WriteBuffer + BytesWritten, ChunkStart, BytesInChunk);
> -
> - BytesWritten += BytesInChunk;
> - BytesLeft -= BytesInChunk;
> - ++BlockNum;
> - OffsetInBlock = 0;
> - }
> -
> - return Error::success();
> -}
> -
> -uint32_t MappedBlockStream::getNumBytesCopied() const {
> - return static_cast<uint32_t>(Pool.getBytesAllocated());
> -}
> -
> -void MappedBlockStream::invalidateCache() { CacheMap.shrink_and_clear(); }
> -
> -void MappedBlockStream::fixCacheAfterWrite(uint32_t Offset,
> - ArrayRef<uint8_t> Data) const {
> - // If this write overlapped a read which previously came from the pool,
> - // someone may still be holding a pointer to that alloc which is now invalid.
> - // Compute the overlapping range and update the cache entry, so any
> - // outstanding buffers are automatically updated.
> - for (const auto &MapEntry : CacheMap) {
> - // If the end of the written extent precedes the beginning of the cached
> - // extent, ignore this map entry.
> - if (Offset + Data.size() < MapEntry.first)
> - continue;
> - for (const auto &Alloc : MapEntry.second) {
> - // If the end of the cached extent precedes the beginning of the written
> - // extent, ignore this alloc.
> - if (MapEntry.first + Alloc.size() < Offset)
> - continue;
> -
> - // If we get here, they are guaranteed to overlap.
> - Interval WriteInterval = std::make_pair(Offset, Offset + Data.size());
> - Interval CachedInterval =
> - std::make_pair(MapEntry.first, MapEntry.first + Alloc.size());
> - // If they overlap, we need to write the new data into the overlapping
> - // range.
> - auto Intersection = intersect(WriteInterval, CachedInterval);
> - assert(Intersection.first <= Intersection.second);
> -
> - uint32_t Length = Intersection.second - Intersection.first;
> - uint32_t SrcOffset =
> - AbsoluteDifference(WriteInterval.first, Intersection.first);
> - uint32_t DestOffset =
> - AbsoluteDifference(CachedInterval.first, Intersection.first);
> - ::memcpy(Alloc.data() + DestOffset, Data.data() + SrcOffset, Length);
> - }
> - }
> -}
> -
> -WritableMappedBlockStream::WritableMappedBlockStream(
> - uint32_t BlockSize, uint32_t NumBlocks, const MsfStreamLayout &Layout,
> - const WritableStream &MsfData)
> - : ReadInterface(BlockSize, NumBlocks, Layout, MsfData),
> - WriteInterface(MsfData) {}
> -
> -std::unique_ptr<WritableMappedBlockStream>
> -WritableMappedBlockStream::createStream(uint32_t BlockSize, uint32_t NumBlocks,
> - const MsfStreamLayout &Layout,
> - const WritableStream &MsfData) {
> - return llvm::make_unique<MappedBlockStreamImpl<WritableMappedBlockStream>>(
> - BlockSize, NumBlocks, Layout, MsfData);
> -}
> -
> -std::unique_ptr<WritableMappedBlockStream>
> -WritableMappedBlockStream::createIndexedStream(const MsfLayout &Layout,
> - const WritableStream &MsfData,
> - uint32_t StreamIndex) {
> - MsfStreamLayout SL;
> - SL.Blocks = Layout.StreamMap[StreamIndex];
> - SL.Length = Layout.StreamSizes[StreamIndex];
> - return createStream(Layout.SB->BlockSize, Layout.SB->NumBlocks, SL, MsfData);
> -}
> -
> -std::unique_ptr<WritableMappedBlockStream>
> -WritableMappedBlockStream::createDirectoryStream(
> - 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);
> -}
> -
> -Error WritableMappedBlockStream::readBytes(uint32_t Offset, uint32_t Size,
> - ArrayRef<uint8_t> &Buffer) const {
> - return ReadInterface.readBytes(Offset, Size, Buffer);
> -}
> -
> -Error WritableMappedBlockStream::readLongestContiguousChunk(
> - uint32_t Offset, ArrayRef<uint8_t> &Buffer) const {
> - return ReadInterface.readLongestContiguousChunk(Offset, Buffer);
> -}
> -
> -uint32_t WritableMappedBlockStream::getLength() const {
> - return ReadInterface.getLength();
> -}
> -
> -Error WritableMappedBlockStream::writeBytes(uint32_t Offset,
> - ArrayRef<uint8_t> Buffer) const {
> - // Make sure we aren't trying to write beyond the end of the stream.
> - if (Buffer.size() > getStreamLength())
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> -
> - if (Offset > getStreamLayout().Length - Buffer.size())
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> -
> - uint32_t BlockNum = Offset / getBlockSize();
> - uint32_t OffsetInBlock = Offset % getBlockSize();
> -
> - uint32_t BytesLeft = Buffer.size();
> - uint32_t BytesWritten = 0;
> - while (BytesLeft > 0) {
> - uint32_t StreamBlockAddr = getStreamLayout().Blocks[BlockNum];
> - uint32_t BytesToWriteInChunk =
> - std::min(BytesLeft, getBlockSize() - OffsetInBlock);
> -
> - const uint8_t *Chunk = Buffer.data() + BytesWritten;
> - ArrayRef<uint8_t> ChunkData(Chunk, BytesToWriteInChunk);
> - uint32_t MsfOffset = blockToOffset(StreamBlockAddr, getBlockSize());
> - MsfOffset += OffsetInBlock;
> - if (auto EC = WriteInterface.writeBytes(MsfOffset, ChunkData))
> - return EC;
> -
> - BytesLeft -= BytesToWriteInChunk;
> - BytesWritten += BytesToWriteInChunk;
> - ++BlockNum;
> - OffsetInBlock = 0;
> - }
> -
> - ReadInterface.fixCacheAfterWrite(Offset, Buffer);
> -
> - return Error::success();
> -}
> -
> -Error WritableMappedBlockStream::commit() const {
> - return WriteInterface.commit();
> -}
>
> Removed: llvm/trunk/lib/DebugInfo/Msf/MsfBuilder.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/Msf/MsfBuilder.cpp?rev=277189&view=auto
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/Msf/MsfBuilder.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/Msf/MsfBuilder.cpp (removed)
> @@ -1,279 +0,0 @@
> -//
> -// The LLVM Compiler Infrastructure
> -//
> -// This file is distributed under the University of Illinois Open Source
> -// License. See LICENSE.TXT for details.
> -//
> -//===----------------------------------------------------------------------===//
> -
> -#include "llvm/DebugInfo/Msf/MsfBuilder.h"
> -#include "llvm/DebugInfo/Msf/MsfError.h"
> -
> -using namespace llvm;
> -using namespace llvm::msf;
> -using namespace llvm::support;
> -
> -namespace {
> -const uint32_t kSuperBlockBlock = 0;
> -const uint32_t kFreePageMap0Block = 1;
> -const uint32_t kFreePageMap1Block = 2;
> -const uint32_t kNumReservedPages = 3;
> -
> -const uint32_t kDefaultBlockMapAddr = kNumReservedPages;
> -}
> -
> -MsfBuilder::MsfBuilder(uint32_t BlockSize, uint32_t MinBlockCount, bool CanGrow,
> - BumpPtrAllocator &Allocator)
> - : Allocator(Allocator), IsGrowable(CanGrow), BlockSize(BlockSize),
> - MininumBlocks(MinBlockCount), BlockMapAddr(kDefaultBlockMapAddr),
> - FreeBlocks(MinBlockCount, true) {
> - FreeBlocks[kSuperBlockBlock] = false;
> - FreeBlocks[kFreePageMap0Block] = false;
> - FreeBlocks[kFreePageMap1Block] = false;
> - FreeBlocks[BlockMapAddr] = false;
> -}
> -
> -Expected<MsfBuilder> MsfBuilder::create(BumpPtrAllocator &Allocator,
> - uint32_t BlockSize,
> - uint32_t MinBlockCount, bool CanGrow) {
> - if (!isValidBlockSize(BlockSize))
> - return make_error<MsfError>(msf_error_code::invalid_format,
> - "The requested block size is unsupported");
> -
> - return MsfBuilder(BlockSize,
> - std::max(MinBlockCount, msf::getMinimumBlockCount()),
> - CanGrow, Allocator);
> -}
> -
> -Error MsfBuilder::setBlockMapAddr(uint32_t Addr) {
> - if (Addr == BlockMapAddr)
> - return Error::success();
> -
> - if (Addr >= FreeBlocks.size()) {
> - if (!IsGrowable)
> - return make_error<MsfError>(msf_error_code::insufficient_buffer,
> - "Cannot grow the number of blocks");
> - FreeBlocks.resize(Addr + 1);
> - }
> -
> - if (!isBlockFree(Addr))
> - return make_error<MsfError>(
> - msf_error_code::block_in_use,
> - "Requested block map address is already in use");
> - FreeBlocks[BlockMapAddr] = true;
> - FreeBlocks[Addr] = false;
> - BlockMapAddr = Addr;
> - return Error::success();
> -}
> -
> -void MsfBuilder::setFreePageMap(uint32_t Fpm) { FreePageMap = Fpm; }
> -
> -void MsfBuilder::setUnknown1(uint32_t Unk1) { Unknown1 = Unk1; }
> -
> -Error MsfBuilder::setDirectoryBlocksHint(ArrayRef<uint32_t> DirBlocks) {
> - for (auto B : DirectoryBlocks)
> - FreeBlocks[B] = true;
> - for (auto B : DirBlocks) {
> - if (!isBlockFree(B)) {
> - return make_error<MsfError>(msf_error_code::unspecified,
> - "Attempt to reuse an allocated block");
> - }
> - FreeBlocks[B] = false;
> - }
> -
> - DirectoryBlocks = DirBlocks;
> - return Error::success();
> -}
> -
> -Error MsfBuilder::allocateBlocks(uint32_t NumBlocks,
> - MutableArrayRef<uint32_t> Blocks) {
> - if (NumBlocks == 0)
> - return Error::success();
> -
> - uint32_t NumFreeBlocks = FreeBlocks.count();
> - if (NumFreeBlocks < NumBlocks) {
> - if (!IsGrowable)
> - return make_error<MsfError>(msf_error_code::insufficient_buffer,
> - "There are no free Blocks in the file");
> - uint32_t AllocBlocks = NumBlocks - NumFreeBlocks;
> - FreeBlocks.resize(AllocBlocks + FreeBlocks.size(), true);
> - }
> -
> - int I = 0;
> - int Block = FreeBlocks.find_first();
> - do {
> - assert(Block != -1 && "We ran out of Blocks!");
> -
> - uint32_t NextBlock = static_cast<uint32_t>(Block);
> - Blocks[I++] = NextBlock;
> - FreeBlocks.reset(NextBlock);
> - Block = FreeBlocks.find_next(Block);
> - } while (--NumBlocks > 0);
> - return Error::success();
> -}
> -
> -uint32_t MsfBuilder::getNumUsedBlocks() const {
> - return getTotalBlockCount() - getNumFreeBlocks();
> -}
> -
> -uint32_t MsfBuilder::getNumFreeBlocks() const { return FreeBlocks.count(); }
> -
> -uint32_t MsfBuilder::getTotalBlockCount() const { return FreeBlocks.size(); }
> -
> -bool MsfBuilder::isBlockFree(uint32_t Idx) const { return FreeBlocks[Idx]; }
> -
> -Error MsfBuilder::addStream(uint32_t Size, ArrayRef<uint32_t> 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<MsfError>(
> - msf_error_code::invalid_format,
> - "Incorrect number of blocks for requested stream size");
> - for (auto Block : Blocks) {
> - if (Block >= FreeBlocks.size())
> - FreeBlocks.resize(Block + 1, true);
> -
> - if (!FreeBlocks.test(Block))
> - return make_error<MsfError>(
> - msf_error_code::unspecified,
> - "Attempt to re-use an already allocated block");
> - }
> - // Mark all the blocks occupied by the new stream as not free.
> - for (auto Block : Blocks) {
> - FreeBlocks.reset(Block);
> - }
> - StreamData.push_back(std::make_pair(Size, Blocks));
> - return Error::success();
> -}
> -
> -Error MsfBuilder::addStream(uint32_t Size) {
> - uint32_t ReqBlocks = bytesToBlocks(Size, BlockSize);
> - std::vector<uint32_t> NewBlocks;
> - NewBlocks.resize(ReqBlocks);
> - if (auto EC = allocateBlocks(ReqBlocks, NewBlocks))
> - return EC;
> - StreamData.push_back(std::make_pair(Size, NewBlocks));
> - return Error::success();
> -}
> -
> -Error MsfBuilder::setStreamSize(uint32_t Idx, uint32_t Size) {
> - uint32_t OldSize = getStreamSize(Idx);
> - if (OldSize == Size)
> - return Error::success();
> -
> - uint32_t NewBlocks = bytesToBlocks(Size, BlockSize);
> - uint32_t OldBlocks = bytesToBlocks(OldSize, BlockSize);
> -
> - if (NewBlocks > OldBlocks) {
> - uint32_t AddedBlocks = NewBlocks - OldBlocks;
> - // If we're growing, we have to allocate new Blocks.
> - std::vector<uint32_t> AddedBlockList;
> - AddedBlockList.resize(AddedBlocks);
> - if (auto EC = allocateBlocks(AddedBlocks, AddedBlockList))
> - return EC;
> - auto &CurrentBlocks = StreamData[Idx].second;
> - CurrentBlocks.insert(CurrentBlocks.end(), AddedBlockList.begin(),
> - AddedBlockList.end());
> - } else if (OldBlocks > NewBlocks) {
> - // For shrinking, free all the Blocks in the Block map, update the stream
> - // data, then shrink the directory.
> - uint32_t RemovedBlocks = OldBlocks - NewBlocks;
> - auto CurrentBlocks = ArrayRef<uint32_t>(StreamData[Idx].second);
> - auto RemovedBlockList = CurrentBlocks.drop_front(NewBlocks);
> - for (auto P : RemovedBlockList)
> - FreeBlocks[P] = true;
> - StreamData[Idx].second = CurrentBlocks.drop_back(RemovedBlocks);
> - }
> -
> - StreamData[Idx].first = Size;
> - return Error::success();
> -}
> -
> -uint32_t MsfBuilder::getNumStreams() const { return StreamData.size(); }
> -
> -uint32_t MsfBuilder::getStreamSize(uint32_t StreamIdx) const {
> - return StreamData[StreamIdx].first;
> -}
> -
> -ArrayRef<uint32_t> MsfBuilder::getStreamBlocks(uint32_t StreamIdx) const {
> - return StreamData[StreamIdx].second;
> -}
> -
> -uint32_t MsfBuilder::computeDirectoryByteSize() const {
> - // The directory has the following layout, where each item is a ulittle32_t:
> - // NumStreams
> - // StreamSizes[NumStreams]
> - // StreamBlocks[NumStreams][]
> - uint32_t Size = sizeof(ulittle32_t); // NumStreams
> - Size += StreamData.size() * sizeof(ulittle32_t); // StreamSizes
> - for (const auto &D : StreamData) {
> - uint32_t ExpectedNumBlocks = bytesToBlocks(D.first, BlockSize);
> - assert(ExpectedNumBlocks == D.second.size() &&
> - "Unexpected number of blocks");
> - Size += ExpectedNumBlocks * sizeof(ulittle32_t);
> - }
> - return Size;
> -}
> -
> -Expected<MsfLayout> MsfBuilder::build() {
> - SuperBlock *SB = Allocator.Allocate<SuperBlock>();
> - MsfLayout L;
> - L.SB = SB;
> -
> - std::memcpy(SB->MagicBytes, Magic, sizeof(Magic));
> - SB->BlockMapAddr = BlockMapAddr;
> - SB->BlockSize = BlockSize;
> - SB->NumDirectoryBytes = computeDirectoryByteSize();
> - SB->FreeBlockMapBlock = FreePageMap;
> - SB->Unknown1 = Unknown1;
> -
> - uint32_t NumDirectoryBlocks = bytesToBlocks(SB->NumDirectoryBytes, BlockSize);
> - if (NumDirectoryBlocks > DirectoryBlocks.size()) {
> - // Our hint wasn't enough to satisfy the entire directory. Allocate
> - // remaining pages.
> - std::vector<uint32_t> ExtraBlocks;
> - uint32_t NumExtraBlocks = NumDirectoryBlocks - DirectoryBlocks.size();
> - ExtraBlocks.resize(NumExtraBlocks);
> - if (auto EC = allocateBlocks(NumExtraBlocks, ExtraBlocks))
> - return std::move(EC);
> - DirectoryBlocks.insert(DirectoryBlocks.end(), ExtraBlocks.begin(),
> - ExtraBlocks.end());
> - } else if (NumDirectoryBlocks < DirectoryBlocks.size()) {
> - uint32_t NumUnnecessaryBlocks = DirectoryBlocks.size() - NumDirectoryBlocks;
> - for (auto B :
> - ArrayRef<uint32_t>(DirectoryBlocks).drop_back(NumUnnecessaryBlocks))
> - FreeBlocks[B] = true;
> - DirectoryBlocks.resize(NumDirectoryBlocks);
> - }
> -
> - // Don't set the number of blocks in the file until after allocating Blocks
> - // for the directory, since the allocation might cause the file to need to
> - // grow.
> - SB->NumBlocks = FreeBlocks.size();
> -
> - ulittle32_t *DirBlocks = Allocator.Allocate<ulittle32_t>(NumDirectoryBlocks);
> - std::uninitialized_copy_n(DirectoryBlocks.begin(), NumDirectoryBlocks,
> - DirBlocks);
> - L.DirectoryBlocks = ArrayRef<ulittle32_t>(DirBlocks, NumDirectoryBlocks);
> -
> - // The stream sizes should be re-allocated as a stable pointer and the stream
> - // map should have each of its entries allocated as a separate stable pointer.
> - if (StreamData.size() > 0) {
> - ulittle32_t *Sizes = Allocator.Allocate<ulittle32_t>(StreamData.size());
> - L.StreamSizes = ArrayRef<ulittle32_t>(Sizes, StreamData.size());
> - L.StreamMap.resize(StreamData.size());
> - for (uint32_t I = 0; I < StreamData.size(); ++I) {
> - Sizes[I] = StreamData[I].first;
> - ulittle32_t *BlockList =
> - Allocator.Allocate<ulittle32_t>(StreamData[I].second.size());
> - std::uninitialized_copy_n(StreamData[I].second.begin(),
> - StreamData[I].second.size(), BlockList);
> - L.StreamMap[I] =
> - ArrayRef<ulittle32_t>(BlockList, StreamData[I].second.size());
> - }
> - }
> -
> - return L;
> -}
>
> Removed: llvm/trunk/lib/DebugInfo/Msf/MsfCommon.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/Msf/MsfCommon.cpp?rev=277189&view=auto
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/Msf/MsfCommon.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/Msf/MsfCommon.cpp (removed)
> @@ -1,48 +0,0 @@
> -//===- MsfCommon.cpp - Common types and functions for MSF files -*- C++ -*-===//
> -//
> -// The LLVM Compiler Infrastructure
> -//
> -// This file is distributed under the University of Illinois Open Source
> -// License. See LICENSE.TXT for details.
> -//
> -//===----------------------------------------------------------------------===//
> -
> -#include "llvm/DebugInfo/Msf/MsfCommon.h"
> -#include "llvm/DebugInfo/Msf/MsfError.h"
> -
> -using namespace llvm;
> -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<MsfError>(msf_error_code::invalid_format,
> - "MSF magic header doesn't match");
> -
> - if (!isValidBlockSize(SB.BlockSize))
> - return make_error<MsfError>(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<MsfError>(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
> - // the number of bytes it contains.
> - uint64_t NumDirectoryBlocks =
> - bytesToBlocks(SB.NumDirectoryBytes, SB.BlockSize);
> -
> - // The directory, as we understand it, is a block which consists of a list of
> - // 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<MsfError>(msf_error_code::invalid_format,
> - "Too many directory blocks.");
> -
> - if (SB.BlockMapAddr == 0)
> - return make_error<MsfError>(msf_error_code::invalid_format,
> - "Block 0 is reserved");
> -
> - return Error::success();
> -}
>
> Removed: llvm/trunk/lib/DebugInfo/Msf/MsfError.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/Msf/MsfError.cpp?rev=277189&view=auto
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/Msf/MsfError.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/Msf/MsfError.cpp (removed)
> @@ -1,70 +0,0 @@
> -//===- MsfError.cpp - Error extensions for Msf files ------------*- C++ -*-===//
> -//
> -// The LLVM Compiler Infrastructure
> -//
> -// This file is distributed under the University of Illinois Open Source
> -// License. See LICENSE.TXT for details.
> -//
> -//===----------------------------------------------------------------------===//
> -
> -#include "llvm/DebugInfo/Msf/MsfError.h"
> -#include "llvm/Support/ErrorHandling.h"
> -#include "llvm/Support/ManagedStatic.h"
> -
> -using namespace llvm;
> -using namespace llvm::msf;
> -
> -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 {
> -public:
> - const char *name() const LLVM_NOEXCEPT override { return "llvm.msf"; }
> -
> - std::string message(int Condition) const override {
> - switch (static_cast<msf_error_code>(Condition)) {
> - case msf_error_code::unspecified:
> - return "An unknown error has occurred.";
> - case msf_error_code::insufficient_buffer:
> - return "The buffer is not large enough to read the requested number of "
> - "bytes.";
> - case msf_error_code::not_writable:
> - return "The specified stream is not writable.";
> - case msf_error_code::no_stream:
> - return "The specified stream does not exist.";
> - case msf_error_code::invalid_format:
> - return "The data is in an unexpected format.";
> - case msf_error_code::block_in_use:
> - return "The block is already in use.";
> - }
> - llvm_unreachable("Unrecognized msf_error_code");
> - }
> -};
> -} // end anonymous namespace
> -
> -static ManagedStatic<MsfErrorCategory> Category;
> -
> -char MsfError::ID = 0;
> -
> -MsfError::MsfError(msf_error_code C) : MsfError(C, "") {}
> -
> -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: ";
> - std::error_code EC = convertToErrorCode();
> - if (Code != msf_error_code::unspecified)
> - ErrMsg += EC.message() + " ";
> - if (!Context.empty())
> - ErrMsg += Context;
> -}
> -
> -void MsfError::log(raw_ostream &OS) const { OS << ErrMsg << "\n"; }
> -
> -const std::string &MsfError::getErrorMessage() const { return ErrMsg; }
> -
> -std::error_code MsfError::convertToErrorCode() const {
> - return std::error_code(static_cast<int>(Code), *Category);
> -}
>
> Removed: llvm/trunk/lib/DebugInfo/Msf/StreamReader.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/Msf/StreamReader.cpp?rev=277189&view=auto
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/Msf/StreamReader.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/Msf/StreamReader.cpp (removed)
> @@ -1,93 +0,0 @@
> -//===- StreamReader.cpp - Reads bytes and objects from a stream -----------===//
> -//
> -// The LLVM Compiler Infrastructure
> -//
> -// This file is distributed under the University of Illinois Open Source
> -// License. See LICENSE.TXT for details.
> -//
> -//===----------------------------------------------------------------------===//
> -
> -#include "llvm/DebugInfo/Msf/StreamReader.h"
> -
> -#include "llvm/DebugInfo/Msf/MsfError.h"
> -#include "llvm/DebugInfo/Msf/StreamRef.h"
> -
> -using namespace llvm;
> -using namespace llvm::msf;
> -
> -StreamReader::StreamReader(ReadableStreamRef S) : Stream(S), Offset(0) {}
> -
> -Error StreamReader::readLongestContiguousChunk(ArrayRef<uint8_t> &Buffer) {
> - if (auto EC = Stream.readLongestContiguousChunk(Offset, Buffer))
> - return EC;
> - Offset += Buffer.size();
> - return Error::success();
> -}
> -
> -Error StreamReader::readBytes(ArrayRef<uint8_t> &Buffer, uint32_t Size) {
> - if (auto EC = Stream.readBytes(Offset, Size, Buffer))
> - return EC;
> - Offset += Size;
> - return Error::success();
> -}
> -
> -Error StreamReader::readInteger(uint16_t &Dest) {
> - const support::ulittle16_t *P;
> - if (auto EC = readObject(P))
> - return EC;
> - Dest = *P;
> - return Error::success();
> -}
> -
> -Error StreamReader::readInteger(uint32_t &Dest) {
> - const support::ulittle32_t *P;
> - if (auto EC = readObject(P))
> - return EC;
> - Dest = *P;
> - return Error::success();
> -}
> -
> -Error StreamReader::readZeroString(StringRef &Dest) {
> - uint32_t Length = 0;
> - // First compute the length of the string by reading 1 byte at a time.
> - uint32_t OriginalOffset = getOffset();
> - const char *C;
> - do {
> - if (auto EC = readObject(C))
> - return EC;
> - if (*C != '\0')
> - ++Length;
> - } while (*C != '\0');
> - // Now go back and request a reference for that many bytes.
> - uint32_t NewOffset = getOffset();
> - setOffset(OriginalOffset);
> -
> - ArrayRef<uint8_t> Data;
> - if (auto EC = readBytes(Data, Length))
> - return EC;
> - Dest = StringRef(reinterpret_cast<const char *>(Data.begin()), Data.size());
> -
> - // Now set the offset back to where it was after we calculated the length.
> - setOffset(NewOffset);
> - return Error::success();
> -}
> -
> -Error StreamReader::readFixedString(StringRef &Dest, uint32_t Length) {
> - ArrayRef<uint8_t> Bytes;
> - if (auto EC = readBytes(Bytes, Length))
> - return EC;
> - Dest = StringRef(reinterpret_cast<const char *>(Bytes.begin()), Bytes.size());
> - return Error::success();
> -}
> -
> -Error StreamReader::readStreamRef(ReadableStreamRef &Ref) {
> - return readStreamRef(Ref, bytesRemaining());
> -}
> -
> -Error StreamReader::readStreamRef(ReadableStreamRef &Ref, uint32_t Length) {
> - if (bytesRemaining() < Length)
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> - Ref = Stream.slice(Offset, Length);
> - Offset += Length;
> - return Error::success();
> -}
>
> Removed: llvm/trunk/lib/DebugInfo/Msf/StreamWriter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/Msf/StreamWriter.cpp?rev=277189&view=auto
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/Msf/StreamWriter.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/Msf/StreamWriter.cpp (removed)
> @@ -1,78 +0,0 @@
> -//===- StreamWrite.cpp - Writes bytes and objects to a stream -------------===//
> -//
> -// The LLVM Compiler Infrastructure
> -//
> -// This file is distributed under the University of Illinois Open Source
> -// License. See LICENSE.TXT for details.
> -//
> -//===----------------------------------------------------------------------===//
> -
> -#include "llvm/DebugInfo/Msf/StreamWriter.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;
> -
> -StreamWriter::StreamWriter(WritableStreamRef S) : Stream(S), Offset(0) {}
> -
> -Error StreamWriter::writeBytes(ArrayRef<uint8_t> Buffer) {
> - if (auto EC = Stream.writeBytes(Offset, Buffer))
> - return EC;
> - Offset += Buffer.size();
> - return Error::success();
> -}
> -
> -Error StreamWriter::writeInteger(uint16_t Int) {
> - return writeObject(support::ulittle16_t(Int));
> -}
> -
> -Error StreamWriter::writeInteger(uint32_t Int) {
> - return writeObject(support::ulittle32_t(Int));
> -}
> -
> -Error StreamWriter::writeZeroString(StringRef Str) {
> - if (auto EC = writeFixedString(Str))
> - return EC;
> - if (auto EC = writeObject('\0'))
> - return EC;
> -
> - return Error::success();
> -}
> -
> -Error StreamWriter::writeFixedString(StringRef Str) {
> - ArrayRef<uint8_t> Bytes(Str.bytes_begin(), Str.bytes_end());
> - if (auto EC = Stream.writeBytes(Offset, Bytes))
> - return EC;
> -
> - Offset += Str.size();
> - return Error::success();
> -}
> -
> -Error StreamWriter::writeStreamRef(ReadableStreamRef Ref) {
> - if (auto EC = writeStreamRef(Ref, Ref.getLength()))
> - return EC;
> - // Don't increment Offset here, it is done by the overloaded call to
> - // writeStreamRef.
> - return Error::success();
> -}
> -
> -Error StreamWriter::writeStreamRef(ReadableStreamRef Ref, uint32_t Length) {
> - Ref = Ref.slice(0, Length);
> -
> - StreamReader SrcReader(Ref);
> - // This is a bit tricky. If we just call readBytes, we are requiring that it
> - // return us the entire stream as a contiguous buffer. For large streams this
> - // will allocate a huge amount of space from the pool. Instead, iterate over
> - // each contiguous chunk until we've consumed the entire stream.
> - while (SrcReader.bytesRemaining() > 0) {
> - ArrayRef<uint8_t> Chunk;
> - if (auto EC = SrcReader.readLongestContiguousChunk(Chunk))
> - return EC;
> - if (auto EC = writeBytes(Chunk))
> - return EC;
> - }
> - return Error::success();
> -}
>
> Modified: llvm/trunk/lib/DebugInfo/PDB/LLVMBuild.txt
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/LLVMBuild.txt?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/PDB/LLVMBuild.txt (original)
> +++ llvm/trunk/lib/DebugInfo/PDB/LLVMBuild.txt Fri Jul 29 13:24:26 2016
> @@ -19,5 +19,5 @@
> type = Library
> name = DebugInfoPDB
> parent = DebugInfo
> -required_libraries = Object Support DebugInfoCodeView DebugInfoMsf
> +required_libraries = Object Support DebugInfoCodeView DebugInfoMSF
>
>
> Modified: llvm/trunk/lib/DebugInfo/PDB/Raw/DbiStream.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/Raw/DbiStream.cpp?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/PDB/Raw/DbiStream.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/PDB/Raw/DbiStream.cpp Fri Jul 29 13:24:26 2016
> @@ -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"
>
> Modified: llvm/trunk/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp Fri Jul 29 13:24:26 2016
> @@ -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, c
> 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);
>
> Modified: llvm/trunk/lib/DebugInfo/PDB/Raw/InfoStream.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/Raw/InfoStream.cpp?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/PDB/Raw/InfoStream.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/PDB/Raw/InfoStream.cpp Fri Jul 29 13:24:26 2016
> @@ -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"
>
> Modified: llvm/trunk/lib/DebugInfo/PDB/Raw/InfoStreamBuilder.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/Raw/InfoStreamBuilder.cpp?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/PDB/Raw/InfoStreamBuilder.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/PDB/Raw/InfoStreamBuilder.cpp Fri Jul 29 13:24:26 2016
> @@ -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,
> 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);
>
> Modified: llvm/trunk/lib/DebugInfo/PDB/Raw/ModInfo.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/Raw/ModInfo.cpp?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/PDB/Raw/ModInfo.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/PDB/Raw/ModInfo.cpp Fri Jul 29 13:24:26 2016
> @@ -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"
>
>
> Modified: llvm/trunk/lib/DebugInfo/PDB/Raw/ModStream.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/Raw/ModStream.cpp?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/PDB/Raw/ModStream.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/PDB/Raw/ModStream.cpp Fri Jul 29 13:24:26 2016
> @@ -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"
>
> Modified: llvm/trunk/lib/DebugInfo/PDB/Raw/NameHashTable.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/Raw/NameHashTable.cpp?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/PDB/Raw/NameHashTable.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/PDB/Raw/NameHashTable.cpp Fri Jul 29 13:24:26 2016
> @@ -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"
>
> Modified: llvm/trunk/lib/DebugInfo/PDB/Raw/NameMap.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/Raw/NameMap.cpp?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/PDB/Raw/NameMap.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/PDB/Raw/NameMap.cpp Fri Jul 29 13:24:26 2016
> @@ -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;
>
> Modified: llvm/trunk/lib/DebugInfo/PDB/Raw/NameMapBuilder.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/Raw/NameMapBuilder.cpp?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/PDB/Raw/NameMapBuilder.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/PDB/Raw/NameMapBuilder.cpp Fri Jul 29 13:24:26 2016
> @@ -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"
>
>
> Modified: llvm/trunk/lib/DebugInfo/PDB/Raw/PDBFile.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/Raw/PDBFile.cpp?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/PDB/Raw/PDBFile.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/PDB/Raw/PDBFile.cpp Fri Jul 29 13:24:26 2016
> @@ -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"
>
> Modified: llvm/trunk/lib/DebugInfo/PDB/Raw/PDBFileBuilder.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/Raw/PDBFileBuilder.cpp?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/PDB/Raw/PDBFileBuilder.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/PDB/Raw/PDBFileBuilder.cpp Fri Jul 29 13:24:26 2016
> @@ -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(BumpPtrAl
>
> 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<MsfBuilder>(std::move(MsfResult));
> + Msf = llvm::make_unique<MSFBuilder>(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::getDbi
> return *Dbi;
> }
>
> -Expected<msf::MsfLayout> PDBFileBuilder::finalizeMsfLayout() const {
> +Expected<msf::MSFLayout> PDBFileBuilder::finalizeMsfLayout() const {
> if (Info) {
> uint32_t Length = Info->calculateSerializedLength();
> if (auto EC = Msf->setStreamSize(StreamPDB, Length))
>
> Modified: llvm/trunk/lib/DebugInfo/PDB/Raw/PublicsStream.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/Raw/PublicsStream.cpp?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/PDB/Raw/PublicsStream.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/PDB/Raw/PublicsStream.cpp Fri Jul 29 13:24:26 2016
> @@ -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"
>
> Modified: llvm/trunk/lib/DebugInfo/PDB/Raw/RawSession.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/Raw/RawSession.cpp?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/PDB/Raw/RawSession.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/PDB/Raw/RawSession.cpp Fri Jul 29 13:24:26 2016
> @@ -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"
>
> Modified: llvm/trunk/lib/DebugInfo/PDB/Raw/SymbolStream.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/Raw/SymbolStream.cpp?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/PDB/Raw/SymbolStream.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/PDB/Raw/SymbolStream.cpp Fri Jul 29 13:24:26 2016
> @@ -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"
>
> Modified: llvm/trunk/lib/DebugInfo/PDB/Raw/TpiStream.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/Raw/TpiStream.cpp?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/PDB/Raw/TpiStream.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/PDB/Raw/TpiStream.cpp Fri Jul 29 13:24:26 2016
> @@ -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"
>
> Modified: llvm/trunk/tools/llvm-pdbdump/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/CMakeLists.txt?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-pdbdump/CMakeLists.txt (original)
> +++ llvm/trunk/tools/llvm-pdbdump/CMakeLists.txt Fri Jul 29 13:24:26 2016
> @@ -1,6 +1,6 @@
> set(LLVM_LINK_COMPONENTS
> DebugInfoCodeView
> - DebugInfoMsf
> + DebugInfoMSF
> DebugInfoPDB
> Object
> Support
>
> Modified: llvm/trunk/tools/llvm-pdbdump/LLVMBuild.txt
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/LLVMBuild.txt?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-pdbdump/LLVMBuild.txt (original)
> +++ llvm/trunk/tools/llvm-pdbdump/LLVMBuild.txt Fri Jul 29 13:24:26 2016
> @@ -19,5 +19,5 @@
> type = Tool
> name = llvm-pdbdump
> parent = Tools
> -required_libraries = DebugInfoMsf DebugInfoPDB
> +required_libraries = DebugInfoMSF DebugInfoPDB
>
>
> Modified: llvm/trunk/tools/llvm-pdbdump/LLVMOutputStyle.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/LLVMOutputStyle.cpp?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-pdbdump/LLVMOutputStyle.cpp (original)
> +++ llvm/trunk/tools/llvm-pdbdump/LLVMOutputStyle.cpp Fri Jul 29 13:24:26 2016
> @@ -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"
>
> Modified: llvm/trunk/tools/llvm-pdbdump/PdbYaml.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/PdbYaml.cpp?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-pdbdump/PdbYaml.cpp (original)
> +++ llvm/trunk/tools/llvm-pdbdump/PdbYaml.cpp Fri Jul 29 13:24:26 2016
> @@ -113,7 +113,7 @@ void MappingTraits<PdbObject>::mapping(I
> IO.mapOptional("DbiStream", Obj.DbiStream);
> }
>
> -void MappingTraits<MsfHeaders>::mapping(IO &IO, MsfHeaders &Obj) {
> +void MappingTraits<MSFHeaders>::mapping(IO &IO, MSFHeaders &Obj) {
> IO.mapRequired("SuperBlock", Obj.SuperBlock);
> IO.mapRequired("NumDirectoryBlocks", Obj.NumDirectoryBlocks);
> IO.mapRequired("DirectoryBlocks", Obj.DirectoryBlocks);
>
> Modified: llvm/trunk/tools/llvm-pdbdump/PdbYaml.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/PdbYaml.h?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-pdbdump/PdbYaml.h (original)
> +++ llvm/trunk/tools/llvm-pdbdump/PdbYaml.h Fri Jul 29 13:24:26 2016
> @@ -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<uint32_t> DirectoryBlocks;
> @@ -70,7 +70,7 @@ struct PdbDbiStream {
> };
>
> struct PdbObject {
> - Optional<MsfHeaders> Headers;
> + Optional<MSFHeaders> Headers;
> Optional<std::vector<uint32_t>> StreamSizes;
> Optional<std::vector<StreamBlockList>> StreamMap;
> Optional<PdbInfoStream> PdbStream;
> @@ -87,8 +87,8 @@ template <> struct MappingTraits<pdb::ya
> static void mapping(IO &IO, pdb::yaml::PdbObject &Obj);
> };
>
> -template <> struct MappingTraits<pdb::yaml::MsfHeaders> {
> - static void mapping(IO &IO, pdb::yaml::MsfHeaders &Obj);
> +template <> struct MappingTraits<pdb::yaml::MSFHeaders> {
> + static void mapping(IO &IO, pdb::yaml::MSFHeaders &Obj);
> };
>
> template <> struct MappingTraits<msf::SuperBlock> {
>
> Modified: llvm/trunk/tools/llvm-pdbdump/YAMLOutputStyle.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/YAMLOutputStyle.cpp?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-pdbdump/YAMLOutputStyle.cpp (original)
> +++ llvm/trunk/tools/llvm-pdbdump/YAMLOutputStyle.cpp Fri Jul 29 13:24:26 2016
> @@ -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();
>
> Modified: llvm/trunk/tools/llvm-pdbdump/llvm-pdbdump.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/llvm-pdbdump.cpp?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-pdbdump/llvm-pdbdump.cpp (original)
> +++ llvm/trunk/tools/llvm-pdbdump/llvm-pdbdump.cpp Fri Jul 29 13:24:26 2016
> @@ -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"
>
> Modified: llvm/trunk/tools/llvm-readobj/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/CMakeLists.txt?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-readobj/CMakeLists.txt (original)
> +++ llvm/trunk/tools/llvm-readobj/CMakeLists.txt Fri Jul 29 13:24:26 2016
> @@ -3,7 +3,7 @@ set(LLVM_LINK_COMPONENTS
> Object
> Support
> DebugInfoCodeView
> - DebugInfoMsf
> + DebugInfoMSF
> )
>
> add_llvm_tool(llvm-readobj
>
> Modified: llvm/trunk/tools/llvm-readobj/COFFDumper.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/COFFDumper.cpp?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-readobj/COFFDumper.cpp (original)
> +++ llvm/trunk/tools/llvm-readobj/COFFDumper.cpp Fri Jul 29 13:24:26 2016
> @@ -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"
>
> Modified: llvm/trunk/tools/llvm-readobj/LLVMBuild.txt
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/LLVMBuild.txt?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-readobj/LLVMBuild.txt (original)
> +++ llvm/trunk/tools/llvm-readobj/LLVMBuild.txt Fri Jul 29 13:24:26 2016
> @@ -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
>
> Modified: llvm/trunk/unittests/DebugInfo/PDB/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/DebugInfo/PDB/CMakeLists.txt?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/unittests/DebugInfo/PDB/CMakeLists.txt (original)
> +++ llvm/trunk/unittests/DebugInfo/PDB/CMakeLists.txt Fri Jul 29 13:24:26 2016
> @@ -1,12 +1,12 @@
> set(LLVM_LINK_COMPONENTS
> DebugInfoCodeView
> - DebugInfoMsf
> + DebugInfoMSF
> DebugInfoPDB
> )
>
> set(DebugInfoPDBSources
> MappedBlockStreamTest.cpp
> - MsfBuilderTest.cpp
> + MSFBuilderTest.cpp
> PDBApiTest.cpp
> )
>
>
> Modified: llvm/trunk/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp (original)
> +++ llvm/trunk/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp Fri Jul 29 13:24:26 2016
> @@ -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 <unordered_map>
> @@ -39,7 +39,7 @@ public:
> Error readBytes(uint32_t Offset, uint32_t Size,
> ArrayRef<uint8_t> &Buffer) const override {
> if (Offset + Size > Data.size())
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> + return make_error<MSFError>(msf_error_code::insufficient_buffer);
> Buffer = Data.slice(Offset, Size);
> return Error::success();
> }
> @@ -47,7 +47,7 @@ public:
> Error readLongestContiguousChunk(uint32_t Offset,
> ArrayRef<uint8_t> &Buffer) const override {
> if (Offset >= Data.size())
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> + return make_error<MSFError>(msf_error_code::insufficient_buffer);
> Buffer = Data.drop_front(Offset);
> return Error::success();
> }
> @@ -56,14 +56,14 @@ public:
>
> Error writeBytes(uint32_t Offset, ArrayRef<uint8_t> SrcData) const override {
> if (Offset + SrcData.size() > Data.size())
> - return make_error<MsfError>(msf_error_code::insufficient_buffer);
> + return make_error<MSFError>(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<uint32_t>(Data.size()), Blocks};
> + MSFStreamLayout layout() const {
> + return MSFStreamLayout{static_cast<uint32_t>(Data.size()), Blocks};
> }
>
> private:
>
> Modified: llvm/trunk/unittests/DebugInfo/PDB/MsfBuilderTest.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/DebugInfo/PDB/MsfBuilderTest.cpp?rev=277190&r1=277189&r2=277190&view=diff
> ==============================================================================
> --- llvm/trunk/unittests/DebugInfo/PDB/MsfBuilderTest.cpp (original)
> +++ llvm/trunk/unittests/DebugInfo/PDB/MsfBuilderTest.cpp Fri Jul 29 13:24:26 2016
> @@ -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, ValidateSuperBloc
> 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, ValidateSuperBloc
> 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, TestUsedBlocksMar
> // 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, TestUsedBlocksMar
> }
> }
>
> -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, TestAddStreamNoDi
>
> 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, TestAddStreamWith
>
> 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, TestGrowStreamNoB
> 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, TestGrowStreamWit
> 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, TestShrinkStreamN
> 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, TestShrinkStreamW
> 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, TestRejectReusedS
> 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, TestBlockCountsWh
> }
> }
>
> -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<MsfBuilder> ExpectedMsf = MsfBuilder::create(
> +TEST_F(MSFBuilderTest, UseDirectoryBlockHint) {
> + Expected<MSFBuilder> ExpectedMsf = MSFBuilder::create(
> Allocator, 4096, msf::getMinimumBlockCount() + 1, false);
> EXPECT_EXPECTED(ExpectedMsf);
> auto &Msf = *ExpectedMsf;
> @@ -313,7 +313,7 @@ TEST_F(MsfBuilderTest, UseDirectoryBlock
>
> 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, UseDirectoryBlock
> EXPECT_EQ(B + 2, L.StreamMap[0].front());
> }
>
> -TEST_F(MsfBuilderTest, DirectoryBlockHintInsufficient) {
> - Expected<MsfBuilder> ExpectedMsf =
> - MsfBuilder::create(Allocator, 4096, msf::getMinimumBlockCount() + 2);
> +TEST_F(MSFBuilderTest, DirectoryBlockHintInsufficient) {
> + Expected<MSFBuilder> 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, DirectoryBlockHin
>
> 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<MsfBuilder> ExpectedMsf =
> - MsfBuilder::create(Allocator, 4096, msf::getMinimumBlockCount() + 2);
> +TEST_F(MSFBuilderTest, DirectoryBlockHintOverestimated) {
> + Expected<MSFBuilder> ExpectedMsf =
> + MSFBuilder::create(Allocator, 4096, msf::getMinimumBlockCount() + 2);
> EXPECT_EXPECTED(ExpectedMsf);
> auto &Msf = *ExpectedMsf;
>
> @@ -353,7 +353,7 @@ TEST_F(MsfBuilderTest, DirectoryBlockHin
>
> 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]);
> }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
--
Bruno Cardoso Lopes
http://www.brunocardoso.cc
More information about the llvm-commits
mailing list