[llvm] r268989 - Fix some Clang-tidy modernize-deprecated-headers and Include What You Use warnings; other minor fixes.
Eugene Zelenko via llvm-commits
llvm-commits at lists.llvm.org
Mon May 9 16:11:38 PDT 2016
Author: eugenezelenko
Date: Mon May 9 18:11:38 2016
New Revision: 268989
URL: http://llvm.org/viewvc/llvm-project?rev=268989&view=rev
Log:
Fix some Clang-tidy modernize-deprecated-headers and Include What You Use warnings; other minor fixes.
Differential revision: http://reviews.llvm.org/D20042
Modified:
llvm/trunk/include/llvm/DebugInfo/CodeView/TypeStream.h
llvm/trunk/include/llvm/DebugInfo/PDB/Raw/ByteStream.h
llvm/trunk/include/llvm/DebugInfo/PDB/Raw/MappedBlockStream.h
llvm/trunk/include/llvm/DebugInfo/PDB/Raw/ModInfo.h
llvm/trunk/include/llvm/DebugInfo/PDB/Raw/NameHashTable.h
llvm/trunk/include/llvm/DebugInfo/PDB/Raw/NameMap.h
llvm/trunk/include/llvm/DebugInfo/PDB/Raw/RawConstants.h
llvm/trunk/include/llvm/DebugInfo/PDB/Raw/StreamInterface.h
llvm/trunk/include/llvm/Object/ELFObjectFile.h
llvm/trunk/include/llvm/Support/AtomicOrdering.h
llvm/trunk/include/llvm/Target/TargetRecip.h
llvm/trunk/lib/DebugInfo/PDB/Raw/ByteStream.cpp
llvm/trunk/lib/DebugInfo/Symbolize/DIPrinter.cpp
Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/TypeStream.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/TypeStream.h?rev=268989&r1=268988&r2=268989&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/CodeView/TypeStream.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/CodeView/TypeStream.h Mon May 9 18:11:38 2016
@@ -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 <stdint.h>
+#include <cstdint>
+#include <system_error>
namespace llvm {
+
class APSInt;
namespace codeview {
@@ -69,4 +72,4 @@ inline iterator_range<TypeIterator> make
} // end namespace codeview
} // end namespace llvm
-#endif
+#endif // LLVM_DEBUGINFO_CODEVIEW_TYPESTREAM_H
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/Raw/ByteStream.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/Raw/ByteStream.h?rev=268989&r1=268988&r2=268989&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/Raw/ByteStream.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/Raw/ByteStream.h Mon May 9 18:11:38 2016
@@ -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 <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
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/Raw/MappedBlockStream.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/Raw/MappedBlockStream.h?rev=268989&r1=268988&r2=268989&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/Raw/MappedBlockStream.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/Raw/MappedBlockStream.h Mon May 9 18:11:38 2016
@@ -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 <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
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/Raw/ModInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/Raw/ModInfo.h?rev=268989&r1=268988&r2=268989&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/Raw/ModInfo.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/Raw/ModInfo.h Mon May 9 18:11:38 2016
@@ -11,12 +11,12 @@
#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
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/Raw/NameHashTable.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/Raw/NameHashTable.h?rev=268989&r1=268988&r2=268989&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/Raw/NameHashTable.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/Raw/NameHashTable.h Mon May 9 18:11:38 2016
@@ -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 <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
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/Raw/NameMap.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/Raw/NameMap.h?rev=268989&r1=268988&r2=268989&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/Raw/NameMap.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/Raw/NameMap.h Mon May 9 18:11:38 2016
@@ -13,13 +13,13 @@
#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
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/Raw/RawConstants.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/Raw/RawConstants.h?rev=268989&r1=268988&r2=268989&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/Raw/RawConstants.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/Raw/RawConstants.h Mon May 9 18:11:38 2016
@@ -10,10 +10,11 @@
#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
Modified: llvm/trunk/include/llvm/DebugInfo/PDB/Raw/StreamInterface.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/Raw/StreamInterface.h?rev=268989&r1=268988&r2=268989&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/Raw/StreamInterface.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/Raw/StreamInterface.h Mon May 9 18:11:38 2016
@@ -11,12 +11,12 @@
#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
Modified: llvm/trunk/include/llvm/Object/ELFObjectFile.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/ELFObjectFile.h?rev=268989&r1=268988&r2=268989&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/ELFObjectFile.h (original)
+++ llvm/trunk/include/llvm/Object/ELFObjectFile.h Mon May 9 18:11:38 2016
@@ -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 <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
return EF.getHeader()->e_type == ELF::ET_REL;
}
-}
-}
+} // end namespace object
+} // end namespace llvm
-#endif
+#endif // LLVM_OBJECT_ELFOBJECTFILE_H
Modified: llvm/trunk/include/llvm/Support/AtomicOrdering.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/AtomicOrdering.h?rev=268989&r1=268988&r2=268989&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/AtomicOrdering.h (original)
+++ llvm/trunk/include/llvm/Support/AtomicOrdering.h Mon May 9 18:11:38 2016
@@ -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(
return lookup[(size_t)ao];
}
-} // End namespace llvm
+} // end namespace llvm
-#endif
+#endif // LLVM_SUPPORT_ATOMICORDERING_H
Modified: llvm/trunk/include/llvm/Target/TargetRecip.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetRecip.h?rev=268989&r1=268988&r2=268989&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetRecip.h (original)
+++ llvm/trunk/include/llvm/Target/TargetRecip.h Mon May 9 18:11:38 2016
@@ -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
Modified: llvm/trunk/lib/DebugInfo/PDB/Raw/ByteStream.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/Raw/ByteStream.cpp?rev=268989&r1=268988&r2=268989&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/Raw/ByteStream.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/Raw/ByteStream.cpp Mon May 9 18:11:38 2016
@@ -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;
Modified: llvm/trunk/lib/DebugInfo/Symbolize/DIPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/Symbolize/DIPrinter.cpp?rev=268989&r1=268988&r2=268989&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/Symbolize/DIPrinter.cpp (original)
+++ llvm/trunk/lib/DebugInfo/Symbolize/DIPrinter.cpp Mon May 9 18:11:38 2016
@@ -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 <algorithm>
+#include <cmath>
+#include <cstddef>
+#include <cstdint>
+#include <memory>
+#include <string>
namespace llvm {
namespace symbolize {
@@ -61,7 +71,7 @@ void DIPrinter::print(const DILineInfo &
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 D
return *this;
}
-}
-}
+} // end namespace symbolize
+} // end namespace llvm
More information about the llvm-commits
mailing list