[clang] 1ed3760 - [clang][NFC] Annotate `CGCleanup.h` with `preferred_type`
Vlad Serebrennikov via cfe-commits
cfe-commits at lists.llvm.org
Sun Feb 11 01:20:44 PST 2024
Author: Vlad Serebrennikov
Date: 2024-02-11T12:20:34+03:00
New Revision: 1ed37606ca4bda4659b33a7f570d273b5afd16ea
URL: https://github.com/llvm/llvm-project/commit/1ed37606ca4bda4659b33a7f570d273b5afd16ea
DIFF: https://github.com/llvm/llvm-project/commit/1ed37606ca4bda4659b33a7f570d273b5afd16ea.diff
LOG: [clang][NFC] Annotate `CGCleanup.h` with `preferred_type`
This helps debuggers to display values in bit-fields in a more helpful way.
Added:
Modified:
clang/lib/CodeGen/CGCleanup.h
Removed:
################################################################################
diff --git a/clang/lib/CodeGen/CGCleanup.h b/clang/lib/CodeGen/CGCleanup.h
index fcfbf41b0eaff5..7a7344c07160db 100644
--- a/clang/lib/CodeGen/CGCleanup.h
+++ b/clang/lib/CodeGen/CGCleanup.h
@@ -40,6 +40,10 @@ 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;
@@ -47,6 +51,7 @@ class EHScope {
class CommonBitFields {
friend class EHScope;
+ LLVM_PREFERRED_TYPE(Kind)
unsigned Kind : 3;
};
enum { NumCommonBits = 3 };
@@ -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.
@@ -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) {
More information about the cfe-commits
mailing list