From: Eugene Zelenko Date: Fri, 18 Nov 2016 18:00:19 +0000 (+0000) Subject: [DebugInfo] Fix some Clang-tidy modernize-use-default, modernize-use-equal-delete... X-Git-Tag: llvmorg-4.0.0-rc1~4180 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=23d071ef87a0f442dcba49e37aa1d103eaa78c16;p=platform%2Fupstream%2Fllvm.git [DebugInfo] Fix some Clang-tidy modernize-use-default, modernize-use-equal-delete 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: 287355 --- diff --git a/llvm/include/llvm/DebugInfo/CodeView/TypeTableBuilder.h b/llvm/include/llvm/DebugInfo/CodeView/TypeTableBuilder.h index 0217866..4e6d81e 100644 --- a/llvm/include/llvm/DebugInfo/CodeView/TypeTableBuilder.h +++ b/llvm/include/llvm/DebugInfo/CodeView/TypeTableBuilder.h @@ -10,22 +10,26 @@ #ifndef LLVM_DEBUGINFO_CODEVIEW_TYPETABLEBUILDER_H #define LLVM_DEBUGINFO_CODEVIEW_TYPETABLEBUILDER_H +#include "llvm/ADT/ArrayRef.h" +#include "llvm/DebugInfo/CodeView/CodeView.h" +#include "llvm/DebugInfo/CodeView/TypeIndex.h" #include "llvm/DebugInfo/CodeView/TypeSerializer.h" +#include "llvm/DebugInfo/CodeView/TypeRecord.h" #include "llvm/Support/Allocator.h" #include "llvm/Support/Error.h" +#include +#include +#include +#include namespace llvm { - namespace codeview { class TypeTableBuilder { private: - TypeTableBuilder(const TypeTableBuilder &) = delete; - TypeTableBuilder &operator=(const TypeTableBuilder &) = delete; - - TypeIndex handleError(llvm::Error EC) const { + TypeIndex handleError(Error EC) const { assert(false && "Couldn't write Type!"); - llvm::consumeError(std::move(EC)); + consumeError(std::move(EC)); return TypeIndex(); } @@ -35,6 +39,8 @@ private: public: explicit TypeTableBuilder(BumpPtrAllocator &Allocator) : Allocator(Allocator), Serializer(Allocator) {} + TypeTableBuilder(const TypeTableBuilder &) = delete; + TypeTableBuilder &operator=(const TypeTableBuilder &) = delete; bool empty() const { return Serializer.records().empty(); } @@ -116,7 +122,8 @@ public: return Index; } }; -} -} -#endif +} // end namespace codeview +} // end namespace llvm + +#endif // LLVM_DEBUGINFO_CODEVIEW_TYPETABLEBUILDER_H diff --git a/llvm/include/llvm/DebugInfo/DIContext.h b/llvm/include/llvm/DebugInfo/DIContext.h index cfd8ece..ed959ca 100644 --- a/llvm/include/llvm/DebugInfo/DIContext.h +++ b/llvm/include/llvm/DebugInfo/DIContext.h @@ -17,9 +17,12 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/Object/ObjectFile.h" -#include "llvm/Support/Casting.h" -#include "llvm/Support/DataTypes.h" +#include +#include +#include #include +#include +#include namespace llvm { @@ -53,19 +56,24 @@ typedef SmallVector, 16> DILineInfoTable; /// DIInliningInfo - a format-neutral container for inlined code description. class DIInliningInfo { SmallVector Frames; - public: - DIInliningInfo() {} + +public: + DIInliningInfo() = default; + DILineInfo getFrame(unsigned Index) const { assert(Index < Frames.size()); return Frames[Index]; } + DILineInfo *getMutableFrame(unsigned Index) { assert(Index < Frames.size()); return &Frames[Index]; } + uint32_t getNumberOfFrames() const { return Frames.size(); } + void addFrame(const DILineInfo &Frame) { Frames.push_back(Frame); } @@ -138,10 +146,11 @@ public: CK_DWARF, CK_PDB }; - DIContextKind getKind() const { return Kind; } DIContext(DIContextKind K) : Kind(K) {} - virtual ~DIContext() {} + virtual ~DIContext() = default; + + DIContextKind getKind() const { return Kind; } virtual void dump(raw_ostream &OS, DIDumpType DumpType = DIDT_All, bool DumpEH = false, bool SummarizeTypes = false) = 0; @@ -152,6 +161,7 @@ public: uint64_t Size, DILineInfoSpecifier Specifier = DILineInfoSpecifier()) = 0; virtual DIInliningInfo getInliningInfoForAddress(uint64_t Address, DILineInfoSpecifier Specifier = DILineInfoSpecifier()) = 0; + private: const DIContextKind Kind; }; @@ -197,6 +207,6 @@ public: virtual std::unique_ptr clone() const = 0; }; -} +} // end namespace llvm -#endif +#endif // LLVM_DEBUGINFO_DICONTEXT_H diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h index 12bd109..ef310e7 100644 --- a/llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h +++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h @@ -10,19 +10,31 @@ #ifndef LLVM_LIB_DEBUGINFO_DWARFCONTEXT_H #define LLVM_LIB_DEBUGINFO_DWARFCONTEXT_H +#include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/iterator_range.h" #include "llvm/ADT/MapVector.h" +#include "llvm/ADT/SmallString.h" #include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/StringRef.h" #include "llvm/DebugInfo/DIContext.h" #include "llvm/DebugInfo/DWARF/DWARFCompileUnit.h" +#include "llvm/DebugInfo/DWARF/DWARFDebugAbbrev.h" #include "llvm/DebugInfo/DWARF/DWARFDebugAranges.h" #include "llvm/DebugInfo/DWARF/DWARFDebugFrame.h" #include "llvm/DebugInfo/DWARF/DWARFDebugLine.h" #include "llvm/DebugInfo/DWARF/DWARFDebugLoc.h" #include "llvm/DebugInfo/DWARF/DWARFDebugMacro.h" -#include "llvm/DebugInfo/DWARF/DWARFDebugRangeList.h" #include "llvm/DebugInfo/DWARF/DWARFGdbIndex.h" #include "llvm/DebugInfo/DWARF/DWARFSection.h" #include "llvm/DebugInfo/DWARF/DWARFTypeUnit.h" +#include "llvm/DebugInfo/DWARF/DWARFUnit.h" +#include "llvm/DebugInfo/DWARF/DWARFUnitIndex.h" +#include "llvm/Object/ObjectFile.h" +#include +#include +#include +#include +#include namespace llvm { @@ -31,14 +43,13 @@ namespace llvm { // dwarf where we expect relocated values. This adds a bit of complexity to the // dwarf parsing/extraction at the benefit of not allocating memory for the // entire size of the debug info sections. -typedef DenseMap > RelocAddrMap; +typedef DenseMap> RelocAddrMap; /// DWARFContext /// This data structure is the top level entity that deals with dwarf debug /// information parsing. The actual data is supplied through pure virtual /// methods that a concrete implementation provides. class DWARFContext : public DIContext { - DWARFUnitSection CUs; std::deque> TUs; std::unique_ptr CUIndex; @@ -57,9 +68,6 @@ class DWARFContext : public DIContext { std::unique_ptr AbbrevDWO; std::unique_ptr LocDWO; - DWARFContext(DWARFContext &) = delete; - DWARFContext &operator=(DWARFContext &) = delete; - /// Read compile units from the debug_info section (if necessary) /// and store them in CUs. void parseCompileUnits(); @@ -78,6 +86,8 @@ class DWARFContext : public DIContext { public: DWARFContext() : DIContext(CK_DWARF) {} + DWARFContext(DWARFContext &) = delete; + DWARFContext &operator=(DWARFContext &) = delete; static bool classof(const DIContext *DICtx) { return DICtx->getKind() == CK_DWARF; @@ -229,6 +239,7 @@ public: static bool isSupportedVersion(unsigned version) { return version == 2 || version == 3 || version == 4 || version == 5; } + private: /// Return the compile unit that includes an offset (relative to .debug_info). DWARFCompileUnit *getCompileUnitForOffset(uint32_t Offset); @@ -243,6 +254,7 @@ private: /// pointers to it. class DWARFContextInMemory : public DWARFContext { virtual void anchor(); + bool IsLittleEndian; uint8_t AddressSize; DWARFSection InfoSection; @@ -284,6 +296,7 @@ class DWARFContextInMemory : public DWARFContext { public: DWARFContextInMemory(const object::ObjectFile &Obj, const LoadedObjectInfo *L = nullptr); + bool isLittleEndian() const override { return IsLittleEndian; } uint8_t getAddressSize() const override { return AddressSize; } const DWARFSection &getInfoSection() override { return InfoSection; } @@ -327,6 +340,6 @@ public: StringRef getTUIndexSection() override { return TUIndexSection; } }; -} +} // end namespace llvm -#endif +#endif // LLVM_LIB_DEBUGINFO_DWARFCONTEXT_H diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugMacro.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugMacro.h index d13c7f5..5a0352d 100644 --- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugMacro.h +++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugMacro.h @@ -12,7 +12,7 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/Support/DataExtractor.h" -#include "llvm/Support/Dwarf.h" +#include namespace llvm { @@ -46,13 +46,14 @@ class DWARFDebugMacro { MacroList Macros; public: - DWARFDebugMacro() {} + DWARFDebugMacro() = default; + /// Print the macro list found within the debug_macinfo section. void dump(raw_ostream &OS) const; /// Parse the debug_macinfo section accessible via the 'data' parameter. void parse(DataExtractor data); }; -} +} // end namespace llvm -#endif +#endif // LLVM_DEBUGINFO_DWARF_DWARFDEBUGMACRO_H diff --git a/llvm/include/llvm/DebugInfo/MSF/ByteStream.h b/llvm/include/llvm/DebugInfo/MSF/ByteStream.h index d8c1e6d..547844b 100644 --- a/llvm/include/llvm/DebugInfo/MSF/ByteStream.h +++ b/llvm/include/llvm/DebugInfo/MSF/ByteStream.h @@ -17,16 +17,17 @@ #include "llvm/Support/Error.h" #include "llvm/Support/FileOutputBuffer.h" #include "llvm/Support/MemoryBuffer.h" +#include #include +#include #include -#include namespace llvm { namespace msf { class ByteStream : public ReadableStream { public: - ByteStream() {} + ByteStream() = default; explicit ByteStream(ArrayRef Data) : Data(Data) {} explicit ByteStream(StringRef Data) : Data(Data.bytes_begin(), Data.bytes_end()) {} @@ -40,6 +41,7 @@ public: Buffer = Data.slice(Offset, Size); return Error::success(); } + Error readLongestContiguousChunk(uint32_t Offset, ArrayRef &Buffer) const override { if (Offset >= Data.size()) @@ -75,7 +77,7 @@ public: class MutableByteStream : public WritableStream { public: - MutableByteStream() {} + MutableByteStream() = default; explicit MutableByteStream(MutableArrayRef Data) : Data(Data), ImmutableStream(Data) {} @@ -83,6 +85,7 @@ public: ArrayRef &Buffer) const override { return ImmutableStream.readBytes(Offset, Size, Buffer); } + Error readLongestContiguousChunk(uint32_t Offset, ArrayRef &Buffer) const override { return ImmutableStream.readLongestContiguousChunk(Offset, Buffer); @@ -142,6 +145,7 @@ public: ArrayRef &Buffer) const override { return Impl.readBytes(Offset, Size, Buffer); } + Error readLongestContiguousChunk(uint32_t Offset, ArrayRef &Buffer) const override { return Impl.readLongestContiguousChunk(Offset, Buffer); @@ -152,13 +156,13 @@ public: Error writeBytes(uint32_t Offset, ArrayRef Data) const override { return Impl.writeBytes(Offset, Data); } + Error commit() const override { return Impl.commit(); } private: StreamImpl Impl; }; - } // end namespace msf } // end namespace llvm diff --git a/llvm/include/llvm/DebugInfo/MSF/IMSFFile.h b/llvm/include/llvm/DebugInfo/MSF/IMSFFile.h index 6c5754f..f98e715 100644 --- a/llvm/include/llvm/DebugInfo/MSF/IMSFFile.h +++ b/llvm/include/llvm/DebugInfo/MSF/IMSFFile.h @@ -11,19 +11,16 @@ #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 +#include namespace llvm { namespace msf { class IMSFFile { public: - virtual ~IMSFFile() {} + virtual ~IMSFFile() = default; virtual uint32_t getBlockSize() const = 0; virtual uint32_t getBlockCount() const = 0; @@ -38,7 +35,8 @@ public: virtual Error setBlockData(uint32_t BlockIndex, uint32_t Offset, ArrayRef Data) const = 0; }; -} -} + +} // end namespace msf +} // end namespace llvm #endif // LLVM_DEBUGINFO_MSF_IMSFFILE_H diff --git a/llvm/include/llvm/DebugInfo/MSF/SequencedItemStream.h b/llvm/include/llvm/DebugInfo/MSF/SequencedItemStream.h index f54537e..1949bee 100644 --- a/llvm/include/llvm/DebugInfo/MSF/SequencedItemStream.h +++ b/llvm/include/llvm/DebugInfo/MSF/SequencedItemStream.h @@ -14,12 +14,12 @@ #include "llvm/DebugInfo/MSF/MSFError.h" #include "llvm/DebugInfo/MSF/StreamInterface.h" #include "llvm/Support/Error.h" +#include #include -#include -#include namespace llvm { namespace msf { + template struct SequencedItemTraits { static size_t length(const T &Item) = delete; static ArrayRef bytes(const T &Item) = delete; @@ -37,7 +37,7 @@ template struct SequencedItemTraits { template > class SequencedItemStream : public ReadableStream { public: - SequencedItemStream() {} + SequencedItemStream() = default; Error readBytes(uint32_t Offset, uint32_t Size, ArrayRef &Buffer) const override { @@ -83,8 +83,10 @@ private: return make_error(msf_error_code::insufficient_buffer); return CurrentIndex; } + ArrayRef Items; }; + } // end namespace msf } // end namespace llvm diff --git a/llvm/include/llvm/DebugInfo/MSF/StreamArray.h b/llvm/include/llvm/DebugInfo/MSF/StreamArray.h index 67ea010..d8b74bc 100644 --- a/llvm/include/llvm/DebugInfo/MSF/StreamArray.h +++ b/llvm/include/llvm/DebugInfo/MSF/StreamArray.h @@ -1,4 +1,4 @@ -//===- StreamArray.h - Array backed by an arbitrary stream ----------------===// +//===- StreamArray.h - Array backed by an arbitrary stream ------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -10,12 +10,11 @@ #ifndef LLVM_DEBUGINFO_MSF_STREAMARRAY_H #define LLVM_DEBUGINFO_MSF_STREAMARRAY_H -#include "llvm/DebugInfo/MSF/SequencedItemStream.h" +#include "llvm/ADT/ArrayRef.h" #include "llvm/DebugInfo/MSF/StreamRef.h" #include "llvm/Support/Error.h" - -#include -#include +#include +#include namespace llvm { namespace msf { @@ -76,13 +75,14 @@ template class VarStreamArrayIterator; template > + class VarStreamArray { friend class VarStreamArrayIterator; public: typedef VarStreamArrayIterator Iterator; - VarStreamArray() {} + VarStreamArray() = default; explicit VarStreamArray(const Extractor &E) : E(E) {} explicit VarStreamArray(ReadableStreamRef Stream) : Stream(Stream) {} @@ -125,9 +125,9 @@ public: } } } - VarStreamArrayIterator() {} + VarStreamArrayIterator() = default; explicit VarStreamArrayIterator(const Extractor &E) : Extract(E) {} - ~VarStreamArrayIterator() {} + ~VarStreamArrayIterator() = default; bool operator==(const IterType &R) const { if (Array && R.Array) { @@ -206,7 +206,7 @@ template class FixedStreamArray { friend class FixedStreamArrayIterator; public: - FixedStreamArray() : Stream() {} + FixedStreamArray() = default; FixedStreamArray(ReadableStreamRef Stream) : Stream(Stream) { assert(Stream.getLength() % sizeof(T) == 0); } @@ -229,6 +229,7 @@ public: FixedStreamArrayIterator begin() const { return FixedStreamArrayIterator(*this, 0); } + FixedStreamArrayIterator end() const { return FixedStreamArrayIterator(*this, size()); } diff --git a/llvm/include/llvm/DebugInfo/MSF/StreamInterface.h b/llvm/include/llvm/DebugInfo/MSF/StreamInterface.h index 78347e4..09782d8 100644 --- a/llvm/include/llvm/DebugInfo/MSF/StreamInterface.h +++ b/llvm/include/llvm/DebugInfo/MSF/StreamInterface.h @@ -19,7 +19,7 @@ namespace msf { class ReadableStream { public: - virtual ~ReadableStream() {} + virtual ~ReadableStream() = default; // Given an offset into the stream and a number of bytes, attempt to read // the bytes and set the output ArrayRef to point to a reference into the @@ -37,7 +37,7 @@ public: class WritableStream : public ReadableStream { public: - virtual ~WritableStream() {} + ~WritableStream() override = default; // Attempt to write the given bytes into the stream at the desired offset. // This will always necessitate a copy. Cannot shrink or grow the stream, diff --git a/llvm/include/llvm/DebugInfo/MSF/StreamRef.h b/llvm/include/llvm/DebugInfo/MSF/StreamRef.h index c25fd38..eee71e5 100644 --- a/llvm/include/llvm/DebugInfo/MSF/StreamRef.h +++ b/llvm/include/llvm/DebugInfo/MSF/StreamRef.h @@ -10,11 +10,16 @@ #ifndef LLVM_DEBUGINFO_MSF_STREAMREF_H #define LLVM_DEBUGINFO_MSF_STREAMREF_H +#include "llvm/ADT/ArrayRef.h" #include "llvm/DebugInfo/MSF/MSFError.h" #include "llvm/DebugInfo/MSF/StreamInterface.h" +#include "llvm/Support/Error.h" +#include +#include namespace llvm { namespace msf { + template class StreamRefBase { public: StreamRefBase() : Stream(nullptr), ViewOffset(0), Length(0) {} @@ -62,7 +67,7 @@ protected: class ReadableStreamRef : public StreamRefBase { public: - ReadableStreamRef() : StreamRefBase() {} + ReadableStreamRef() = default; ReadableStreamRef(const ReadableStream &Stream) : StreamRefBase(Stream, 0, Stream.getLength()) {} ReadableStreamRef(const ReadableStream &Stream, uint32_t Offset, @@ -104,7 +109,7 @@ public: class WritableStreamRef : public StreamRefBase { public: - WritableStreamRef() : StreamRefBase() {} + WritableStreamRef() = default; WritableStreamRef(const WritableStream &Stream) : StreamRefBase(Stream, 0, Stream.getLength()) {} WritableStreamRef(const WritableStream &Stream, uint32_t Offset, @@ -124,7 +129,7 @@ public: Error commit() const { return Stream->commit(); } }; -} // namespace msf -} // namespace llvm +} // end namespace msf +} // end namespace llvm #endif // LLVM_DEBUGINFO_MSF_STREAMREF_H diff --git a/llvm/include/llvm/DebugInfo/MSF/StreamWriter.h b/llvm/include/llvm/DebugInfo/MSF/StreamWriter.h index 055cd9d..2bb1443 100644 --- a/llvm/include/llvm/DebugInfo/MSF/StreamWriter.h +++ b/llvm/include/llvm/DebugInfo/MSF/StreamWriter.h @@ -11,21 +11,20 @@ #define LLVM_DEBUGINFO_MSF_STREAMWRITER_H #include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/StringRef.h" #include "llvm/DebugInfo/MSF/MSFError.h" #include "llvm/DebugInfo/MSF/StreamArray.h" -#include "llvm/DebugInfo/MSF/StreamInterface.h" #include "llvm/DebugInfo/MSF/StreamRef.h" -#include "llvm/Support/Endian.h" #include "llvm/Support/Error.h" - -#include +#include +#include namespace llvm { namespace msf { class StreamWriter { public: - StreamWriter() {} + StreamWriter() = default; explicit StreamWriter(WritableStreamRef Stream); Error writeBytes(ArrayRef Buffer); @@ -57,7 +56,7 @@ public: } template Error writeArray(ArrayRef Array) { - if (Array.size() == 0) + if (Array.empty()) return Error::success(); if (Array.size() > UINT32_MAX / sizeof(T)) @@ -86,7 +85,8 @@ private: WritableStreamRef Stream; uint32_t Offset = 0; }; -} // namespace msf -} // namespace llvm + +} // end namespace msf +} // end namespace llvm #endif // LLVM_DEBUGINFO_MSF_STREAMWRITER_H diff --git a/llvm/include/llvm/DebugInfo/PDB/ConcreteSymbolEnumerator.h b/llvm/include/llvm/DebugInfo/PDB/ConcreteSymbolEnumerator.h index 50f5c40..9bf0738 100644 --- a/llvm/include/llvm/DebugInfo/PDB/ConcreteSymbolEnumerator.h +++ b/llvm/include/llvm/DebugInfo/PDB/ConcreteSymbolEnumerator.h @@ -10,8 +10,11 @@ #ifndef LLVM_DEBUGINFO_PDB_CONCRETESYMBOLENUMERATOR_H #define LLVM_DEBUGINFO_PDB_CONCRETESYMBOLENUMERATOR_H -#include "IPDBEnumChildren.h" +#include "llvm/DebugInfo/PDB/IPDBEnumChildren.h" +#include "llvm/DebugInfo/PDB/PDBTypes.h" #include "llvm/Support/Casting.h" +#include +#include #include namespace llvm { @@ -23,7 +26,7 @@ public: ConcreteSymbolEnumerator(std::unique_ptr SymbolEnumerator) : Enumerator(std::move(SymbolEnumerator)) {} - ~ConcreteSymbolEnumerator() override {} + ~ConcreteSymbolEnumerator() override = default; uint32_t getChildCount() const override { return Enumerator->getChildCount(); @@ -55,7 +58,8 @@ private: std::unique_ptr Enumerator; }; -} -} -#endif +} // end namespace pdb +} // end namespace llvm + +#endif // LLVM_DEBUGINFO_PDB_CONCRETESYMBOLENUMERATOR_H diff --git a/llvm/include/llvm/DebugInfo/PDB/IPDBEnumChildren.h b/llvm/include/llvm/DebugInfo/PDB/IPDBEnumChildren.h index 8e9f6f8..e48dc25 100644 --- a/llvm/include/llvm/DebugInfo/PDB/IPDBEnumChildren.h +++ b/llvm/include/llvm/DebugInfo/PDB/IPDBEnumChildren.h @@ -10,7 +10,7 @@ #ifndef LLVM_DEBUGINFO_PDB_IPDBENUMCHILDREN_H #define LLVM_DEBUGINFO_PDB_IPDBENUMCHILDREN_H -#include "PDBTypes.h" +#include #include namespace llvm { @@ -21,7 +21,7 @@ public: typedef std::unique_ptr ChildTypePtr; typedef IPDBEnumChildren MyType; - virtual ~IPDBEnumChildren() {} + virtual ~IPDBEnumChildren() = default; virtual uint32_t getChildCount() const = 0; virtual ChildTypePtr getChildAtIndex(uint32_t Index) const = 0; @@ -29,7 +29,8 @@ public: virtual void reset() = 0; virtual MyType *clone() const = 0; }; -} -} -#endif +} // end namespace pdb +} // end namespace llvm + +#endif // LLVM_DEBUGINFO_PDB_IPDBENUMCHILDREN_H diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBContext.h b/llvm/include/llvm/DebugInfo/PDB/PDBContext.h index c15714a..84ab8ed 100644 --- a/llvm/include/llvm/DebugInfo/PDB/PDBContext.h +++ b/llvm/include/llvm/DebugInfo/PDB/PDBContext.h @@ -12,14 +12,18 @@ #include "llvm/DebugInfo/DIContext.h" #include "llvm/DebugInfo/PDB/IPDBSession.h" +#include +#include +#include namespace llvm { namespace object { class COFFObjectFile; - } +} // end namespace object + +namespace pdb { - namespace pdb { /// PDBContext /// This data structure is the top level entity that deals with PDB debug /// information parsing. This data structure exists only when there is a @@ -27,13 +31,11 @@ class COFFObjectFile; /// (e.g. PDB and DWARF). More control and power over the debug information /// access can be had by using the PDB interfaces directly. class PDBContext : public DIContext { - - PDBContext(PDBContext &) = delete; - PDBContext &operator=(PDBContext &) = delete; - public: PDBContext(const object::COFFObjectFile &Object, std::unique_ptr PDBSession); + PDBContext(PDBContext &) = delete; + PDBContext &operator=(PDBContext &) = delete; static bool classof(const DIContext *DICtx) { return DICtx->getKind() == CK_PDB; @@ -56,7 +58,9 @@ class COFFObjectFile; std::string getFunctionName(uint64_t Address, DINameKind NameKind) const; std::unique_ptr Session; }; - } -} -#endif +} // end namespace pdb + +} // end namespace llvm + +#endif // LLVM_DEBUGINFO_PDB_PDBCONTEXT_H diff --git a/llvm/include/llvm/DebugInfo/PDB/Raw/ISectionContribVisitor.h b/llvm/include/llvm/DebugInfo/PDB/Raw/ISectionContribVisitor.h index 355a25a..fb00d6a 100644 --- a/llvm/include/llvm/DebugInfo/PDB/Raw/ISectionContribVisitor.h +++ b/llvm/include/llvm/DebugInfo/PDB/Raw/ISectionContribVisitor.h @@ -12,17 +12,19 @@ namespace llvm { namespace pdb { + struct SectionContrib; struct SectionContrib2; class ISectionContribVisitor { public: - virtual ~ISectionContribVisitor() {} + virtual ~ISectionContribVisitor() = default; virtual void visit(const SectionContrib &C) = 0; virtual void visit(const SectionContrib2 &C) = 0; }; -} // namespace pdb -} // namespace llvm + +} // end namespace pdb +} // end namespace llvm #endif // LLVM_DEBUGINFO_PDB_RAW_ISECTIONCONTRIBVISITOR_H diff --git a/llvm/include/llvm/DebugInfo/PDB/Raw/ModInfo.h b/llvm/include/llvm/DebugInfo/PDB/Raw/ModInfo.h index b084f5b..034da4b 100644 --- a/llvm/include/llvm/DebugInfo/PDB/Raw/ModInfo.h +++ b/llvm/include/llvm/DebugInfo/PDB/Raw/ModInfo.h @@ -14,11 +14,12 @@ #include "llvm/DebugInfo/MSF/StreamArray.h" #include "llvm/DebugInfo/MSF/StreamRef.h" #include "llvm/DebugInfo/PDB/Raw/RawTypes.h" -#include "llvm/Support/Endian.h" +#include "llvm/Support/Error.h" #include #include namespace llvm { + namespace pdb { class ModInfo { @@ -54,8 +55,7 @@ private: struct ModuleInfoEx { ModuleInfoEx(const ModInfo &Info) : Info(Info) {} - ModuleInfoEx(const ModuleInfoEx &Ex) - : Info(Ex.Info), SourceFiles(Ex.SourceFiles) {} + ModuleInfoEx(const ModuleInfoEx &Ex) = default; ModInfo Info; std::vector SourceFiles; @@ -64,6 +64,7 @@ struct ModuleInfoEx { } // end namespace pdb namespace msf { + template <> struct VarStreamArrayExtractor { Error operator()(ReadableStreamRef Stream, uint32_t &Length, pdb::ModInfo &Info) const { @@ -73,6 +74,7 @@ template <> struct VarStreamArrayExtractor { return Error::success(); } }; + } // end namespace msf } // end namespace llvm diff --git a/llvm/include/llvm/DebugInfo/PDB/Raw/TpiHashing.h b/llvm/include/llvm/DebugInfo/PDB/Raw/TpiHashing.h index e40490b..67a4952 100644 --- a/llvm/include/llvm/DebugInfo/PDB/Raw/TpiHashing.h +++ b/llvm/include/llvm/DebugInfo/PDB/Raw/TpiHashing.h @@ -11,6 +11,7 @@ #define LLVM_DEBUGINFO_PDB_TPIHASHING_H #include "llvm/ADT/Optional.h" +#include "llvm/ADT/StringExtras.h" #include "llvm/DebugInfo/CodeView/TypeIndex.h" #include "llvm/DebugInfo/CodeView/TypeRecord.h" #include "llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h" @@ -18,12 +19,15 @@ #include "llvm/DebugInfo/PDB/Raw/RawError.h" #include "llvm/Support/Endian.h" #include "llvm/Support/Error.h" +#include +#include namespace llvm { namespace pdb { + class TpiHashUpdater : public codeview::TypeVisitorCallbacks { public: - TpiHashUpdater() {} + TpiHashUpdater() = default; #define TYPE_RECORD(EnumName, EnumVal, Name) \ virtual Error visitKnownRecord(codeview::CVType &CVR, \ @@ -84,7 +88,8 @@ private: uint32_t NumHashBuckets; uint32_t Index = -1; }; -} -} -#endif +} // end namespace pdb +} // end namespace llvm + +#endif // LLVM_DEBUGINFO_PDB_TPIHASHING_H