[clang] [Clang] Instantiate functions from constant evaluation. (PR #205557)

Daniel M. Katz via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 26 08:51:43 PDT 2026


================
@@ -191,6 +194,8 @@ class Context final {
 
   /// Current compilation context.
   ASTContext &Ctx;
+  /// Current proxy to language semantics.
+  SemaProxy *Sema;
----------------
katzdm wrote:

@tbaederr As of [this PR](https://github.com/llvm/llvm-project/pull/198062/), there is now a constructor overload of `InterpState` that has no `State &Parent` argument - consequently, there is no easy means of obtaining the `SemaProxy *` within that constructor. I could either
- Add an explicit `SemaProxy *` argument to that constructor, though that seems to spiral out to require an explicit `SemaProxy *` argument for `EvalEmitter`, `ByteCodeEmitter`, `Compiler`, etc.
- Move the `SemaProxy *` back into `Context` (as I previously had here).
- Or perhaps I don't need to worry about it, if the new constructor for `InterpState` will never be used with an evaluation that might need to instantiate.

Ultimately, I'm still wrapping my head around the abstractions in the bytecode interpreter - some guidance here would be much appreciated.

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


More information about the cfe-commits mailing list