[llvm] r277190 - [msf] Rename Msf to MSF.
Zachary Turner via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 29 12:19:03 PDT 2016
This is already reverted. I will take a look and resubmit.
On Fri, Jul 29, 2016 at 11:47 AM Bruno Cardoso Lopes <
bruno.cardoso at gmail.com> wrote:
> 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"
> > -
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160729/f414ad3d/attachment.html>
More information about the llvm-commits
mailing list