Skip to content

Commit 4ce0bd0

Browse files
committed
NFC: Disable clang-format for inline bitfields
clang-format tries to impose the wrong formatting on these, so let's disable it for these blocks.
1 parent 23e2f34 commit 4ce0bd0

File tree

6 files changed

+14
-0
lines changed

6 files changed

+14
-0
lines changed

include/swift/AST/Attr.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ class DeclAttribute : public AttributeBase {
101101
friend class TypeAttributes;
102102

103103
protected:
104+
// clang-format off
104105
union {
105106
uint64_t OpaqueBits;
106107

@@ -178,6 +179,7 @@ class DeclAttribute : public AttributeBase {
178179
isCategoryNameInvalid : 1
179180
);
180181
} Bits;
182+
// clang-format on
181183

182184
DeclAttribute *Next = nullptr;
183185

include/swift/AST/Expr.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ class alignas(8) Expr : public ASTAllocated<Expr> {
139139
void operator=(const Expr&) = delete;
140140

141141
protected:
142+
// clang-format off
142143
union { uint64_t OpaqueBits;
143144

144145
SWIFT_INLINE_BITFIELD_BASE(Expr, bitmax(NumExprKindBits,8)+1,
@@ -371,6 +372,7 @@ class alignas(8) Expr : public ASTAllocated<Expr> {
371372
);
372373

373374
} Bits;
375+
// clang-format on
374376

375377
private:
376378
/// Ty - This is the type of the expression.

include/swift/AST/Stmt.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ class alignas(8) Stmt : public ASTAllocated<Stmt> {
6363
Stmt& operator=(const Stmt&) = delete;
6464

6565
protected:
66+
// clang-format off
6667
union { uint64_t OpaqueBits;
6768

6869
SWIFT_INLINE_BITFIELD_BASE(Stmt, bitmax(NumStmtKindBits,8) + 1,
@@ -101,6 +102,7 @@ class alignas(8) Stmt : public ASTAllocated<Stmt> {
101102
);
102103

103104
} Bits;
105+
// clang-format on
104106

105107
/// Return the given value for the 'implicit' flag if present, or if None,
106108
/// return true if the location is invalid.

include/swift/AST/TypeRepr.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ class alignas(1 << TypeReprAlignInBits) TypeRepr
6060
void operator=(const TypeRepr&) = delete;
6161

6262
protected:
63+
// clang-format off
6364
union { uint64_t OpaqueBits;
6465

6566
SWIFT_INLINE_BITFIELD_BASE(TypeRepr, bitmax(NumTypeReprKindBits,8)+1+1,
@@ -108,6 +109,7 @@ class alignas(1 << TypeReprAlignInBits) TypeRepr
108109
);
109110

110111
} Bits;
112+
// clang-format on
111113

112114
TypeRepr(TypeReprKind K) {
113115
Bits.OpaqueBits = 0;

include/swift/AST/Types.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,8 @@ class alignas(1 << TypeAlignInBits) TypeBase
375375
protected:
376376
enum { NumAFTExtInfoBits = 11 };
377377
enum { NumSILExtInfoBits = 11 };
378+
379+
// clang-format off
378380
union { uint64_t OpaqueBits;
379381

380382
SWIFT_INLINE_BITFIELD_BASE(TypeBase, bitmax(NumTypeKindBits,8) +
@@ -501,6 +503,7 @@ class alignas(1 << TypeAlignInBits) TypeBase
501503
);
502504

503505
} Bits;
506+
// clang-format on
504507

505508
protected:
506509
TypeBase(TypeKind kind, const ASTContext *CanTypeCtx,

lib/IRGen/TypeInfo.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ class TypeInfo {
9595
friend class TypeConverter;
9696

9797
protected:
98+
// clang-format off
9899
union {
99100
uint64_t OpaqueBits;
100101

@@ -143,6 +144,8 @@ class TypeInfo {
143144
Size : 32
144145
);
145146
} Bits;
147+
// clang-format on
148+
146149
enum { InvalidSubclassKind = 0x7 };
147150

148151
TypeInfo(llvm::Type *Type, Alignment A, IsTriviallyDestroyable_t pod,

0 commit comments

Comments
 (0)