mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
[DebugInfo] Fix some Clang-tidy modernize-use-default and Include What You Use warnings; other minor fixes (NFC).
Per Zachary Turner and Mehdi Amini suggestion to make only post-commit reviews. llvm-svn: 287838
This commit is contained in:
parent
a6ebd63f82
commit
290a3cba18
@ -50,7 +50,7 @@ public:
|
||||
private:
|
||||
StringRef ModuleName;
|
||||
StringRef ObjFileName;
|
||||
const ModuleInfoHeader *Layout;
|
||||
const ModuleInfoHeader *Layout = nullptr;
|
||||
};
|
||||
|
||||
struct ModuleInfoEx {
|
||||
|
@ -8,6 +8,8 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/DebugInfo/DWARF/DWARFCompileUnit.h"
|
||||
#include "llvm/DebugInfo/DWARF/DWARFDebugAbbrev.h"
|
||||
#include "llvm/DebugInfo/DWARF/DWARFDebugInfoEntry.h"
|
||||
#include "llvm/Support/Format.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
|
||||
@ -29,5 +31,4 @@ void DWARFCompileUnit::dump(raw_ostream &OS) {
|
||||
}
|
||||
|
||||
// VTable anchor.
|
||||
DWARFCompileUnit::~DWARFCompileUnit() {
|
||||
}
|
||||
DWARFCompileUnit::~DWARFCompileUnit() = default;
|
||||
|
@ -37,11 +37,11 @@ using namespace dwarf;
|
||||
class llvm::FrameEntry {
|
||||
public:
|
||||
enum FrameKind {FK_CIE, FK_FDE};
|
||||
|
||||
FrameEntry(FrameKind K, uint64_t Offset, uint64_t Length)
|
||||
: Kind(K), Offset(Offset), Length(Length) {}
|
||||
|
||||
virtual ~FrameEntry() {
|
||||
}
|
||||
virtual ~FrameEntry() = default;
|
||||
|
||||
FrameKind getKind() const { return Kind; }
|
||||
virtual uint64_t getOffset() const { return Offset; }
|
||||
@ -220,7 +220,7 @@ public:
|
||||
FDEPointerEncoding(FDEPointerEncoding),
|
||||
LSDAPointerEncoding(LSDAPointerEncoding) {}
|
||||
|
||||
~CIE() override {}
|
||||
~CIE() override = default;
|
||||
|
||||
StringRef getAugmentationString() const { return Augmentation; }
|
||||
uint64_t getCodeAlignmentFactor() const { return CodeAlignmentFactor; }
|
||||
@ -294,7 +294,7 @@ public:
|
||||
InitialLocation(InitialLocation), AddressRange(AddressRange),
|
||||
LinkedCIE(Cie) {}
|
||||
|
||||
~FDE() override {}
|
||||
~FDE() override = default;
|
||||
|
||||
CIE *getLinkedCIE() const { return LinkedCIE; }
|
||||
|
||||
@ -468,8 +468,7 @@ void FrameEntry::dumpInstructions(raw_ostream &OS) const {
|
||||
DWARFDebugFrame::DWARFDebugFrame(bool IsEH) : IsEH(IsEH) {
|
||||
}
|
||||
|
||||
DWARFDebugFrame::~DWARFDebugFrame() {
|
||||
}
|
||||
DWARFDebugFrame::~DWARFDebugFrame() = default;
|
||||
|
||||
static void LLVM_ATTRIBUTE_UNUSED dumpDataAux(DataExtractor Data,
|
||||
uint32_t Offset, int Length) {
|
||||
@ -620,10 +619,12 @@ void DWARFDebugFrame::parse(DataExtractor Data) {
|
||||
}
|
||||
}
|
||||
|
||||
auto Cie = make_unique<CIE>(StartOffset, Length, Version,
|
||||
auto Cie = llvm::make_unique<CIE>(StartOffset, Length, Version,
|
||||
AugmentationString, AddressSize,
|
||||
SegmentDescriptorSize, CodeAlignmentFactor,
|
||||
DataAlignmentFactor, ReturnAddressRegister,
|
||||
SegmentDescriptorSize,
|
||||
CodeAlignmentFactor,
|
||||
DataAlignmentFactor,
|
||||
ReturnAddressRegister,
|
||||
AugmentationData, FDEPointerEncoding,
|
||||
LSDAPointerEncoding);
|
||||
CIEs[StartOffset] = Cie.get();
|
||||
|
@ -7,14 +7,25 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/DebugInfo/DWARF/DWARFUnit.h"
|
||||
#include "llvm/ADT/SmallString.h"
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
#include "llvm/ADT/StringRef.h"
|
||||
#include "llvm/DebugInfo/DWARF/DWARFAbbreviationDeclaration.h"
|
||||
#include "llvm/DebugInfo/DWARF/DWARFContext.h"
|
||||
#include "llvm/DebugInfo/DWARF/DWARFFormValue.h"
|
||||
#include "llvm/Support/Dwarf.h"
|
||||
#include "llvm/DebugInfo/DWARF/DWARFDebugAbbrev.h"
|
||||
#include "llvm/DebugInfo/DWARF/DWARFUnit.h"
|
||||
#include "llvm/Object/ObjectFile.h"
|
||||
#include "llvm/Support/Casting.h"
|
||||
#include "llvm/Support/DataExtractor.h"
|
||||
#include "llvm/Support/Path.h"
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
#include <vector>
|
||||
|
||||
namespace llvm {
|
||||
|
||||
using namespace dwarf;
|
||||
|
||||
void DWARFUnitSectionBase::parse(DWARFContext &C, const DWARFSection &Section) {
|
||||
@ -49,8 +60,7 @@ DWARFUnit::DWARFUnit(DWARFContext &DC, const DWARFSection &Section,
|
||||
clear();
|
||||
}
|
||||
|
||||
DWARFUnit::~DWARFUnit() {
|
||||
}
|
||||
DWARFUnit::~DWARFUnit() = default;
|
||||
|
||||
bool DWARFUnit::getAddrOffsetSectionItem(uint32_t Index,
|
||||
uint64_t &Result) const {
|
||||
@ -121,7 +131,7 @@ bool DWARFUnit::extract(DataExtractor debug_info, uint32_t *offset_ptr) {
|
||||
bool DWARFUnit::extractRangeList(uint32_t RangeListOffset,
|
||||
DWARFDebugRangeList &RangeList) const {
|
||||
// Require that compile unit is extracted.
|
||||
assert(DieArray.size() > 0);
|
||||
assert(!DieArray.empty());
|
||||
DataExtractor RangesData(RangeSection, isLittleEndian, AddrSize);
|
||||
uint32_t ActualRangeListOffset = RangeSectionBase + RangeListOffset;
|
||||
return RangeList.extract(RangesData, &ActualRangeListOffset);
|
||||
@ -238,11 +248,11 @@ void DWARFUnit::extractDIEsToVector(
|
||||
}
|
||||
|
||||
size_t DWARFUnit::extractDIEsIfNeeded(bool CUDieOnly) {
|
||||
if ((CUDieOnly && DieArray.size() > 0) ||
|
||||
if ((CUDieOnly && !DieArray.empty()) ||
|
||||
DieArray.size() > 1)
|
||||
return 0; // Already parsed.
|
||||
|
||||
bool HasCUDie = DieArray.size() > 0;
|
||||
bool HasCUDie = !DieArray.empty();
|
||||
extractDIEsToVector(!HasCUDie, !CUDieOnly, DieArray);
|
||||
|
||||
if (DieArray.empty())
|
||||
@ -268,7 +278,7 @@ size_t DWARFUnit::extractDIEsIfNeeded(bool CUDieOnly) {
|
||||
}
|
||||
|
||||
DWARFUnit::DWOHolder::DWOHolder(StringRef DWOPath)
|
||||
: DWOFile(), DWOContext(), DWOU(nullptr) {
|
||||
: DWOU(nullptr) {
|
||||
auto Obj = object::ObjectFile::createObjectFile(DWOPath);
|
||||
if (!Obj) {
|
||||
// TODO: Actually report errors helpfully.
|
||||
@ -404,4 +414,5 @@ const DWARFUnitIndex &getDWARFUnitIndex(DWARFContext &Context,
|
||||
assert(Kind == DW_SECT_TYPES);
|
||||
return Context.getTUIndex();
|
||||
}
|
||||
}
|
||||
|
||||
} // end namespace llvm
|
||||
|
@ -1,4 +1,4 @@
|
||||
//===- IPDBSourceFile.cpp - base interface for a PDB source file *- C++ -*-===//
|
||||
//===- IPDBSourceFile.cpp - base interface for a PDB source file ----------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
@ -8,15 +8,17 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/DebugInfo/PDB/IPDBSourceFile.h"
|
||||
|
||||
#include "llvm/DebugInfo/PDB/PDBExtras.h"
|
||||
#include "llvm/DebugInfo/PDB/PDBTypes.h"
|
||||
#include "llvm/Support/Format.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
using namespace llvm;
|
||||
using namespace llvm::pdb;
|
||||
|
||||
IPDBSourceFile::~IPDBSourceFile() {}
|
||||
IPDBSourceFile::~IPDBSourceFile() = default;
|
||||
|
||||
void IPDBSourceFile::dump(raw_ostream &OS, int Indent) const {
|
||||
OS.indent(Indent);
|
||||
|
@ -15,15 +15,14 @@
|
||||
#include "llvm/DebugInfo/PDB/IPDBLineNumber.h"
|
||||
#include "llvm/DebugInfo/PDB/IPDBRawSymbol.h"
|
||||
#include "llvm/DebugInfo/PDB/IPDBSession.h"
|
||||
#include "llvm/DebugInfo/PDB/IPDBRawSymbol.h"
|
||||
|
||||
using namespace llvm;
|
||||
using namespace llvm::pdb;
|
||||
|
||||
IPDBSession::~IPDBSession() {}
|
||||
IPDBSession::~IPDBSession() = default;
|
||||
|
||||
IPDBDataStream::~IPDBDataStream() {}
|
||||
IPDBDataStream::~IPDBDataStream() = default;
|
||||
|
||||
IPDBRawSymbol::~IPDBRawSymbol() {}
|
||||
IPDBRawSymbol::~IPDBRawSymbol() = default;
|
||||
|
||||
IPDBLineNumber::~IPDBLineNumber() {}
|
||||
IPDBLineNumber::~IPDBLineNumber() = default;
|
||||
|
@ -20,7 +20,7 @@ using namespace llvm::pdb;
|
||||
PDBSymDumper::PDBSymDumper(bool ShouldRequireImpl)
|
||||
: RequireImpl(ShouldRequireImpl) {}
|
||||
|
||||
PDBSymDumper::~PDBSymDumper() {}
|
||||
PDBSymDumper::~PDBSymDumper() = default;
|
||||
|
||||
void PDBSymDumper::dump(const PDBSymbolAnnotation &Symbol) {
|
||||
PDB_SYMDUMP_UNREACHABLE(PDBSymbolAnnotation)
|
||||
|
@ -8,9 +8,9 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/DebugInfo/PDB/PDBSymbol.h"
|
||||
|
||||
#include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
|
||||
#include "llvm/DebugInfo/PDB/IPDBRawSymbol.h"
|
||||
#include "llvm/DebugInfo/PDB/PDBExtras.h"
|
||||
#include "llvm/DebugInfo/PDB/PDBSymbolAnnotation.h"
|
||||
#include "llvm/DebugInfo/PDB/PDBSymbolBlock.h"
|
||||
#include "llvm/DebugInfo/PDB/PDBSymbolCompiland.h"
|
||||
@ -42,12 +42,9 @@
|
||||
#include "llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h"
|
||||
#include "llvm/DebugInfo/PDB/PDBSymbolUnknown.h"
|
||||
#include "llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h"
|
||||
#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
|
||||
#include "llvm/DebugInfo/PDB/PDBTypes.h"
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
using namespace llvm;
|
||||
using namespace llvm::pdb;
|
||||
@ -56,7 +53,7 @@ PDBSymbol::PDBSymbol(const IPDBSession &PDBSession,
|
||||
std::unique_ptr<IPDBRawSymbol> Symbol)
|
||||
: Session(PDBSession), RawSymbol(std::move(Symbol)) {}
|
||||
|
||||
PDBSymbol::~PDBSymbol() {}
|
||||
PDBSymbol::~PDBSymbol() = default;
|
||||
|
||||
#define FACTORY_SYMTAG_CASE(Tag, Type) \
|
||||
case PDB_SymType::Tag: \
|
||||
|
@ -7,11 +7,12 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/DebugInfo/PDB/Raw/DbiStream.h"
|
||||
|
||||
#include "llvm/ADT/StringRef.h"
|
||||
#include "llvm/DebugInfo/MSF/MappedBlockStream.h"
|
||||
#include "llvm/DebugInfo/MSF/StreamArray.h"
|
||||
#include "llvm/DebugInfo/MSF/StreamReader.h"
|
||||
#include "llvm/DebugInfo/MSF/StreamWriter.h"
|
||||
#include "llvm/DebugInfo/PDB/PDBTypes.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/DbiStream.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/ISectionContribVisitor.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/InfoStream.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/ModInfo.h"
|
||||
@ -21,6 +22,10 @@
|
||||
#include "llvm/DebugInfo/PDB/Raw/RawError.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/RawTypes.h"
|
||||
#include "llvm/Object/COFF.h"
|
||||
#include "llvm/Support/Error.h"
|
||||
#include <algorithm>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
|
||||
using namespace llvm;
|
||||
using namespace llvm::codeview;
|
||||
@ -46,7 +51,7 @@ DbiStream::DbiStream(PDBFile &File, std::unique_ptr<MappedBlockStream> Stream)
|
||||
: Pdb(File), Stream(std::move(Stream)), Header(nullptr) {
|
||||
}
|
||||
|
||||
DbiStream::~DbiStream() {}
|
||||
DbiStream::~DbiStream() = default;
|
||||
|
||||
Error DbiStream::reload() {
|
||||
StreamReader Reader(*Stream);
|
||||
@ -217,7 +222,7 @@ msf::FixedStreamArray<SecMapEntry> DbiStream::getSectionMap() const {
|
||||
return SectionMap;
|
||||
}
|
||||
|
||||
void llvm::pdb::DbiStream::visitSectionContributions(
|
||||
void DbiStream::visitSectionContributions(
|
||||
ISectionContribVisitor &Visitor) const {
|
||||
if (SectionContribVersion == DbiSecContribVer60) {
|
||||
for (auto &SC : SectionContribs)
|
||||
|
@ -7,15 +7,11 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/DebugInfo/PDB/Raw/GlobalsStream.h"
|
||||
|
||||
#include "GSI.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/PDBFile.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/RawError.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/RawTypes.h"
|
||||
|
||||
#include "llvm/Support/Endian.h"
|
||||
#include "llvm/DebugInfo/MSF/StreamReader.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/GlobalsStream.h"
|
||||
#include "llvm/Support/Error.h"
|
||||
#include <algorithm>
|
||||
|
||||
using namespace llvm;
|
||||
using namespace llvm::msf;
|
||||
@ -24,7 +20,7 @@ using namespace llvm::pdb;
|
||||
GlobalsStream::GlobalsStream(std::unique_ptr<MappedBlockStream> Stream)
|
||||
: Stream(std::move(Stream)) {}
|
||||
|
||||
GlobalsStream::~GlobalsStream() {}
|
||||
GlobalsStream::~GlobalsStream() = default;
|
||||
|
||||
Error GlobalsStream::reload() {
|
||||
StreamReader Reader(*Stream);
|
||||
|
@ -7,25 +7,24 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/DebugInfo/PDB/Raw/ModInfo.h"
|
||||
|
||||
#include "llvm/DebugInfo/MSF/StreamReader.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/PDBFile.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/ModInfo.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/RawTypes.h"
|
||||
#include "llvm/Support/Endian.h"
|
||||
#include "llvm/Support/Error.h"
|
||||
#include "llvm/Support/MathExtras.h"
|
||||
#include <cstdint>
|
||||
|
||||
using namespace llvm;
|
||||
using namespace llvm::msf;
|
||||
using namespace llvm::pdb;
|
||||
using namespace llvm::support;
|
||||
|
||||
ModInfo::ModInfo() = default;
|
||||
|
||||
ModInfo::ModInfo() : Layout(nullptr) {}
|
||||
ModInfo::ModInfo(const ModInfo &Info) = default;
|
||||
|
||||
ModInfo::ModInfo(const ModInfo &Info)
|
||||
: ModuleName(Info.ModuleName), ObjFileName(Info.ObjFileName),
|
||||
Layout(Info.Layout) {}
|
||||
|
||||
ModInfo::~ModInfo() {}
|
||||
ModInfo::~ModInfo() = default;
|
||||
|
||||
Error ModInfo::initialize(ReadableStreamRef Stream, ModInfo &Info) {
|
||||
StreamReader Reader(Stream);
|
||||
@ -77,6 +76,6 @@ uint32_t ModInfo::getRecordLength() const {
|
||||
uint32_t M = ModuleName.str().size() + 1;
|
||||
uint32_t O = ObjFileName.str().size() + 1;
|
||||
uint32_t Size = sizeof(ModuleInfoHeader) + M + O;
|
||||
Size = llvm::alignTo(Size, 4);
|
||||
Size = alignTo(Size, 4);
|
||||
return Size;
|
||||
}
|
||||
|
@ -7,13 +7,18 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/DebugInfo/PDB/Raw/ModStream.h"
|
||||
|
||||
#include "llvm/ADT/iterator_range.h"
|
||||
#include "llvm/DebugInfo/CodeView/SymbolRecord.h"
|
||||
#include "llvm/DebugInfo/MSF/StreamReader.h"
|
||||
#include "llvm/DebugInfo/MSF/StreamRef.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/ModInfo.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/ModStream.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/PDBFile.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/RawError.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/RawTypes.h"
|
||||
#include "llvm/Support/Error.h"
|
||||
#include <algorithm>
|
||||
#include <cstdint>
|
||||
|
||||
using namespace llvm;
|
||||
using namespace llvm::msf;
|
||||
@ -23,7 +28,7 @@ ModStream::ModStream(const ModInfo &Module,
|
||||
std::unique_ptr<MappedBlockStream> Stream)
|
||||
: Mod(Module), Stream(std::move(Stream)) {}
|
||||
|
||||
ModStream::~ModStream() {}
|
||||
ModStream::~ModStream() = default;
|
||||
|
||||
Error ModStream::reload() {
|
||||
StreamReader Reader(*Stream);
|
||||
@ -33,7 +38,7 @@ Error ModStream::reload() {
|
||||
uint32_t C13Size = Mod.getC13LineInfoByteSize();
|
||||
|
||||
if (C11Size > 0 && C13Size > 0)
|
||||
return llvm::make_error<RawError>(raw_error_code::corrupt_file,
|
||||
return make_error<RawError>(raw_error_code::corrupt_file,
|
||||
"Module has both C11 and C13 line info");
|
||||
|
||||
ReadableStreamRef S;
|
||||
@ -58,7 +63,7 @@ Error ModStream::reload() {
|
||||
if (auto EC = Reader.readStreamRef(GlobalRefsSubstream, GlobalRefsSize))
|
||||
return EC;
|
||||
if (Reader.bytesRemaining() > 0)
|
||||
return llvm::make_error<RawError>(raw_error_code::corrupt_file,
|
||||
return make_error<RawError>(raw_error_code::corrupt_file,
|
||||
"Unexpected bytes in module stream.");
|
||||
|
||||
return Error::success();
|
||||
@ -68,14 +73,13 @@ iterator_range<codeview::CVSymbolArray::Iterator>
|
||||
ModStream::symbols(bool *HadError) const {
|
||||
// It's OK if the stream is empty.
|
||||
if (SymbolsSubstream.getUnderlyingStream().getLength() == 0)
|
||||
return llvm::make_range(SymbolsSubstream.end(), SymbolsSubstream.end());
|
||||
return llvm::make_range(SymbolsSubstream.begin(HadError),
|
||||
SymbolsSubstream.end());
|
||||
return make_range(SymbolsSubstream.end(), SymbolsSubstream.end());
|
||||
return make_range(SymbolsSubstream.begin(HadError), SymbolsSubstream.end());
|
||||
}
|
||||
|
||||
iterator_range<codeview::ModuleSubstreamArray::Iterator>
|
||||
ModStream::lines(bool *HadError) const {
|
||||
return llvm::make_range(LineInfo.begin(HadError), LineInfo.end());
|
||||
return make_range(LineInfo.begin(HadError), LineInfo.end());
|
||||
}
|
||||
|
||||
Error ModStream::commit() { return Error::success(); }
|
||||
|
@ -7,20 +7,24 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/DebugInfo/PDB/Raw/NameMap.h"
|
||||
#include "llvm/ADT/SparseBitVector.h"
|
||||
#include "llvm/ADT/StringMap.h"
|
||||
#include "llvm/ADT/StringRef.h"
|
||||
#include "llvm/ADT/iterator_range.h"
|
||||
#include "llvm/DebugInfo/MSF/StreamReader.h"
|
||||
#include "llvm/DebugInfo/MSF/StreamWriter.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/NameMap.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/RawError.h"
|
||||
#include "llvm/Support/Error.h"
|
||||
#include <algorithm>
|
||||
#include <cstdint>
|
||||
|
||||
using namespace llvm;
|
||||
using namespace llvm::msf;
|
||||
using namespace llvm::pdb;
|
||||
|
||||
NameMap::NameMap() {}
|
||||
NameMap::NameMap() = default;
|
||||
|
||||
Error NameMap::load(StreamReader &Stream) {
|
||||
|
||||
// This is some sort of weird string-set/hash table encoded in the stream.
|
||||
// It starts with the number of bytes in the table.
|
||||
uint32_t NumberOfBytes;
|
||||
@ -146,7 +150,7 @@ Error NameMap::load(StreamReader &Stream) {
|
||||
}
|
||||
|
||||
iterator_range<StringMapConstIterator<uint32_t>> NameMap::entries() const {
|
||||
return llvm::make_range<StringMapConstIterator<uint32_t>>(Mapping.begin(),
|
||||
return make_range<StringMapConstIterator<uint32_t>>(Mapping.begin(),
|
||||
Mapping.end());
|
||||
}
|
||||
|
||||
|
@ -7,16 +7,19 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/DebugInfo/PDB/Raw/NameMapBuilder.h"
|
||||
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
#include "llvm/DebugInfo/MSF/StreamWriter.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/NameMap.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/NameMapBuilder.h"
|
||||
#include "llvm/Support/Endian.h"
|
||||
#include "llvm/Support/Error.h"
|
||||
#include <algorithm>
|
||||
#include <cstdint>
|
||||
|
||||
using namespace llvm;
|
||||
using namespace llvm::pdb;
|
||||
|
||||
NameMapBuilder::NameMapBuilder() {}
|
||||
NameMapBuilder::NameMapBuilder() = default;
|
||||
|
||||
void NameMapBuilder::addMapping(StringRef Name, uint32_t Mapping) {
|
||||
StringDataBytes += Name.size() + 1;
|
||||
|
@ -7,24 +7,27 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/DebugInfo/PDB/Raw/PDBFile.h"
|
||||
|
||||
#include "llvm/ADT/ArrayRef.h"
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
#include "llvm/DebugInfo/MSF/MappedBlockStream.h"
|
||||
#include "llvm/DebugInfo/MSF/MSFCommon.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/GlobalsStream.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/InfoStream.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/NameHashTable.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/PDBFile.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/PublicsStream.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/RawError.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/SymbolStream.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/TpiStream.h"
|
||||
#include "llvm/Support/Endian.h"
|
||||
#include "llvm/Support/FileOutputBuffer.h"
|
||||
#include "llvm/Support/MemoryBuffer.h"
|
||||
#include "llvm/Support/Error.h"
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
|
||||
using namespace llvm;
|
||||
using namespace llvm::codeview;
|
||||
@ -33,13 +36,13 @@ using namespace llvm::pdb;
|
||||
|
||||
namespace {
|
||||
typedef FixedStreamArray<support::ulittle32_t> ulittle_array;
|
||||
}
|
||||
} // end anonymous namespace
|
||||
|
||||
PDBFile::PDBFile(std::unique_ptr<ReadableStream> PdbFileBuffer,
|
||||
BumpPtrAllocator &Allocator)
|
||||
: Allocator(Allocator), Buffer(std::move(PdbFileBuffer)) {}
|
||||
|
||||
PDBFile::~PDBFile() {}
|
||||
PDBFile::~PDBFile() = default;
|
||||
|
||||
uint32_t PDBFile::getBlockSize() const { return ContainerLayout.SB->BlockSize; }
|
||||
|
||||
@ -214,7 +217,7 @@ Error PDBFile::parseStreamData() {
|
||||
return Error::success();
|
||||
}
|
||||
|
||||
llvm::ArrayRef<support::ulittle32_t> PDBFile::getDirectoryBlockArray() const {
|
||||
ArrayRef<support::ulittle32_t> PDBFile::getDirectoryBlockArray() const {
|
||||
return ContainerLayout.DirectoryBlocks;
|
||||
}
|
||||
|
||||
|
@ -22,29 +22,25 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/DebugInfo/PDB/Raw/PublicsStream.h"
|
||||
|
||||
#include "GSI.h"
|
||||
#include "llvm/DebugInfo/CodeView/CodeView.h"
|
||||
#include "llvm/DebugInfo/CodeView/TypeRecord.h"
|
||||
#include "llvm/ADT/iterator_range.h"
|
||||
#include "llvm/DebugInfo/CodeView/SymbolRecord.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/PublicsStream.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/RawError.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/SymbolStream.h"
|
||||
|
||||
#include "llvm/ADT/BitVector.h"
|
||||
#include "llvm/Support/Endian.h"
|
||||
#include "llvm/Support/Format.h"
|
||||
#include "llvm/Support/MathExtras.h"
|
||||
#include "llvm/Support/Error.h"
|
||||
#include <algorithm>
|
||||
#include <cstdint>
|
||||
|
||||
using namespace llvm;
|
||||
using namespace llvm::msf;
|
||||
using namespace llvm::support;
|
||||
using namespace llvm::pdb;
|
||||
|
||||
|
||||
// This is PSGSIHDR struct defined in
|
||||
// https://github.com/Microsoft/microsoft-pdb/blob/master/PDB/dbi/gsi.h
|
||||
struct PublicsStream::HeaderInfo {
|
||||
@ -62,7 +58,7 @@ PublicsStream::PublicsStream(PDBFile &File,
|
||||
std::unique_ptr<MappedBlockStream> Stream)
|
||||
: Pdb(File), Stream(std::move(Stream)) {}
|
||||
|
||||
PublicsStream::~PublicsStream() {}
|
||||
PublicsStream::~PublicsStream() = default;
|
||||
|
||||
uint32_t PublicsStream::getSymHash() const { return Header->SymHash; }
|
||||
uint32_t PublicsStream::getAddrMap() const { return Header->AddrMap; }
|
||||
@ -125,7 +121,7 @@ PublicsStream::getSymbols(bool *HadError) const {
|
||||
auto SymbolS = Pdb.getPDBSymbolStream();
|
||||
if (SymbolS.takeError()) {
|
||||
codeview::CVSymbolArray::Iterator Iter;
|
||||
return llvm::make_range(Iter, Iter);
|
||||
return make_range(Iter, Iter);
|
||||
}
|
||||
SymbolStream &SS = SymbolS.get();
|
||||
|
||||
|
@ -7,10 +7,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/DebugInfo/PDB/Raw/RawSession.h"
|
||||
|
||||
#include "llvm/ADT/STLExtras.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"
|
||||
@ -18,9 +16,13 @@
|
||||
#include "llvm/DebugInfo/PDB/PDBSymbolExe.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/PDBFile.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/RawError.h"
|
||||
|
||||
#include "llvm/DebugInfo/PDB/Raw/RawSession.h"
|
||||
#include "llvm/Support/Allocator.h"
|
||||
#include "llvm/Support/Error.h"
|
||||
#include "llvm/Support/ErrorOr.h"
|
||||
#include "llvm/Support/MemoryBuffer.h"
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
|
||||
using namespace llvm;
|
||||
using namespace llvm::msf;
|
||||
@ -30,16 +32,15 @@ RawSession::RawSession(std::unique_ptr<PDBFile> PdbFile,
|
||||
std::unique_ptr<BumpPtrAllocator> Allocator)
|
||||
: Pdb(std::move(PdbFile)), Allocator(std::move(Allocator)) {}
|
||||
|
||||
RawSession::~RawSession() {}
|
||||
RawSession::~RawSession() = default;
|
||||
|
||||
Error RawSession::createFromPdb(StringRef Path,
|
||||
std::unique_ptr<IPDBSession> &Session) {
|
||||
|
||||
ErrorOr<std::unique_ptr<MemoryBuffer>> ErrorOrBuffer =
|
||||
MemoryBuffer::getFileOrSTDIN(Path, /*FileSize=*/-1,
|
||||
/*RequiresNullTerminator=*/false);
|
||||
if (!ErrorOrBuffer)
|
||||
return llvm::make_error<GenericError>(generic_error_code::invalid_path);
|
||||
return make_error<GenericError>(generic_error_code::invalid_path);
|
||||
|
||||
std::unique_ptr<MemoryBuffer> Buffer = std::move(*ErrorOrBuffer);
|
||||
auto Stream = llvm::make_unique<MemoryBufferByteStream>(std::move(Buffer));
|
||||
@ -59,7 +60,7 @@ Error RawSession::createFromPdb(StringRef Path,
|
||||
|
||||
Error RawSession::createFromExe(StringRef Path,
|
||||
std::unique_ptr<IPDBSession> &Session) {
|
||||
return llvm::make_error<RawError>(raw_error_code::feature_unsupported);
|
||||
return make_error<RawError>(raw_error_code::feature_unsupported);
|
||||
}
|
||||
|
||||
uint64_t RawSession::getLoadAddress() const { return 0; }
|
||||
@ -92,26 +93,26 @@ RawSession::findLineNumbersByAddress(uint64_t Address, uint32_t Length) const {
|
||||
|
||||
std::unique_ptr<IPDBEnumSourceFiles>
|
||||
RawSession::findSourceFiles(const PDBSymbolCompiland *Compiland,
|
||||
llvm::StringRef Pattern,
|
||||
StringRef Pattern,
|
||||
PDB_NameSearchFlags Flags) const {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::unique_ptr<IPDBSourceFile>
|
||||
RawSession::findOneSourceFile(const PDBSymbolCompiland *Compiland,
|
||||
llvm::StringRef Pattern,
|
||||
StringRef Pattern,
|
||||
PDB_NameSearchFlags Flags) const {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::unique_ptr<IPDBEnumChildren<PDBSymbolCompiland>>
|
||||
RawSession::findCompilandsForSourceFile(llvm::StringRef Pattern,
|
||||
RawSession::findCompilandsForSourceFile(StringRef Pattern,
|
||||
PDB_NameSearchFlags Flags) const {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::unique_ptr<PDBSymbolCompiland>
|
||||
RawSession::findOneCompilandForSourceFile(llvm::StringRef Pattern,
|
||||
RawSession::findOneCompilandForSourceFile(StringRef Pattern,
|
||||
PDB_NameSearchFlags Flags) const {
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -7,12 +7,9 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/DebugInfo/PDB/Raw/TpiStream.h"
|
||||
|
||||
#include "llvm/ADT/iterator_range.h"
|
||||
#include "llvm/DebugInfo/CodeView/CVTypeVisitor.h"
|
||||
#include "llvm/DebugInfo/CodeView/CodeView.h"
|
||||
#include "llvm/DebugInfo/CodeView/TypeDeserializer.h"
|
||||
#include "llvm/DebugInfo/CodeView/TypeIndex.h"
|
||||
#include "llvm/DebugInfo/CodeView/TypeRecord.h"
|
||||
#include "llvm/DebugInfo/CodeView/TypeVisitorCallbackPipeline.h"
|
||||
#include "llvm/DebugInfo/MSF/MappedBlockStream.h"
|
||||
@ -22,8 +19,12 @@
|
||||
#include "llvm/DebugInfo/PDB/Raw/RawError.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/RawTypes.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/TpiHashing.h"
|
||||
|
||||
#include "llvm/DebugInfo/PDB/Raw/TpiStream.h"
|
||||
#include "llvm/Support/Endian.h"
|
||||
#include "llvm/Support/Error.h"
|
||||
#include <algorithm>
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
|
||||
using namespace llvm;
|
||||
using namespace llvm::codeview;
|
||||
@ -35,7 +36,7 @@ TpiStream::TpiStream(const PDBFile &File,
|
||||
std::unique_ptr<MappedBlockStream> Stream)
|
||||
: Pdb(File), Stream(std::move(Stream)) {}
|
||||
|
||||
TpiStream::~TpiStream() {}
|
||||
TpiStream::~TpiStream() = default;
|
||||
|
||||
// Verifies that a given type record matches with a given hash value.
|
||||
// Currently we only verify SRC_LINE records.
|
||||
@ -170,7 +171,7 @@ TpiStream::getHashAdjustments() const {
|
||||
|
||||
iterator_range<CVTypeArray::Iterator>
|
||||
TpiStream::types(bool *HadError) const {
|
||||
return llvm::make_range(TypeRecords.begin(HadError), TypeRecords.end());
|
||||
return make_range(TypeRecords.begin(HadError), TypeRecords.end());
|
||||
}
|
||||
|
||||
Error TpiStream::commit() { return Error::success(); }
|
||||
|
@ -1,14 +1,32 @@
|
||||
#include "llvm/DebugInfo/PDB/Raw/TpiStreamBuilder.h"
|
||||
//===- TpiStreamBuilder.cpp - -------------------------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/ADT/ArrayRef.h"
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
#include "llvm/DebugInfo/CodeView/TypeIndex.h"
|
||||
#include "llvm/DebugInfo/CodeView/TypeRecord.h"
|
||||
#include "llvm/DebugInfo/MSF/ByteStream.h"
|
||||
#include "llvm/DebugInfo/MSF/MSFBuilder.h"
|
||||
#include "llvm/DebugInfo/MSF/MappedBlockStream.h"
|
||||
#include "llvm/DebugInfo/MSF/StreamArray.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/RawError.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/RawTypes.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/TpiStream.h"
|
||||
#include "llvm/DebugInfo/PDB/Raw/TpiStreamBuilder.h"
|
||||
#include "llvm/Support/Allocator.h"
|
||||
#include "llvm/Support/Endian.h"
|
||||
#include "llvm/Support/Error.h"
|
||||
#include <algorithm>
|
||||
#include <cstdint>
|
||||
|
||||
using namespace llvm;
|
||||
using namespace llvm::msf;
|
||||
@ -19,7 +37,7 @@ TpiStreamBuilder::TpiStreamBuilder(MSFBuilder &Msf, uint32_t StreamIdx)
|
||||
: Msf(Msf), Allocator(Msf.getAllocator()), Header(nullptr), Idx(StreamIdx) {
|
||||
}
|
||||
|
||||
TpiStreamBuilder::~TpiStreamBuilder() {}
|
||||
TpiStreamBuilder::~TpiStreamBuilder() = default;
|
||||
|
||||
void TpiStreamBuilder::setVersionHeader(PdbRaw_TpiVer Version) {
|
||||
VerHeader = Version;
|
||||
|
Loading…
x
Reference in New Issue
Block a user