[clang] [CIR] Upstream EHScopeStack memory allocator (PR #152215)

Henrich Lauko via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 7 00:05:10 PDT 2025


================
@@ -0,0 +1,43 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// These classes support the generation of CIR for cleanups, initially based
+// on LLVM IR cleanup handling, but ought to change as CIR evolves.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef CLANG_LIB_CIR_CODEGEN_CGCLEANUP_H
+#define CLANG_LIB_CIR_CODEGEN_CGCLEANUP_H
+
+#include "EHScopeStack.h"
+
+namespace clang::CIRGen {
+
+/// A non-stable pointer into the scope stack.
+class EHScopeStack::iterator {
+  char *ptr;
----------------
xlauko wrote:

```suggestion
  char *ptr = nullptr;
```

https://github.com/llvm/llvm-project/pull/152215


More information about the cfe-commits mailing list