Skip to content

Commit 1ed3760

Browse files
committed
[clang][NFC] Annotate CGCleanup.h with preferred_type
This helps debuggers to display values in bit-fields in a more helpful way.
1 parent 866e073 commit 1ed3760

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

clang/lib/CodeGen/CGCleanup.h

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,18 @@ struct CatchTypeInfo {
4040

4141
/// A protected scope for zero-cost EH handling.
4242
class EHScope {
43+
public:
44+
enum Kind { Cleanup, Catch, Terminate, Filter };
45+
46+
private:
4347
llvm::BasicBlock *CachedLandingPad;
4448
llvm::BasicBlock *CachedEHDispatchBlock;
4549

4650
EHScopeStack::stable_iterator EnclosingEHScope;
4751

4852
class CommonBitFields {
4953
friend class EHScope;
54+
LLVM_PREFERRED_TYPE(Kind)
5055
unsigned Kind : 3;
5156
};
5257
enum { NumCommonBits = 3 };
@@ -64,21 +69,27 @@ class EHScope {
6469
unsigned : NumCommonBits;
6570

6671
/// Whether this cleanup needs to be run along normal edges.
72+
LLVM_PREFERRED_TYPE(bool)
6773
unsigned IsNormalCleanup : 1;
6874

6975
/// Whether this cleanup needs to be run along exception edges.
76+
LLVM_PREFERRED_TYPE(bool)
7077
unsigned IsEHCleanup : 1;
7178

7279
/// Whether this cleanup is currently active.
80+
LLVM_PREFERRED_TYPE(bool)
7381
unsigned IsActive : 1;
7482

7583
/// Whether this cleanup is a lifetime marker
84+
LLVM_PREFERRED_TYPE(bool)
7685
unsigned IsLifetimeMarker : 1;
7786

7887
/// Whether the normal cleanup should test the activation flag.
88+
LLVM_PREFERRED_TYPE(bool)
7989
unsigned TestFlagInNormalCleanup : 1;
8090

8191
/// Whether the EH cleanup should test the activation flag.
92+
LLVM_PREFERRED_TYPE(bool)
8293
unsigned TestFlagInEHCleanup : 1;
8394

8495
/// The amount of extra storage needed by the Cleanup.
@@ -101,8 +112,6 @@ class EHScope {
101112
};
102113

103114
public:
104-
enum Kind { Cleanup, Catch, Terminate, Filter };
105-
106115
EHScope(Kind kind, EHScopeStack::stable_iterator enclosingEHScope)
107116
: CachedLandingPad(nullptr), CachedEHDispatchBlock(nullptr),
108117
EnclosingEHScope(enclosingEHScope) {

0 commit comments

Comments
 (0)