[clang] [clang][bytecode] Lazily create DynamicAllocator (PR #155831)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 28 22:12:53 PDT 2025


================
@@ -164,7 +170,7 @@ class InterpState final : public State, public SourceMapper {
   /// Reference to the offset-source mapping.
   SourceMapper *M;
   /// Allocator used for dynamic allocations performed via the program.
-  DynamicAllocator Alloc;
+  std::unique_ptr<DynamicAllocator> Alloc;
----------------
tbaederr wrote:

That causes problems because of
```c++
  DynamicAllocator() = default;
  DynamicAllocator(DynamicAllocator &) = delete;
  DynamicAllocator(DynamicAllocator &&) = delete;
```
But I'd kinda like to keep those so we avoid accidentally copying it :thinking: 

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


More information about the cfe-commits mailing list