[clang] [CIR] Upstream EHScopeStack memory allocator (PR #152215)
Henrich Lauko via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 7 00:08:13 PDT 2025
================
@@ -42,7 +42,47 @@ enum CleanupKind : unsigned {
/// A stack of scopes which respond to exceptions, including cleanups
/// and catch blocks.
class EHScopeStack {
+ friend class CIRGenFunction;
+
public:
+ // TODO(ogcg): Switch to alignof(uint64_t) instead of 8
+ enum { ScopeStackAlignment = 8 };
+
+ /// A saved depth on the scope stack. This is necessary because
+ /// pushing scopes onto the stack invalidates iterators.
+ class stable_iterator {
+ friend class EHScopeStack;
+
+ /// Offset from startOfData to endOfBuffer.
+ ptrdiff_t size;
----------------
xlauko wrote:
```suggestion
ptrdiff_t size = -1;
```
https://github.com/llvm/llvm-project/pull/152215
More information about the cfe-commits
mailing list