Skip to content

Commit 3a2b2f2

Browse files
committed
More storage fixes
1 parent a28452d commit 3a2b2f2

File tree

13 files changed

+40
-22
lines changed

13 files changed

+40
-22
lines changed

clang/include/clang/AST/DeclTemplate.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1859,7 +1859,8 @@ class ClassTemplateSpecializationDecl : public CXXRecordDecl,
18591859
/// This needs to be cached as deduction is performed during declaration,
18601860
/// and we need the information to be preserved so that it is consistent
18611861
/// during instantiation.
1862-
bool StrictPackMatch : 1;
1862+
LLVM_PREFERRED_TYPE(bool)
1863+
unsigned StrictPackMatch : 1;
18631864

18641865
protected:
18651866
ClassTemplateSpecializationDecl(ASTContext &Context, Kind DK, TagKind TK,

clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
#include "llvm/ADT/ArrayRef.h"
5353
#include "llvm/ADT/StringRef.h"
5454
#include "llvm/Support/Casting.h"
55+
#include "llvm/Support/Compiler.h"
5556
#include "llvm/Support/raw_ostream.h"
5657
#include <algorithm>
5758
#include <cassert>
@@ -1664,7 +1665,8 @@ class BasicBlock : public SExpr {
16641665
unsigned BlockID : 31;
16651666

16661667
// Bit to determine if a block has been visited during a traversal.
1667-
bool Visited : 1;
1668+
LLVM_PREFERRED_TYPE(bool)
1669+
unsigned Visited : 1;
16681670

16691671
// Predecessor blocks in the CFG.
16701672
BlockArray Predecessors;

clang/include/clang/Sema/Overload.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,8 @@ class Sema;
980980
/// Have we matched any packs on the parameter side, versus any non-packs on
981981
/// the argument side, in a context where the opposite matching is also
982982
/// allowed?
983-
bool StrictPackMatch : 1;
983+
LLVM_PREFERRED_TYPE(bool)
984+
unsigned StrictPackMatch : 1;
984985

985986
/// True if the candidate was found using ADL.
986987
LLVM_PREFERRED_TYPE(CallExpr::ADLCallKind)
@@ -996,7 +997,8 @@ class Sema;
996997

997998
/// FailureKind - The reason why this candidate is not viable.
998999
/// Actually an OverloadFailureKind.
999-
unsigned char FailureKind;
1000+
LLVM_PREFERRED_TYPE(OverloadFailureKind)
1001+
unsigned FailureKind : 8;
10001002

10011003
/// The number of call arguments that were explicitly provided,
10021004
/// to be used while performing partial ordering of function templates.

clang/include/clang/Sema/ScopeInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ enum class FirstCoroutineStmtKind { CoReturn, CoAwait, CoYield };
103103
/// currently being parsed.
104104
class FunctionScopeInfo {
105105
protected:
106-
enum ScopeKind {
106+
enum ScopeKind : uint8_t {
107107
SK_Function,
108108
SK_Block,
109109
SK_Lambda,

clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "llvm/ADT/IntrusiveRefCntPtr.h"
2020
#include "llvm/ADT/StringMap.h"
2121
#include "llvm/ADT/StringRef.h"
22+
#include "llvm/Support/Compiler.h"
2223
#include <string>
2324
#include <utility>
2425
#include <vector>
@@ -269,7 +270,8 @@ class AnalyzerOptions {
269270
unsigned NoRetryExhausted : 1;
270271

271272
/// Emit analyzer warnings as errors.
272-
bool AnalyzerWerror : 1;
273+
LLVM_PREFERRED_TYPE(bool)
274+
unsigned AnalyzerWerror : 1;
273275

274276
/// The inlining stack depth limit.
275277
unsigned InlineMaxStackDepth;

clang/lib/Basic/DiagnosticIDs.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,18 @@ enum DiagnosticClass {
7474
struct StaticDiagInfoRec {
7575
uint16_t DiagID;
7676
LLVM_PREFERRED_TYPE(diag::Severity)
77-
uint8_t DefaultSeverity : 3;
77+
uint16_t DefaultSeverity : 3;
7878
LLVM_PREFERRED_TYPE(DiagnosticClass)
79-
uint8_t Class : 3;
79+
uint16_t Class : 3;
8080
LLVM_PREFERRED_TYPE(DiagnosticIDs::SFINAEResponse)
81-
uint8_t SFINAE : 2;
82-
uint8_t Category : 6;
81+
uint16_t SFINAE : 2;
82+
uint16_t Category : 6;
8383
LLVM_PREFERRED_TYPE(bool)
84-
uint8_t WarnNoWerror : 1;
84+
uint16_t WarnNoWerror : 1;
8585
LLVM_PREFERRED_TYPE(bool)
86-
uint8_t WarnShowInSystemHeader : 1;
86+
uint16_t WarnShowInSystemHeader : 1;
8787
LLVM_PREFERRED_TYPE(bool)
88-
uint8_t WarnShowInSystemMacro : 1;
88+
uint16_t WarnShowInSystemMacro : 1;
8989

9090
uint16_t OptionGroupIndex : 15;
9191
LLVM_PREFERRED_TYPE(bool)

llvm/include/llvm/CodeGen/MachineInstr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class MachineInstr
149149
/// Various bits of information used by the AsmPrinter to emit helpful
150150
/// comments. This is *not* semantic information. Do not use this for
151151
/// anything other than to convey comment information to AsmPrinter.
152-
uint8_t AsmPrinterFlags : LLVM_MI_ASMPRINTERFLAGS_BITS;
152+
uint32_t AsmPrinterFlags : LLVM_MI_ASMPRINTERFLAGS_BITS;
153153

154154
/// Internal implementation detail class that provides out-of-line storage for
155155
/// extra info used by the machine instruction when this info cannot be stored

llvm/include/llvm/Support/MathExtras.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ template <typename T, typename U, typename = enableif_int<T, U>>
4040
using common_sint =
4141
std::common_type_t<std::make_signed_t<T>, std::make_signed_t<U>>;
4242

43+
#pragma GCC diagnostic push
44+
#pragma GCC diagnostic ignored "-Wc++17-extensions"
45+
4346
/// Mathematical constants.
4447
namespace numbers {
4548
// TODO: Track C++20 std::numbers.
@@ -77,6 +80,8 @@ constexpr float ef = 0x1.5bf0a8P+1F, // (2.71828183) https://oeis.org/A
7780
// clang-format on
7881
} // namespace numbers
7982

83+
#pragma GCC diagnostic pop
84+
8085
/// Create a bitmask with the N right-most bits set to 1, and all other
8186
/// bits set to 0. Only unsigned types are allowed.
8287
template <typename T> T maskTrailingOnes(unsigned N) {

llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ class LLVM_LIBRARY_VISIBILITY CodeViewDebug : public DebugHandlerBase {
6363
int DataOffset : 31;
6464

6565
/// Non-zero if this is a piece of an aggregate.
66-
uint16_t IsSubfield : 1;
66+
uint32_t IsSubfield : 1;
6767

6868
/// Offset into aggregate.
69-
uint16_t StructOffset : 15;
69+
uint32_t StructOffset : 15;
7070

7171
/// Register containing the data or the register base of the memory
7272
/// location containing the data.

llvm/lib/Target/AArch64/AArch64CollectLOH.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,12 @@ static int mapRegToGPRIndex(MCRegister Reg) {
272272
/// datastructure for each tracked general purpose register.
273273
struct LOHInfo {
274274
MCLOHType Type : 8; ///< "Best" type of LOH possible.
275-
bool IsCandidate : 1; ///< Possible LOH candidate.
276-
bool OneUser : 1; ///< Found exactly one user (yet).
277-
bool MultiUsers : 1; ///< Found multiple users.
275+
LLVM_PREFERRED_TYPE(bool)
276+
unsigned IsCandidate : 1; ///< Possible LOH candidate.
277+
LLVM_PREFERRED_TYPE(bool)
278+
unsigned OneUser : 1; ///< Found exactly one user (yet).
279+
LLVM_PREFERRED_TYPE(bool)
280+
unsigned MultiUsers : 1; ///< Found multiple users.
278281
const MachineInstr *MI0; ///< First instruction involved in the LOH.
279282
const MachineInstr *MI1; ///< Second instruction involved in the LOH
280283
/// (if any).

0 commit comments

Comments
 (0)