Skip to content

Commit a4a3c18

Browse files
committed
Use consistent types for all bit-field members in the same bit-field so that MSVC's bit-field packing algorithm packs them properly.
llvm-svn: 256587
1 parent 67f1d3a commit a4a3c18

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

clang/include/clang/AST/Decl.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,25 +1558,25 @@ class FunctionDecl : public DeclaratorDecl, public DeclContext,
15581558

15591559
LazyDeclStmtPtr Body;
15601560

1561-
// FIXME: This can be packed into the bitfields in Decl.
1562-
// NOTE: VC++ treats enums as signed, avoid using the StorageClass enum
1561+
// FIXME: This can be packed into the bitfields in DeclContext.
1562+
// NOTE: VC++ packs bitfields poorly if the types differ.
15631563
unsigned SClass : 2;
1564-
bool IsInline : 1;
1565-
bool IsInlineSpecified : 1;
1566-
bool IsVirtualAsWritten : 1;
1567-
bool IsPure : 1;
1568-
bool HasInheritedPrototype : 1;
1569-
bool HasWrittenPrototype : 1;
1570-
bool IsDeleted : 1;
1571-
bool IsTrivial : 1; // sunk from CXXMethodDecl
1572-
bool IsDefaulted : 1; // sunk from CXXMethoDecl
1573-
bool IsExplicitlyDefaulted : 1; //sunk from CXXMethodDecl
1574-
bool HasImplicitReturnZero : 1;
1575-
bool IsLateTemplateParsed : 1;
1576-
bool IsConstexpr : 1;
1564+
unsigned IsInline : 1;
1565+
unsigned IsInlineSpecified : 1;
1566+
unsigned IsVirtualAsWritten : 1;
1567+
unsigned IsPure : 1;
1568+
unsigned HasInheritedPrototype : 1;
1569+
unsigned HasWrittenPrototype : 1;
1570+
unsigned IsDeleted : 1;
1571+
unsigned IsTrivial : 1; // sunk from CXXMethodDecl
1572+
unsigned IsDefaulted : 1; // sunk from CXXMethoDecl
1573+
unsigned IsExplicitlyDefaulted : 1; //sunk from CXXMethodDecl
1574+
unsigned HasImplicitReturnZero : 1;
1575+
unsigned IsLateTemplateParsed : 1;
1576+
unsigned IsConstexpr : 1;
15771577

15781578
/// \brief Indicates if the function uses __try.
1579-
bool UsesSEHTry : 1;
1579+
unsigned UsesSEHTry : 1;
15801580

15811581
/// \brief Indicates if the function was a definition but its body was
15821582
/// skipped.

0 commit comments

Comments
 (0)