Skip to content

Commit 1503db8

Browse files
committed
[clang][NFC] Refactor bit-fields in RawComment
Make them all of the same `unsigned` type, which brings `sizeof(RawComment)` down from 12 to 4 when compiling Clang for Microsoft ABI.
1 parent fe0d277 commit 1503db8

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

clang/include/clang/AST/RawCommentList.h

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,17 +175,22 @@ class RawComment {
175175
mutable StringRef RawText;
176176
mutable const char *BriefText = nullptr;
177177

178-
mutable bool RawTextValid : 1; ///< True if RawText is valid
179-
mutable bool BriefTextValid : 1; ///< True if BriefText is valid
178+
LLVM_PREFERRED_TYPE(bool)
179+
mutable unsigned RawTextValid : 1;
180+
LLVM_PREFERRED_TYPE(bool)
181+
mutable unsigned BriefTextValid : 1;
180182

181183
LLVM_PREFERRED_TYPE(CommentKind)
182184
unsigned Kind : 3;
183185

184186
/// True if comment is attached to a declaration in ASTContext.
185-
bool IsAttached : 1;
187+
LLVM_PREFERRED_TYPE(bool)
188+
unsigned IsAttached : 1;
186189

187-
bool IsTrailingComment : 1;
188-
bool IsAlmostTrailingComment : 1;
190+
LLVM_PREFERRED_TYPE(bool)
191+
unsigned IsTrailingComment : 1;
192+
LLVM_PREFERRED_TYPE(bool)
193+
unsigned IsAlmostTrailingComment : 1;
189194

190195
/// Constructor for AST deserialization.
191196
RawComment(SourceRange SR, CommentKind K, bool IsTrailingComment,

0 commit comments

Comments
 (0)