forked from OSchip/llvm-project
Replace LLVM_ALIGNAS with alignas as a follow-up of r337330
The minimum required GCC version was raised to 4.8 (which started to support alignas) in r284497. llvm-svn: 338099
This commit is contained in:
parent
1cb062b041
commit
a8301fce51
|
@ -1974,7 +1974,7 @@ const uint32_t PPC_THREAD_STATE_COUNT =
|
|||
#define LOAD_COMMAND_STRUCT(LCStruct) LCStruct LCStruct##_data;
|
||||
|
||||
LLVM_PACKED_START
|
||||
union LLVM_ALIGNAS(4) macho_load_command {
|
||||
union alignas(4) macho_load_command {
|
||||
#include "llvm/BinaryFormat/MachO.def"
|
||||
};
|
||||
LLVM_PACKED_END
|
||||
|
|
|
@ -1021,7 +1021,7 @@ template <> inline uint64_t getMagic<uint32_t>() {
|
|||
// compiler-rt/lib/profile/InstrProfiling.h.
|
||||
// It should also match the synthesized type in
|
||||
// Transforms/Instrumentation/InstrProfiling.cpp:getOrCreateRegionCounters.
|
||||
template <class IntPtrT> struct LLVM_ALIGNAS(8) ProfileData {
|
||||
template <class IntPtrT> struct alignas(8) ProfileData {
|
||||
#define INSTR_PROF_DATA(Type, LLVMType, Name, Init) Type Name;
|
||||
#include "llvm/ProfileData/InstrProfData.inc"
|
||||
};
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace llvm {
|
|||
|
||||
template<std::size_t Alignment, std::size_t Size>
|
||||
struct AlignedCharArray {
|
||||
LLVM_ALIGNAS(Alignment) char buffer[Size];
|
||||
alignas(Alignment) char buffer[Size];
|
||||
};
|
||||
|
||||
#else // _MSC_VER
|
||||
|
|
|
@ -89,25 +89,25 @@ protected:
|
|||
};
|
||||
|
||||
/// This helper template works-around MSVC 2013's lack of useful
|
||||
/// alignas() support. The argument to LLVM_ALIGNAS(), in MSVC, is
|
||||
/// alignas() support. The argument to alignas(), in MSVC, is
|
||||
/// required to be a literal integer. But, you *can* use template
|
||||
/// specialization to select between a bunch of different LLVM_ALIGNAS
|
||||
/// specialization to select between a bunch of different alignas()
|
||||
/// expressions...
|
||||
template <int Align>
|
||||
class TrailingObjectsAligner : public TrailingObjectsBase {};
|
||||
template <>
|
||||
class LLVM_ALIGNAS(1) TrailingObjectsAligner<1> : public TrailingObjectsBase {};
|
||||
class alignas(1) TrailingObjectsAligner<1> : public TrailingObjectsBase {};
|
||||
template <>
|
||||
class LLVM_ALIGNAS(2) TrailingObjectsAligner<2> : public TrailingObjectsBase {};
|
||||
class alignas(2) TrailingObjectsAligner<2> : public TrailingObjectsBase {};
|
||||
template <>
|
||||
class LLVM_ALIGNAS(4) TrailingObjectsAligner<4> : public TrailingObjectsBase {};
|
||||
class alignas(4) TrailingObjectsAligner<4> : public TrailingObjectsBase {};
|
||||
template <>
|
||||
class LLVM_ALIGNAS(8) TrailingObjectsAligner<8> : public TrailingObjectsBase {};
|
||||
class alignas(8) TrailingObjectsAligner<8> : public TrailingObjectsBase {};
|
||||
template <>
|
||||
class LLVM_ALIGNAS(16) TrailingObjectsAligner<16> : public TrailingObjectsBase {
|
||||
class alignas(16) TrailingObjectsAligner<16> : public TrailingObjectsBase {
|
||||
};
|
||||
template <>
|
||||
class LLVM_ALIGNAS(32) TrailingObjectsAligner<32> : public TrailingObjectsBase {
|
||||
class alignas(32) TrailingObjectsAligner<32> : public TrailingObjectsBase {
|
||||
};
|
||||
|
||||
// Just a little helper for transforming a type pack into the same
|
||||
|
|
|
@ -65,7 +65,7 @@ class GlobalsAAResult::FunctionInfo {
|
|||
/// Build a wrapper struct that has 8-byte alignment. All heap allocations
|
||||
/// should provide this much alignment at least, but this makes it clear we
|
||||
/// specifically rely on this amount of alignment.
|
||||
struct LLVM_ALIGNAS(8) AlignedMap {
|
||||
struct alignas(8) AlignedMap {
|
||||
AlignedMap() {}
|
||||
AlignedMap(const AlignedMap &Arg) : Map(Arg.Map) {}
|
||||
GlobalInfoMapType Map;
|
||||
|
|
Loading…
Reference in New Issue