Skip to content

Commit 31e6a98

Browse files
authored
[NFC] Don't use LLVM_ALIGNAS (#26411)
It's not useful anymore, and I'm about to remove it in upstream.
1 parent a648714 commit 31e6a98

File tree

4 files changed

+9
-18
lines changed

4 files changed

+9
-18
lines changed

include/swift/ABI/TrailingObjects.h

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -97,27 +97,20 @@ class TrailingObjectsBase {
9797
template <typename T> struct OverloadToken {};
9898
};
9999

100-
/// This helper template works-around MSVC 2013's lack of useful
101-
/// alignas() support. The argument to LLVM_ALIGNAS(), in MSVC, is
102-
/// required to be a literal integer. But, you *can* use template
103-
/// specialization to select between a bunch of different LLVM_ALIGNAS
104-
/// expressions...
105100
template <int Align>
106101
class TrailingObjectsAligner : public TrailingObjectsBase {};
107102
template <>
108-
class LLVM_ALIGNAS(1) TrailingObjectsAligner<1> : public TrailingObjectsBase {};
103+
class alignas(1) TrailingObjectsAligner<1> : public TrailingObjectsBase {};
109104
template <>
110-
class LLVM_ALIGNAS(2) TrailingObjectsAligner<2> : public TrailingObjectsBase {};
105+
class alignas(2) TrailingObjectsAligner<2> : public TrailingObjectsBase {};
111106
template <>
112-
class LLVM_ALIGNAS(4) TrailingObjectsAligner<4> : public TrailingObjectsBase {};
107+
class alignas(4) TrailingObjectsAligner<4> : public TrailingObjectsBase {};
113108
template <>
114-
class LLVM_ALIGNAS(8) TrailingObjectsAligner<8> : public TrailingObjectsBase {};
109+
class alignas(8) TrailingObjectsAligner<8> : public TrailingObjectsBase {};
115110
template <>
116-
class LLVM_ALIGNAS(16) TrailingObjectsAligner<16> : public TrailingObjectsBase {
117-
};
111+
class alignas(16) TrailingObjectsAligner<16> : public TrailingObjectsBase {};
118112
template <>
119-
class LLVM_ALIGNAS(32) TrailingObjectsAligner<32> : public TrailingObjectsBase {
120-
};
113+
class alignas(32) TrailingObjectsAligner<32> : public TrailingObjectsBase {};
121114

122115
// Just a little helper for transforming a type pack into the same
123116
// number of a different type. e.g.:

include/swift/Basic/ExternalUnion.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ template <class Members>
104104
class BasicExternalUnion {
105105

106106
/// The value storage.
107-
LLVM_ALIGNAS(Members::Info::alignment)
108-
char Storage[Members::Info::size];
107+
alignas(Members::Info::alignment) char Storage[Members::Info::size];
109108

110109
template <class T>
111110
static constexpr int maybeIndexOfMember() {

include/swift/Basic/PrefixMap.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ class PrefixMap {
6666
private:
6767
template <typename T>
6868
union UninitializedStorage {
69-
LLVM_ALIGNAS(alignof(T))
70-
char Storage[sizeof(T)];
69+
alignas(T) char Storage[sizeof(T)];
7170

7271
template <typename... A>
7372
void emplace(A && ...value) {

stdlib/public/runtime/Metadata.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5034,7 +5034,7 @@ namespace {
50345034

50355035
// A statically-allocated pool. It's zero-initialized, so this
50365036
// doesn't cost us anything in binary size.
5037-
LLVM_ALIGNAS(alignof(void*)) static char InitialAllocationPool[64*1024];
5037+
alignas(void *) static char InitialAllocationPool[64 * 1024];
50385038
static std::atomic<PoolRange>
50395039
AllocationPool{PoolRange{InitialAllocationPool,
50405040
sizeof(InitialAllocationPool)}};

0 commit comments

Comments
 (0)