OSDN Git Service

Replace LLVM_ALIGNAS with alignas as a follow-up of r337330
authorFangrui Song <maskray@google.com>
Fri, 27 Jul 2018 05:38:14 +0000 (05:38 +0000)
committerFangrui Song <maskray@google.com>
Fri, 27 Jul 2018 05:38:14 +0000 (05:38 +0000)
The minimum required GCC version was raised to 4.8 (which started to support alignas) in r284497.

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

include/llvm/BinaryFormat/MachO.h
include/llvm/ProfileData/InstrProf.h
include/llvm/Support/AlignOf.h
include/llvm/Support/TrailingObjects.h
lib/Analysis/GlobalsModRef.cpp

index 2eacc6d..c5294c7 100644 (file)
@@ -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
index dd440c6..206142b 100644 (file)
@@ -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"
 };
index 5186ce0..9e7a62b 100644 (file)
@@ -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
index cb5a52b..490bd94 100644 (file)
@@ -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
index 44d61a9..197aee9 100644 (file)
@@ -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;