]> granicus.if.org Git - llvm/commitdiff
Fix some Clang-tidy modernize-deprecated-headers and Include What You Use warnings...
authorEugene Zelenko <eugene.zelenko@gmail.com>
Mon, 9 May 2016 23:11:38 +0000 (23:11 +0000)
committerEugene Zelenko <eugene.zelenko@gmail.com>
Mon, 9 May 2016 23:11:38 +0000 (23:11 +0000)
Differential revision: http://reviews.llvm.org/D20042

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268989 91177308-0d34-0410-b5e6-96231b3b80d8

13 files changed:
include/llvm/DebugInfo/CodeView/TypeStream.h
include/llvm/DebugInfo/PDB/Raw/ByteStream.h
include/llvm/DebugInfo/PDB/Raw/MappedBlockStream.h
include/llvm/DebugInfo/PDB/Raw/ModInfo.h
include/llvm/DebugInfo/PDB/Raw/NameHashTable.h
include/llvm/DebugInfo/PDB/Raw/NameMap.h
include/llvm/DebugInfo/PDB/Raw/RawConstants.h
include/llvm/DebugInfo/PDB/Raw/StreamInterface.h
include/llvm/Object/ELFObjectFile.h
include/llvm/Support/AtomicOrdering.h
include/llvm/Target/TargetRecip.h
lib/DebugInfo/PDB/Raw/ByteStream.cpp
lib/DebugInfo/Symbolize/DIPrinter.cpp

index 941e0dca36a90f459b3993060b1ab6c84a9d00db..d770a132fd2309d4c7a4091ccfb9601c2196cb2e 100644 (file)
 #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 <stdint.h>
+#include <cstdint>
+#include <system_error>
 
 namespace llvm {
+
 class APSInt;
 
 namespace codeview {
@@ -69,4 +72,4 @@ inline iterator_range<TypeIterator> makeTypeRange(ArrayRef<uint8_t> Data) {
 } // end namespace codeview
 } // end namespace llvm
 
-#endif
+#endif // LLVM_DEBUGINFO_CODEVIEW_TYPESTREAM_H
index 7068101e93e35b0f137df7cb2d3a34fb6eb5f1a1..843e43c87406afa89f1954af8bcf3ea65e26585d 100644 (file)
 #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 <stdint.h>
-
-#include <system_error>
-#include <vector>
+#include "llvm/Support/Error.h"
+#include <cstdint>
+#include <memory>
 
 namespace llvm {
 namespace pdb {
+
 class StreamReader;
+
 class ByteStream : public StreamInterface {
 public:
   ByteStream();
@@ -48,7 +49,8 @@ private:
   MutableArrayRef<uint8_t> Data;
   std::unique_ptr<uint8_t[]> Ownership;
 };
-}
-}
 
-#endif
+} // end namespace pdb
+} // end namespace llvm
+
+#endif // LLVM_DEBUGINFO_PDB_RAW_BYTESTREAM_H
index c8bf5a360d13a528e7ad1a32ee9f150ba31647d6..2b475e4bf09ba4f8a0b88dc7c000d70ae12cb129 100644 (file)
 #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 <stdint.h>
-
-#include <system_error>
+#include "llvm/Support/Error.h"
+#include <cstdint>
 #include <vector>
 
 namespace llvm {
 namespace pdb {
+
 class PDBFile;
 
 class MappedBlockStream : public StreamInterface {
@@ -37,7 +37,8 @@ private:
   std::vector<uint32_t> BlockList;
   const PDBFile &Pdb;
 };
-}
-}
 
-#endif
+} // end namespace pdb
+} // end namespace llvm
+
+#endif // LLVM_DEBUGINFO_PDB_RAW_MAPPEDBLOCKSTREAM_H
index 5cd11c102d0adf47c49f30222a2aec12f6ed7a31..3ed250ff42eb2505b587949870028bd6c96a59c3 100644 (file)
 #define LLVM_DEBUGINFO_PDB_RAW_MODINFO_H
 
 #include "llvm/ADT/StringRef.h"
-
-#include <stdint.h>
+#include <cstdint>
 #include <vector>
 
 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
index ad58b5c7f642e11f50c13406236b48baff339d2c..62c1e20b8d50c7efe7f3c5102061b7cb244f477e 100644 (file)
 #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 <stdint.h>
-#include <utility>
+#include <cstdint>
+#include <vector>
 
 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
index 7f87fb9a49993428858b2337322cf9a7d40cacf0..451e98d906aced9e3e0dfe15c3c754a7eb08c895 100644 (file)
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/Error.h"
-
-#include <stdint.h>
-#include <utility>
+#include <cstdint>
 
 namespace llvm {
 namespace pdb {
+
 class StreamReader;
+
 class NameMap {
 public:
   NameMap();
@@ -31,7 +31,8 @@ public:
 private:
   StringMap<uint32_t> Mapping;
 };
-}
-}
 
-#endif
\ No newline at end of file
+} // end namespace pdb
+} // end namespace llvm
+
+#endif // LLVM_DEBUGINFO_PDB_RAW_PDBNAMEMAP_H
index 0b6d9deae40e282bb8386ae50c914ce88534f5ae..5e087136fc33bfb537bd8255df3e7604255b62e4 100644 (file)
 #ifndef LLVM_DEBUGINFO_PDB_RAW_PDBRAWCONSTANTS_H
 #define LLVM_DEBUGINFO_PDB_RAW_PDBRAWCONSTANTS_H
 
-#include <stdint.h>
+#include <cstdint>
 
 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
index f1d67529aec451ecf494aca0bff3856da0c07768..effeaf2605fd228f8508f1efe81b2d3a64092d63 100644 (file)
 #define LLVM_DEBUGINFO_PDB_RAW_STREAMINTERFACE_H
 
 #include "llvm/ADT/ArrayRef.h"
-#include "llvm/DebugInfo/PDB/Raw/RawError.h"
-
-#include <stdint.h>
+#include "llvm/Support/Error.h"
+#include <cstdint>
 
 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
index a0c0697084745075103687167b3eb16788712d41..c5f777186aa199c09020efdca01b49299c3f7a99 100644 (file)
 #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 <algorithm>
-#include <cctype>
-#include <utility>
+#include <cassert>
+#include <cstdint>
+#include <system_error>
 
 namespace llvm {
 namespace object {
@@ -50,8 +59,8 @@ protected:
   virtual uint64_t getSectionFlags(DataRefImpl Sec) const = 0;
 
   virtual ErrorOr<int64_t> getRelocationAddend(DataRefImpl Rel) const = 0;
-public:
 
+public:
   typedef iterator_range<elf_symbol_iterator> 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 <class ELFT> bool ELFObjectFile<ELFT>::isRelocatableObject() const {
   return EF.getHeader()->e_type == ELF::ET_REL;
 }
 
-}
-}
+} // end namespace object
+} // end namespace llvm
 
-#endif
+#endif // LLVM_OBJECT_ELFOBJECTFILE_H
index c9ffb24fa759cbf98c6329898fcacf8945ce7831..8837fab1957577ebe6c82f1065683d79ea15b4f6 100644 (file)
@@ -18,7 +18,7 @@
 #ifndef LLVM_SUPPORT_ATOMICORDERING_H
 #define LLVM_SUPPORT_ATOMICORDERING_H
 
-#include <stddef.h>
+#include <cstddef>
 
 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
index 53fb232d5b5d725b65b0fd6233043f23c6c809ca..309b960791311fc70a40a523af0b0cefe910db9f 100644 (file)
@@ -18,8 +18,8 @@
 #define LLVM_TARGET_TARGETRECIP_H
 
 #include "llvm/ADT/StringRef.h"
+#include <cstdint>
 #include <map>
-#include <stdint.h>
 #include <string>
 #include <vector>
 
@@ -69,6 +69,6 @@ private:
   void parseIndividualParams(const std::vector<std::string> &Args);
 };
 
-} // End llvm namespace
+} // end namespace llvm
 
-#endif
+#endif // LLVM_TARGET_TARGETRECIP_H
index 8dc3c85488706f7326f6cde7e659abbb693f5599..09b51d968710924ca213133c2bc6808de225e641 100644 (file)
@@ -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 <cstring>
 
 using namespace llvm;
 using namespace llvm::pdb;
index a9dee7abeed1eca4c04c1acfa763fc3a0f437d6a..3eb9ffc17f161bebf285e1bd1233c4cb177053b1 100644 (file)
 //===----------------------------------------------------------------------===//
 
 #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 <algorithm>
+#include <cmath>
+#include <cstddef>
+#include <cstdint>
+#include <memory>
+#include <string>
 
 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