summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-05-01 16:46:39 +0000
committerZachary Turner <zturner@google.com>2017-05-01 16:46:39 +0000
commit7cc13e557c028b1d6e28880ec26cb1ceccad6b67 (patch)
treed71668b0e7ac6b9ac33d17d88e7e5748368099b4 /llvm/lib/DebugInfo
parent8a6238201f015729a47691c62808a23ec8525096 (diff)
downloadbcm5719-llvm-7cc13e557c028b1d6e28880ec26cb1ceccad6b67.tar.gz
bcm5719-llvm-7cc13e557c028b1d6e28880ec26cb1ceccad6b67.zip
[PDB/CodeView] Rename some classes.
In preparation for introducing writing capabilities for each of these classes, I would like to adopt a Foo / FooRef naming convention, where Foo indicates that the class can manipulate and serialize Foos, and FooRef indicates that it is an immutable view of an existing Foo. In other words, Foo is a writer and FooRef is a reader. This patch names some existing readers to conform to the FooRef convention, while offering no functional change. llvm-svn: 301810
Diffstat (limited to 'llvm/lib/DebugInfo')
-rw-r--r--llvm/lib/DebugInfo/CodeView/ModuleDebugFileChecksumFragment.cpp3
-rw-r--r--llvm/lib/DebugInfo/CodeView/ModuleDebugFragment.cpp2
-rw-r--r--llvm/lib/DebugInfo/CodeView/ModuleDebugFragmentVisitor.cpp6
-rw-r--r--llvm/lib/DebugInfo/CodeView/ModuleDebugLineFragment.cpp10
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp21
5 files changed, 22 insertions, 20 deletions
diff --git a/llvm/lib/DebugInfo/CodeView/ModuleDebugFileChecksumFragment.cpp b/llvm/lib/DebugInfo/CodeView/ModuleDebugFileChecksumFragment.cpp
index 3f234adc1c2..4bbfe285423 100644
--- a/llvm/lib/DebugInfo/CodeView/ModuleDebugFileChecksumFragment.cpp
+++ b/llvm/lib/DebugInfo/CodeView/ModuleDebugFileChecksumFragment.cpp
@@ -41,7 +41,8 @@ Error llvm::VarStreamArrayExtractor<FileChecksumEntry>::extract(
return Error::success();
}
-Error ModuleDebugFileChecksumFragment::initialize(BinaryStreamReader Reader) {
+Error ModuleDebugFileChecksumFragmentRef::initialize(
+ BinaryStreamReader Reader) {
if (auto EC = Reader.readArray(Checksums, Reader.bytesRemaining()))
return EC;
diff --git a/llvm/lib/DebugInfo/CodeView/ModuleDebugFragment.cpp b/llvm/lib/DebugInfo/CodeView/ModuleDebugFragment.cpp
index a3327b06b98..36f86cbbdf6 100644
--- a/llvm/lib/DebugInfo/CodeView/ModuleDebugFragment.cpp
+++ b/llvm/lib/DebugInfo/CodeView/ModuleDebugFragment.cpp
@@ -11,4 +11,4 @@
using namespace llvm::codeview;
-ModuleDebugFragment::~ModuleDebugFragment() {}
+ModuleDebugFragmentRef::~ModuleDebugFragmentRef() {}
diff --git a/llvm/lib/DebugInfo/CodeView/ModuleDebugFragmentVisitor.cpp b/llvm/lib/DebugInfo/CodeView/ModuleDebugFragmentVisitor.cpp
index ce1d8d918b2..b7a86ee6699 100644
--- a/llvm/lib/DebugInfo/CodeView/ModuleDebugFragmentVisitor.cpp
+++ b/llvm/lib/DebugInfo/CodeView/ModuleDebugFragmentVisitor.cpp
@@ -24,21 +24,21 @@ Error llvm::codeview::visitModuleDebugFragment(
BinaryStreamReader Reader(R.getRecordData());
switch (R.kind()) {
case ModuleDebugFragmentKind::Lines: {
- ModuleDebugLineFragment Fragment;
+ ModuleDebugLineFragmentRef Fragment;
if (auto EC = Fragment.initialize(Reader))
return EC;
return V.visitLines(Fragment);
}
case ModuleDebugFragmentKind::FileChecksums: {
- ModuleDebugFileChecksumFragment Fragment;
+ ModuleDebugFileChecksumFragmentRef Fragment;
if (auto EC = Fragment.initialize(Reader))
return EC;
return V.visitFileChecksums(Fragment);
}
default: {
- ModuleDebugUnknownFragment Fragment(R.kind(), R.getRecordData());
+ ModuleDebugUnknownFragmentRef Fragment(R.kind(), R.getRecordData());
return V.visitUnknown(Fragment);
}
}
diff --git a/llvm/lib/DebugInfo/CodeView/ModuleDebugLineFragment.cpp b/llvm/lib/DebugInfo/CodeView/ModuleDebugLineFragment.cpp
index d25be2d02d8..6a9751c1257 100644
--- a/llvm/lib/DebugInfo/CodeView/ModuleDebugLineFragment.cpp
+++ b/llvm/lib/DebugInfo/CodeView/ModuleDebugLineFragment.cpp
@@ -47,10 +47,10 @@ Error LineColumnExtractor::extract(BinaryStreamRef Stream, uint32_t &Len,
return Error::success();
}
-ModuleDebugLineFragment::ModuleDebugLineFragment()
- : ModuleDebugFragment(ModuleDebugFragmentKind::Lines) {}
+ModuleDebugLineFragmentRef::ModuleDebugLineFragmentRef()
+ : ModuleDebugFragmentRef(ModuleDebugFragmentKind::Lines) {}
-Error ModuleDebugLineFragment::initialize(BinaryStreamReader Reader) {
+Error ModuleDebugLineFragmentRef::initialize(BinaryStreamReader Reader) {
if (auto EC = Reader.readObject(Header))
return EC;
@@ -61,6 +61,6 @@ Error ModuleDebugLineFragment::initialize(BinaryStreamReader Reader) {
return Error::success();
}
-bool ModuleDebugLineFragment::hasColumnInfo() const {
- return Header->Flags & LF_HaveColumns;
+bool ModuleDebugLineFragmentRef::hasColumnInfo() const {
+ return !!(Header->Flags & LF_HaveColumns);
}
diff --git a/llvm/lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp b/llvm/lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp
index 5e719c6179a..d7a203746a0 100644
--- a/llvm/lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp
+++ b/llvm/lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp
@@ -25,13 +25,14 @@ using namespace llvm::codeview;
using namespace llvm::msf;
using namespace llvm::pdb;
-ModuleDebugStream::ModuleDebugStream(const DbiModuleDescriptor &Module,
- std::unique_ptr<MappedBlockStream> Stream)
+ModuleDebugStreamRef::ModuleDebugStreamRef(
+ const DbiModuleDescriptor &Module,
+ std::unique_ptr<MappedBlockStream> Stream)
: Mod(Module), Stream(std::move(Stream)) {}
-ModuleDebugStream::~ModuleDebugStream() = default;
+ModuleDebugStreamRef::~ModuleDebugStreamRef() = default;
-Error ModuleDebugStream::reload() {
+Error ModuleDebugStreamRef::reload() {
BinaryStreamReader Reader(*Stream);
uint32_t SymbolSize = Mod.getSymbolDebugInfoByteSize();
@@ -49,7 +50,7 @@ Error ModuleDebugStream::reload() {
if (auto EC = Reader.readArray(SymbolsSubstream, SymbolSize - 4))
return EC;
- if (auto EC = Reader.readStreamRef(LinesSubstream, C11Size))
+ if (auto EC = Reader.readStreamRef(C11LinesSubstream, C11Size))
return EC;
if (auto EC = Reader.readStreamRef(C13LinesSubstream, C13Size))
return EC;
@@ -72,17 +73,17 @@ Error ModuleDebugStream::reload() {
}
iterator_range<codeview::CVSymbolArray::Iterator>
-ModuleDebugStream::symbols(bool *HadError) const {
+ModuleDebugStreamRef::symbols(bool *HadError) const {
return make_range(SymbolsSubstream.begin(HadError), SymbolsSubstream.end());
}
-llvm::iterator_range<ModuleDebugStream::LinesAndChecksumsIterator>
-ModuleDebugStream::linesAndChecksums() const {
+llvm::iterator_range<ModuleDebugStreamRef::LinesAndChecksumsIterator>
+ModuleDebugStreamRef::linesAndChecksums() const {
return make_range(LinesAndChecksums.begin(), LinesAndChecksums.end());
}
-bool ModuleDebugStream::hasLineInfo() const {
+bool ModuleDebugStreamRef::hasLineInfo() const {
return C13LinesSubstream.getLength() > 0;
}
-Error ModuleDebugStream::commit() { return Error::success(); }
+Error ModuleDebugStreamRef::commit() { return Error::success(); }
OpenPOWER on IntegriCloud