@@ -1103,14 +1103,14 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
11031103 assert (TI.getCharWidth () == 8 && " Only support 8-bit char so far" );
11041104 Builder.defineMacro (" __CHAR_BIT__" , Twine (TI.getCharWidth ()));
11051105
1106- // The macro is specifying the number of bits in the value representation,
1107- // not the number of bits in the object representation, which is what
1108- // getBoolWidth() will return. For the bool/_Bool data type, there is only
1109- // ever one bit in the value representation . See C23 6.2.6.2p2 for the rules
1110- // in C. Note that [basic.fundamental]p10 allows an implementation-defined
1111- // value representation for bool; Clang represents bool as an i1 when
1112- // lowering to LLVM, so this value is also correct for C++ for our
1113- // implementation.
1106+ // The macro is specifying the number of bits in the width, not the number of
1107+ // bits the object requires for its in-memory representation, which is what
1108+ // getBoolWidth() will return. The bool/_Bool data type is only ever one bit
1109+ // wide . See C23 6.2.6.2p2 for the rules in C. Note that
1110+ // C++23 [basic.fundamental]p10 allows an implementation-defined value
1111+ // representation for bool; when lowing to LLVM, Clang represents bool as an
1112+ // i8 in memory but as an i1 needing the value, so '1' is also correct for
1113+ // C++ for our implementation.
11141114 Builder.defineMacro (" __BOOL_WIDTH__" , " 1" );
11151115 Builder.defineMacro (" __SHRT_WIDTH__" , Twine (TI.getShortWidth ()));
11161116 Builder.defineMacro (" __INT_WIDTH__" , Twine (TI.getIntWidth ()));
0 commit comments