Skip to content

Commit

Permalink
[clang][NFC] Annotate CGCleanup.h with preferred_type
Browse files Browse the repository at this point in the history
This helps debuggers to display values in bit-fields in a more helpful way.
  • Loading branch information
Endilll committed Feb 11, 2024
1 parent 866e073 commit 1ed3760
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions clang/lib/CodeGen/CGCleanup.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,18 @@ struct CatchTypeInfo {

/// A protected scope for zero-cost EH handling.
class EHScope {
public:
enum Kind { Cleanup, Catch, Terminate, Filter };

private:
llvm::BasicBlock *CachedLandingPad;
llvm::BasicBlock *CachedEHDispatchBlock;

EHScopeStack::stable_iterator EnclosingEHScope;

class CommonBitFields {
friend class EHScope;
LLVM_PREFERRED_TYPE(Kind)
unsigned Kind : 3;
};
enum { NumCommonBits = 3 };
Expand All @@ -64,21 +69,27 @@ class EHScope {
unsigned : NumCommonBits;

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

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

/// Whether this cleanup is currently active.
LLVM_PREFERRED_TYPE(bool)
unsigned IsActive : 1;

/// Whether this cleanup is a lifetime marker
LLVM_PREFERRED_TYPE(bool)
unsigned IsLifetimeMarker : 1;

/// Whether the normal cleanup should test the activation flag.
LLVM_PREFERRED_TYPE(bool)
unsigned TestFlagInNormalCleanup : 1;

/// Whether the EH cleanup should test the activation flag.
LLVM_PREFERRED_TYPE(bool)
unsigned TestFlagInEHCleanup : 1;

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

public:
enum Kind { Cleanup, Catch, Terminate, Filter };

EHScope(Kind kind, EHScopeStack::stable_iterator enclosingEHScope)
: CachedLandingPad(nullptr), CachedEHDispatchBlock(nullptr),
EnclosingEHScope(enclosingEHScope) {
Expand Down

0 comments on commit 1ed3760

Please sign in to comment.