From: Eugene Zelenko Date: Mon, 9 May 2016 23:11:38 +0000 (+0000) Subject: Fix some Clang-tidy modernize-deprecated-headers and Include What You Use warnings... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3d09da35386e6cb9a9c025968350e022e9d85fbf;p=llvm Fix some Clang-tidy modernize-deprecated-headers and Include What You Use warnings; other minor fixes. Differential revision: http://reviews.llvm.org/D20042 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268989 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/DebugInfo/CodeView/TypeStream.h b/include/llvm/DebugInfo/CodeView/TypeStream.h index 941e0dca36a..d770a132fd2 100644 --- a/include/llvm/DebugInfo/CodeView/TypeStream.h +++ b/include/llvm/DebugInfo/CodeView/TypeStream.h @@ -10,15 +10,18 @@ #ifndef LLVM_DEBUGINFO_CODEVIEW_TYPESTREAM_H #define LLVM_DEBUGINFO_CODEVIEW_TYPESTREAM_H +#include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/iterator_range.h" #include "llvm/ADT/StringRef.h" #include "llvm/DebugInfo/CodeView/CodeView.h" #include "llvm/DebugInfo/CodeView/RecordIterator.h" #include "llvm/Object/Error.h" #include "llvm/Support/Endian.h" - -#include +#include +#include namespace llvm { + class APSInt; namespace codeview { @@ -69,4 +72,4 @@ inline iterator_range makeTypeRange(ArrayRef Data) { } // end namespace codeview } // end namespace llvm -#endif +#endif // LLVM_DEBUGINFO_CODEVIEW_TYPESTREAM_H diff --git a/include/llvm/DebugInfo/PDB/Raw/ByteStream.h b/include/llvm/DebugInfo/PDB/Raw/ByteStream.h index 7068101e93e..843e43c8740 100644 --- a/include/llvm/DebugInfo/PDB/Raw/ByteStream.h +++ b/include/llvm/DebugInfo/PDB/Raw/ByteStream.h @@ -11,16 +11,17 @@ #define LLVM_DEBUGINFO_PDB_RAW_BYTESTREAM_H #include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/StringRef.h" #include "llvm/DebugInfo/PDB/Raw/StreamInterface.h" - -#include - -#include -#include +#include "llvm/Support/Error.h" +#include +#include namespace llvm { namespace pdb { + class StreamReader; + class ByteStream : public StreamInterface { public: ByteStream(); @@ -48,7 +49,8 @@ private: MutableArrayRef Data; std::unique_ptr Ownership; }; -} -} -#endif +} // end namespace pdb +} // end namespace llvm + +#endif // LLVM_DEBUGINFO_PDB_RAW_BYTESTREAM_H diff --git a/include/llvm/DebugInfo/PDB/Raw/MappedBlockStream.h b/include/llvm/DebugInfo/PDB/Raw/MappedBlockStream.h index c8bf5a360d1..2b475e4bf09 100644 --- a/include/llvm/DebugInfo/PDB/Raw/MappedBlockStream.h +++ b/include/llvm/DebugInfo/PDB/Raw/MappedBlockStream.h @@ -10,15 +10,15 @@ #ifndef LLVM_DEBUGINFO_PDB_RAW_MAPPEDBLOCKSTREAM_H #define LLVM_DEBUGINFO_PDB_RAW_MAPPEDBLOCKSTREAM_H +#include "llvm/ADT/ArrayRef.h" #include "llvm/DebugInfo/PDB/Raw/StreamInterface.h" - -#include - -#include +#include "llvm/Support/Error.h" +#include #include namespace llvm { namespace pdb { + class PDBFile; class MappedBlockStream : public StreamInterface { @@ -37,7 +37,8 @@ private: std::vector BlockList; const PDBFile &Pdb; }; -} -} -#endif +} // end namespace pdb +} // end namespace llvm + +#endif // LLVM_DEBUGINFO_PDB_RAW_MAPPEDBLOCKSTREAM_H diff --git a/include/llvm/DebugInfo/PDB/Raw/ModInfo.h b/include/llvm/DebugInfo/PDB/Raw/ModInfo.h index 5cd11c102d0..3ed250ff42e 100644 --- a/include/llvm/DebugInfo/PDB/Raw/ModInfo.h +++ b/include/llvm/DebugInfo/PDB/Raw/ModInfo.h @@ -11,12 +11,12 @@ #define LLVM_DEBUGINFO_PDB_RAW_MODINFO_H #include "llvm/ADT/StringRef.h" - -#include +#include #include namespace llvm { namespace pdb { + class ModInfo { private: struct FileLayout; @@ -64,7 +64,8 @@ public: private: const uint8_t *Bytes; }; -} -} -#endif +} // end namespace pdb +} // end namespace llvm + +#endif // LLVM_DEBUGINFO_PDB_RAW_MODINFO_H diff --git a/include/llvm/DebugInfo/PDB/Raw/NameHashTable.h b/include/llvm/DebugInfo/PDB/Raw/NameHashTable.h index ad58b5c7f64..62c1e20b8d5 100644 --- a/include/llvm/DebugInfo/PDB/Raw/NameHashTable.h +++ b/include/llvm/DebugInfo/PDB/Raw/NameHashTable.h @@ -10,17 +10,18 @@ #ifndef LLVM_DEBUGINFO_PDB_RAW_NAMEHASHTABLE_H #define LLVM_DEBUGINFO_PDB_RAW_NAMEHASHTABLE_H -#include "llvm/ADT/StringMap.h" +#include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/StringRef.h" #include "llvm/DebugInfo/PDB/Raw/ByteStream.h" #include "llvm/Support/Error.h" - -#include -#include +#include +#include namespace llvm { namespace pdb { + class StreamReader; + class NameHashTable { public: NameHashTable(); @@ -43,7 +44,8 @@ private: uint32_t HashVersion; uint32_t NameCount; }; -} -} -#endif +} // end namespace pdb +} // end namespace llvm + +#endif // LLVM_DEBUGINFO_PDB_RAW_NAMEHASHTABLE_H diff --git a/include/llvm/DebugInfo/PDB/Raw/NameMap.h b/include/llvm/DebugInfo/PDB/Raw/NameMap.h index 7f87fb9a499..451e98d906a 100644 --- a/include/llvm/DebugInfo/PDB/Raw/NameMap.h +++ b/include/llvm/DebugInfo/PDB/Raw/NameMap.h @@ -13,13 +13,13 @@ #include "llvm/ADT/StringMap.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/Error.h" - -#include -#include +#include namespace llvm { namespace pdb { + class StreamReader; + class NameMap { public: NameMap(); @@ -31,7 +31,8 @@ public: private: StringMap Mapping; }; -} -} -#endif \ No newline at end of file +} // end namespace pdb +} // end namespace llvm + +#endif // LLVM_DEBUGINFO_PDB_RAW_PDBNAMEMAP_H diff --git a/include/llvm/DebugInfo/PDB/Raw/RawConstants.h b/include/llvm/DebugInfo/PDB/Raw/RawConstants.h index 0b6d9deae40..5e087136fc3 100644 --- a/include/llvm/DebugInfo/PDB/Raw/RawConstants.h +++ b/include/llvm/DebugInfo/PDB/Raw/RawConstants.h @@ -10,10 +10,11 @@ #ifndef LLVM_DEBUGINFO_PDB_RAW_PDBRAWCONSTANTS_H #define LLVM_DEBUGINFO_PDB_RAW_PDBRAWCONSTANTS_H -#include +#include namespace llvm { namespace pdb { + enum PdbRaw_ImplVer : uint32_t { PdbImplVC2 = 19941610, PdbImplVC4 = 19950623, @@ -49,7 +50,8 @@ enum SpecialStream : uint32_t { StreamDBI = 3, StreamIPI = 4, }; -} -} -#endif +} // end namespace pdb +} // end namespace llvm + +#endif // LLVM_DEBUGINFO_PDB_RAW_PDBRAWCONSTANTS_H diff --git a/include/llvm/DebugInfo/PDB/Raw/StreamInterface.h b/include/llvm/DebugInfo/PDB/Raw/StreamInterface.h index f1d67529aec..effeaf2605f 100644 --- a/include/llvm/DebugInfo/PDB/Raw/StreamInterface.h +++ b/include/llvm/DebugInfo/PDB/Raw/StreamInterface.h @@ -11,12 +11,12 @@ #define LLVM_DEBUGINFO_PDB_RAW_STREAMINTERFACE_H #include "llvm/ADT/ArrayRef.h" -#include "llvm/DebugInfo/PDB/Raw/RawError.h" - -#include +#include "llvm/Support/Error.h" +#include namespace llvm { namespace pdb { + class StreamInterface { public: virtual ~StreamInterface() {} @@ -28,7 +28,8 @@ public: virtual uint32_t getLength() const = 0; }; -} -} -#endif +} // end namespace pdb +} // end namespace llvm + +#endif // LLVM_DEBUGINFO_PDB_RAW_STREAMINTERFACE_H diff --git a/include/llvm/Object/ELFObjectFile.h b/include/llvm/Object/ELFObjectFile.h index a0c06970847..c5f777186aa 100644 --- a/include/llvm/Object/ELFObjectFile.h +++ b/include/llvm/Object/ELFObjectFile.h @@ -14,18 +14,27 @@ #ifndef LLVM_OBJECT_ELFOBJECTFILE_H #define LLVM_OBJECT_ELFOBJECTFILE_H +#include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/StringRef.h" #include "llvm/ADT/Triple.h" +#include "llvm/ADT/iterator_range.h" +#include "llvm/Object/Binary.h" #include "llvm/Object/ELF.h" +#include "llvm/Object/ELFTypes.h" +#include "llvm/Object/Error.h" #include "llvm/Object/ObjectFile.h" +#include "llvm/Object/SymbolicFile.h" #include "llvm/Support/Casting.h" #include "llvm/Support/ELF.h" #include "llvm/Support/Endian.h" +#include "llvm/Support/Error.h" #include "llvm/Support/ErrorHandling.h" +#include "llvm/Support/ErrorOr.h" #include "llvm/Support/MemoryBuffer.h" -#include -#include -#include +#include +#include +#include namespace llvm { namespace object { @@ -50,8 +59,8 @@ protected: virtual uint64_t getSectionFlags(DataRefImpl Sec) const = 0; virtual ErrorOr getRelocationAddend(DataRefImpl Rel) const = 0; -public: +public: typedef iterator_range elf_symbol_iterator_range; virtual elf_symbol_iterator_range getDynamicSymbolIterators() const = 0; @@ -279,11 +288,9 @@ protected: // A symbol is exported if its binding is either GLOBAL or WEAK, and its // visibility is either DEFAULT or PROTECTED. All other symbols are not // exported. - if ((Binding == ELF::STB_GLOBAL || Binding == ELF::STB_WEAK) && - (Visibility == ELF::STV_DEFAULT || Visibility == ELF::STV_PROTECTED)) - return true; - - return false; + return ((Binding == ELF::STB_GLOBAL || Binding == ELF::STB_WEAK) && + (Visibility == ELF::STV_DEFAULT || + Visibility == ELF::STV_PROTECTED)); } // This flag is used for classof, to distinguish ELFObjectFile from @@ -940,7 +947,7 @@ template bool ELFObjectFile::isRelocatableObject() const { return EF.getHeader()->e_type == ELF::ET_REL; } -} -} +} // end namespace object +} // end namespace llvm -#endif +#endif // LLVM_OBJECT_ELFOBJECTFILE_H diff --git a/include/llvm/Support/AtomicOrdering.h b/include/llvm/Support/AtomicOrdering.h index c9ffb24fa75..8837fab1957 100644 --- a/include/llvm/Support/AtomicOrdering.h +++ b/include/llvm/Support/AtomicOrdering.h @@ -18,7 +18,7 @@ #ifndef LLVM_SUPPORT_ATOMICORDERING_H #define LLVM_SUPPORT_ATOMICORDERING_H -#include +#include namespace llvm { @@ -148,6 +148,6 @@ static inline AtomicOrderingCABI toCABI(AtomicOrdering ao) { return lookup[(size_t)ao]; } -} // End namespace llvm +} // end namespace llvm -#endif +#endif // LLVM_SUPPORT_ATOMICORDERING_H diff --git a/include/llvm/Target/TargetRecip.h b/include/llvm/Target/TargetRecip.h index 53fb232d5b5..309b9607913 100644 --- a/include/llvm/Target/TargetRecip.h +++ b/include/llvm/Target/TargetRecip.h @@ -18,8 +18,8 @@ #define LLVM_TARGET_TARGETRECIP_H #include "llvm/ADT/StringRef.h" +#include #include -#include #include #include @@ -69,6 +69,6 @@ private: void parseIndividualParams(const std::vector &Args); }; -} // End llvm namespace +} // end namespace llvm -#endif +#endif // LLVM_TARGET_TARGETRECIP_H diff --git a/lib/DebugInfo/PDB/Raw/ByteStream.cpp b/lib/DebugInfo/PDB/Raw/ByteStream.cpp index 8dc3c854887..09b51d96871 100644 --- a/lib/DebugInfo/PDB/Raw/ByteStream.cpp +++ b/lib/DebugInfo/PDB/Raw/ByteStream.cpp @@ -8,7 +8,9 @@ //===----------------------------------------------------------------------===// #include "llvm/DebugInfo/PDB/Raw/ByteStream.h" +#include "llvm/DebugInfo/PDB/Raw/RawError.h" #include "llvm/DebugInfo/PDB/Raw/StreamReader.h" +#include using namespace llvm; using namespace llvm::pdb; diff --git a/lib/DebugInfo/Symbolize/DIPrinter.cpp b/lib/DebugInfo/Symbolize/DIPrinter.cpp index a9dee7abeed..3eb9ffc17f1 100644 --- a/lib/DebugInfo/Symbolize/DIPrinter.cpp +++ b/lib/DebugInfo/Symbolize/DIPrinter.cpp @@ -13,9 +13,19 @@ //===----------------------------------------------------------------------===// #include "llvm/DebugInfo/Symbolize/DIPrinter.h" - +#include "llvm/ADT/StringRef.h" #include "llvm/DebugInfo/DIContext.h" +#include "llvm/Support/ErrorOr.h" +#include "llvm/Support/Format.h" #include "llvm/Support/LineIterator.h" +#include "llvm/Support/MemoryBuffer.h" +#include "llvm/Support/raw_ostream.h" +#include +#include +#include +#include +#include +#include namespace llvm { namespace symbolize { @@ -61,7 +71,7 @@ void DIPrinter::print(const DILineInfo &Info, bool Inlined) { if (FunctionName == kDILineInfoBadString) FunctionName = kBadString; - StringRef Delimiter = (PrintPretty == true) ? " at " : "\n"; + StringRef Delimiter = PrintPretty ? " at " : "\n"; StringRef Prefix = (PrintPretty && Inlined) ? " (inlined by) " : ""; OS << Prefix << FunctionName << Delimiter; } @@ -97,5 +107,5 @@ DIPrinter &DIPrinter::operator<<(const DIGlobal &Global) { return *this; } -} -} +} // end namespace symbolize +} // end namespace llvm