diff options
| author | Zachary Turner <zturner@google.com> | 2017-02-27 22:11:43 +0000 |
|---|---|---|
| committer | Zachary Turner <zturner@google.com> | 2017-02-27 22:11:43 +0000 |
| commit | 120faca41bddd3a5922bdefbeb7c68908fda9ab9 (patch) | |
| tree | e3c36b67c61a5021ed8847241cfaf9c59b48309a /llvm/tools/llvm-readobj | |
| parent | 4a7cc16e89b68d48335e7cd19837c3e67e12afb2 (diff) | |
| download | bcm5719-llvm-120faca41bddd3a5922bdefbeb7c68908fda9ab9.tar.gz bcm5719-llvm-120faca41bddd3a5922bdefbeb7c68908fda9ab9.zip | |
[PDB] Partial resubmit of r296215, which improved PDB Stream Library.
This was reverted because it was breaking some builds, and
because of incorrect error code usage. Since the CL was
large and contained many different things, I'm resubmitting
it in pieces.
This portion is NFC, and consists of:
1) Renaming classes to follow a consistent naming convention.
2) Fixing the const-ness of the interface methods.
3) Adding detailed doxygen comments.
4) Fixing a few instances of passing `const BinaryStream& X`. These
are now passed as `BinaryStreamRef X`.
llvm-svn: 296394
Diffstat (limited to 'llvm/tools/llvm-readobj')
| -rw-r--r-- | llvm/tools/llvm-readobj/COFFDumper.cpp | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/llvm/tools/llvm-readobj/COFFDumper.cpp b/llvm/tools/llvm-readobj/COFFDumper.cpp index 329768fcaa6..aef9ea530b6 100644 --- a/llvm/tools/llvm-readobj/COFFDumper.cpp +++ b/llvm/tools/llvm-readobj/COFFDumper.cpp @@ -56,7 +56,6 @@ using namespace llvm; using namespace llvm::object; using namespace llvm::codeview; -using namespace llvm::msf; using namespace llvm::support; using namespace llvm::Win64EH; @@ -155,7 +154,7 @@ public: Sec = Obj->getCOFFSection(SR); } - uint32_t getRecordOffset(msf::StreamReader Reader) override { + uint32_t getRecordOffset(BinaryStreamReader Reader) override { ArrayRef<uint8_t> Data; if (auto EC = Reader.readLongestContiguousChunk(Data)) { llvm::consumeError(std::move(EC)); @@ -841,8 +840,8 @@ void COFFDumper::printCodeViewSymbolSection(StringRef SectionName, } case ModuleSubstreamKind::FrameData: { // First four bytes is a relocation against the function. - msf::ByteStream S(Contents); - msf::StreamReader SR(S); + BinaryByteStream S(Contents); + BinaryStreamReader SR(S); const uint32_t *CodePtr; error(SR.readObject(CodePtr)); StringRef LinkageName; @@ -966,9 +965,9 @@ void COFFDumper::printCodeViewSymbolsSubsection(StringRef Subsection, CVSymbolDumper CVSD(W, TypeDB, std::move(CODD), opts::CodeViewSubsectionBytes); - ByteStream Stream(BinaryData); + BinaryByteStream Stream(BinaryData); CVSymbolArray Symbols; - StreamReader Reader(Stream); + BinaryStreamReader Reader(Stream); if (auto EC = Reader.readArray(Symbols, Reader.getLength())) { consumeError(std::move(EC)); W.flush(); @@ -983,8 +982,8 @@ void COFFDumper::printCodeViewSymbolsSubsection(StringRef Subsection, } void COFFDumper::printCodeViewFileChecksums(StringRef Subsection) { - msf::ByteStream S(Subsection); - msf::StreamReader SR(S); + BinaryByteStream S(Subsection); + BinaryStreamReader SR(S); while (!SR.empty()) { DictScope S(W, "FileChecksum"); const FileChecksum *FC; @@ -1012,8 +1011,8 @@ void COFFDumper::printCodeViewFileChecksums(StringRef Subsection) { } void COFFDumper::printCodeViewInlineeLines(StringRef Subsection) { - msf::ByteStream S(Subsection); - msf::StreamReader SR(S); + BinaryByteStream S(Subsection); + BinaryStreamReader SR(S); uint32_t Signature; error(SR.readInteger(Signature, llvm::support::little)); bool HasExtraFiles = Signature == unsigned(InlineeLinesSignature::ExtraFiles); @@ -1078,9 +1077,9 @@ void COFFDumper::mergeCodeViewTypes(TypeTableBuilder &CVTypes) { error(object_error::parse_failed); ArrayRef<uint8_t> Bytes(reinterpret_cast<const uint8_t *>(Data.data()), Data.size()); - ByteStream Stream(Bytes); + BinaryByteStream Stream(Bytes); CVTypeArray Types; - StreamReader Reader(Stream); + BinaryStreamReader Reader(Stream); if (auto EC = Reader.readArray(Types, Reader.getLength())) { consumeError(std::move(EC)); W.flush(); |

