summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorEugene Zelenko <eugene.zelenko@gmail.com>2016-03-28 17:40:08 +0000
committerEugene Zelenko <eugene.zelenko@gmail.com>2016-03-28 17:40:08 +0000
commit35623fb7d5dae3622c0106424c3655b0358bc766 (patch)
treea129a20bcf6a5a233354e51c24ceb837f747b902 /llvm/include
parent0509ef7f93f573f50af7eed6b1f8aa04784105cc (diff)
downloadbcm5719-llvm-35623fb7d5dae3622c0106424c3655b0358bc766.tar.gz
bcm5719-llvm-35623fb7d5dae3622c0106424c3655b0358bc766.zip
Fix Clang-tidy modernize-deprecated-headers warnings in some files; other minor fixes.
Differential revision: http://reviews.llvm.org/D18469 llvm-svn: 264598
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm-c/Disassembler.h6
-rw-r--r--llvm/include/llvm-c/lto.h20
-rw-r--r--llvm/include/llvm/ADT/Statistic.h6
-rw-r--r--llvm/include/llvm/DebugInfo/PDB/PDBTypes.h16
-rw-r--r--llvm/include/llvm/Support/DataTypes.h.cmake20
-rw-r--r--llvm/include/llvm/Support/Valgrind.h12
-rw-r--r--llvm/include/llvm/Target/TargetCallingConv.h9
-rw-r--r--llvm/include/llvm/Transforms/IPO/LowerBitSets.h7
-rw-r--r--llvm/include/llvm/Transforms/IPO/WholeProgramDevirt.h11
9 files changed, 56 insertions, 51 deletions
diff --git a/llvm/include/llvm-c/Disassembler.h b/llvm/include/llvm-c/Disassembler.h
index d6cbe31cbb4..d6f92e505d3 100644
--- a/llvm/include/llvm-c/Disassembler.h
+++ b/llvm/include/llvm-c/Disassembler.h
@@ -16,7 +16,11 @@
#define LLVM_C_DISASSEMBLER_H
#include "llvm/Support/DataTypes.h"
+#ifdef __cplusplus
+#include <cstddef>
+#else
#include <stddef.h>
+#endif
/**
* @defgroup LLVMCDisassembler Disassembler
@@ -251,4 +255,4 @@ size_t LLVMDisasmInstruction(LLVMDisasmContextRef DC, uint8_t *Bytes,
}
#endif /* !defined(__cplusplus) */
-#endif /* !defined(LLVM_C_DISASSEMBLER_H) */
+#endif /* LLVM_C_DISASSEMBLER_H */
diff --git a/llvm/include/llvm-c/lto.h b/llvm/include/llvm-c/lto.h
index 88b10fdfbbb..42c280210a2 100644
--- a/llvm/include/llvm-c/lto.h
+++ b/llvm/include/llvm-c/lto.h
@@ -16,7 +16,11 @@
#ifndef LLVM_C_LTO_H
#define LLVM_C_LTO_H
+#ifdef __cplusplus
+#include <cstddef>
+#else
#include <stddef.h>
+#endif
#include <sys/types.h>
#ifndef __cplusplus
@@ -105,7 +109,6 @@ extern "C" {
extern const char*
lto_get_version(void);
-
/**
* Returns the last error string or NULL if last operation was successful.
*
@@ -122,7 +125,6 @@ lto_get_error_message(void);
extern lto_bool_t
lto_module_is_object_file(const char* path);
-
/**
* Checks if a file is a loadable object compiled for requested target.
*
@@ -132,7 +134,6 @@ extern lto_bool_t
lto_module_is_object_file_for_target(const char* path,
const char* target_triple_prefix);
-
/**
* Checks if a buffer is a loadable object file.
*
@@ -141,7 +142,6 @@ lto_module_is_object_file_for_target(const char* path,
extern lto_bool_t
lto_module_is_object_file_in_memory(const void* mem, size_t length);
-
/**
* Checks if a buffer is a loadable object compiled for requested target.
*
@@ -151,7 +151,6 @@ extern lto_bool_t
lto_module_is_object_file_in_memory_for_target(const void* mem, size_t length,
const char* target_triple_prefix);
-
/**
* Loads an object file from disk.
* Returns NULL on error (check lto_get_error_message() for details).
@@ -161,7 +160,6 @@ lto_module_is_object_file_in_memory_for_target(const void* mem, size_t length,
extern lto_module_t
lto_module_create(const char* path);
-
/**
* Loads an object file from memory.
* Returns NULL on error (check lto_get_error_message() for details).
@@ -254,7 +252,6 @@ lto_module_get_target_triple(lto_module_t mod);
extern void
lto_module_set_target_triple(lto_module_t mod, const char *triple);
-
/**
* Returns the number of symbols in the object module.
*
@@ -263,7 +260,6 @@ lto_module_set_target_triple(lto_module_t mod, const char *triple);
extern unsigned int
lto_module_get_num_symbols(lto_module_t mod);
-
/**
* Returns the name of the ith symbol in the object module.
*
@@ -272,7 +268,6 @@ lto_module_get_num_symbols(lto_module_t mod);
extern const char*
lto_module_get_symbol_name(lto_module_t mod, unsigned int index);
-
/**
* Returns the attributes of the ith symbol in the object module.
*
@@ -281,7 +276,6 @@ lto_module_get_symbol_name(lto_module_t mod, unsigned int index);
extern lto_symbol_attributes
lto_module_get_symbol_attribute(lto_module_t mod, unsigned int index);
-
/**
* Returns the module's linker options.
*
@@ -293,7 +287,6 @@ lto_module_get_symbol_attribute(lto_module_t mod, unsigned int index);
extern const char*
lto_module_get_linkeropts(lto_module_t mod);
-
/**
* Diagnostic severity.
*
@@ -395,7 +388,6 @@ lto_codegen_set_module(lto_code_gen_t cg, lto_module_t mod);
extern lto_bool_t
lto_codegen_set_debug_model(lto_code_gen_t cg, lto_debug_model);
-
/**
* Sets which PIC code model to generated.
* Returns true on error (check lto_get_error_message() for details).
@@ -405,7 +397,6 @@ lto_codegen_set_debug_model(lto_code_gen_t cg, lto_debug_model);
extern lto_bool_t
lto_codegen_set_pic_model(lto_code_gen_t cg, lto_codegen_model);
-
/**
* Sets the cpu to generate code for.
*
@@ -414,7 +405,6 @@ lto_codegen_set_pic_model(lto_code_gen_t cg, lto_codegen_model);
extern void
lto_codegen_set_cpu(lto_code_gen_t cg, const char *cpu);
-
/**
* Sets the location of the assembler tool to run. If not set, libLTO
* will use gcc to invoke the assembler.
@@ -773,4 +763,4 @@ extern void thinlto_codegen_add_cross_referenced_symbol(thinlto_code_gen_t cg,
* @}
*/
-#endif
+#endif /* LLVM_C_LTO_H */
diff --git a/llvm/include/llvm/ADT/Statistic.h b/llvm/include/llvm/ADT/Statistic.h
index 7c84e3ef6b4..57e7253c5c7 100644
--- a/llvm/include/llvm/ADT/Statistic.h
+++ b/llvm/include/llvm/ADT/Statistic.h
@@ -27,7 +27,7 @@
#define LLVM_ADT_STATISTIC_H
#include "llvm/Support/Atomic.h"
-#include "llvm/Support/Valgrind.h"
+#include "llvm/Support/Compiler.h"
#include <memory>
namespace llvm {
@@ -181,6 +181,6 @@ void PrintStatistics();
/// \brief Print statistics to the given output stream.
void PrintStatistics(raw_ostream &OS);
-} // End llvm namespace
+} // end llvm namespace
-#endif
+#endif // LLVM_ADT_STATISTIC_H
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBTypes.h b/llvm/include/llvm/DebugInfo/PDB/PDBTypes.h
index adec27a357d..7e39bebf576 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBTypes.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBTypes.h
@@ -14,7 +14,8 @@
#include "llvm/DebugInfo/CodeView/CodeView.h"
#include "llvm/Support/Endian.h"
#include <functional>
-#include <stdint.h>
+#include <cstdint>
+#include <cstring>
namespace llvm {
@@ -382,9 +383,11 @@ struct Variant {
uint64_t UInt64;
char *String;
} Value;
+
#define VARIANT_EQUAL_CASE(Enum) \
case PDB_VariantType::Enum: \
return Value.Enum == Other.Value.Enum;
+
bool operator==(const Variant &Other) const {
if (Type != Other.Type)
return false;
@@ -405,7 +408,9 @@ struct Variant {
return true;
}
}
+
#undef VARIANT_EQUAL_CASE
+
bool operator!=(const Variant &Other) const { return !(*this == Other); }
Variant &operator=(const Variant &Other) {
if (this == &Other)
@@ -450,9 +455,9 @@ struct SuperBlock {
// This contains the block # of the block map.
support::ulittle32_t BlockMapAddr;
};
-}
+} // end namespace PDB
-} // namespace llvm
+} // end namespace llvm
namespace std {
template <> struct hash<llvm::PDB_SymType> {
@@ -463,7 +468,6 @@ template <> struct hash<llvm::PDB_SymType> {
return std::hash<int>()(static_cast<int>(Arg));
}
};
-}
-
+} // end namespace std
-#endif
+#endif // LLVM_DEBUGINFO_PDB_PDBTYPES_H
diff --git a/llvm/include/llvm/Support/DataTypes.h.cmake b/llvm/include/llvm/Support/DataTypes.h.cmake
index cccd0bc5fef..71aa1ea1a8c 100644
--- a/llvm/include/llvm/Support/DataTypes.h.cmake
+++ b/llvm/include/llvm/Support/DataTypes.h.cmake
@@ -35,15 +35,23 @@
#include <math.h>
#endif
+#ifdef __cplusplus
+#include <cinttypes>
+#else
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#endif
+#endif
+#ifdef __cplusplus
+#include <cstdint>
+#else
#ifdef HAVE_STDINT_H
#include <stdint.h>
#else
#error "Compiler must provide an implementation of stdint.h"
#endif
+#endif
#ifndef _MSC_VER
@@ -79,14 +87,14 @@ typedef u_int64_t uint64_t;
#endif
#else /* _MSC_VER */
-#include <stdlib.h>
-#include <stddef.h>
-#include <sys/types.h>
#ifdef __cplusplus
-#include <cmath>
+#include <cstdlib>
+#include <cstddef>
#else
-#include <math.h>
+#include <stdlib.h>
+#include <stddef.h>
#endif
+#include <sys/types.h>
#if defined(_WIN64)
typedef signed __int64 ssize_t;
@@ -127,4 +135,4 @@ typedef signed int ssize_t;
#define HUGE_VALF (float)HUGE_VAL
#endif
-#endif /* SUPPORT_DATATYPES_H */
+#endif /* SUPPORT_DATATYPES_H */
diff --git a/llvm/include/llvm/Support/Valgrind.h b/llvm/include/llvm/Support/Valgrind.h
index 12b0dc961da..084b901b326 100644
--- a/llvm/include/llvm/Support/Valgrind.h
+++ b/llvm/include/llvm/Support/Valgrind.h
@@ -1,4 +1,4 @@
-//===- llvm/Support/Valgrind.h - Communication with Valgrind -----*- C++ -*-===//
+//===- llvm/Support/Valgrind.h - Communication with Valgrind ----*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -16,9 +16,7 @@
#ifndef LLVM_SUPPORT_VALGRIND_H
#define LLVM_SUPPORT_VALGRIND_H
-#include "llvm/Config/llvm-config.h"
-#include "llvm/Support/Compiler.h"
-#include <stddef.h>
+#include <cstddef>
namespace llvm {
namespace sys {
@@ -28,7 +26,7 @@ namespace sys {
// Discard valgrind's translation of code in the range [Addr .. Addr + Len).
// Otherwise valgrind may continue to execute the old version of the code.
void ValgrindDiscardTranslations(const void *Addr, size_t Len);
-}
-}
+} // namespace sys
+} // end namespace llvm
-#endif
+#endif // LLVM_SUPPORT_VALGRIND_H
diff --git a/llvm/include/llvm/Target/TargetCallingConv.h b/llvm/include/llvm/Target/TargetCallingConv.h
index 0c6c1f1468c..e906f1c83a3 100644
--- a/llvm/include/llvm/Target/TargetCallingConv.h
+++ b/llvm/include/llvm/Target/TargetCallingConv.h
@@ -18,7 +18,7 @@
#include "llvm/Support/DataTypes.h"
#include "llvm/Support/MathExtras.h"
#include <string>
-#include <limits.h>
+#include <limits>
namespace llvm {
@@ -60,6 +60,7 @@ namespace ISD {
static const uint64_t One = 1ULL; ///< 1 of this type, for shifts
uint64_t Flags;
+
public:
ArgFlagsTy() : Flags(0) { }
@@ -141,7 +142,7 @@ namespace ISD {
/// Index original Function's argument.
unsigned OrigArgIndex;
/// Sentinel value for implicit machine-level input arguments.
- static const unsigned NoArgIndex = UINT_MAX;
+ static const unsigned NoArgIndex = std::numeric_limits<uint32_t>::max();
/// Offset in bytes of current input value relative to the beginning of
/// original argument. E.g. if argument was splitted into four 32 bit
@@ -195,8 +196,8 @@ namespace ISD {
ArgVT = argvt;
}
};
-}
+} // end namespace ISD
} // end llvm namespace
-#endif
+#endif // LLVM_TARGET_TARGETCALLINGCONV_H
diff --git a/llvm/include/llvm/Transforms/IPO/LowerBitSets.h b/llvm/include/llvm/Transforms/IPO/LowerBitSets.h
index e5fb7b98fcb..4810e0b28b5 100644
--- a/llvm/include/llvm/Transforms/IPO/LowerBitSets.h
+++ b/llvm/include/llvm/Transforms/IPO/LowerBitSets.h
@@ -18,7 +18,8 @@
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallVector.h"
-#include <stdint.h>
+#include <cstdint>
+#include <cstring>
#include <limits>
#include <set>
#include <vector>
@@ -196,6 +197,6 @@ struct ByteArrayBuilder {
uint64_t &AllocByteOffset, uint8_t &AllocMask);
};
-} // namespace llvm
+} // end namespace llvm
-#endif
+#endif // LLVM_TRANSFORMS_IPO_LOWERBITSETS_H
diff --git a/llvm/include/llvm/Transforms/IPO/WholeProgramDevirt.h b/llvm/include/llvm/Transforms/IPO/WholeProgramDevirt.h
index e544bc6ec7d..0ac3f66c85f 100644
--- a/llvm/include/llvm/Transforms/IPO/WholeProgramDevirt.h
+++ b/llvm/include/llvm/Transforms/IPO/WholeProgramDevirt.h
@@ -16,11 +16,10 @@
#define LLVM_TRANSFORMS_IPO_WHOLEPROGRAMDEVIRT_H
#include "llvm/ADT/ArrayRef.h"
-#include "llvm/ADT/DenseMapInfo.h"
+#include <cassert>
+#include <cstdint>
#include <utility>
#include <vector>
-#include <assert.h>
-#include <stdint.h>
namespace llvm {
@@ -209,7 +208,7 @@ void setAfterReturnValues(MutableArrayRef<VirtualCallTarget> Targets,
uint64_t AllocAfter, unsigned BitWidth,
int64_t &OffsetByte, uint64_t &OffsetBit);
-}
-}
+} // end namespace wholeprogramdevirt
+} // end namespace llvm
-#endif
+#endif // LLVM_TRANSFORMS_IPO_WHOLEPROGRAMDEVIRT_H
OpenPOWER on IntegriCloud