[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:45 PDT 2026


================
@@ -1996,9 +1997,25 @@ bool PtrPtrCast(InterpState &S, CodePtr OpPC, bool SrcIsVoidPtr,
   return true;
 }
 
-static void compileFunction(InterpState &S, const Function *Func) {
+static void compileFunction(InterpState &S, const Function *Func,
+                            CodePtr OpPC) {
+  const FunctionDecl *Fn = Func->getDecl()->getMostRecentDecl();
----------------
katzdm wrote:

Yep, good call.

Since the problem addressed by the walk to the most recent decl is that the decl gets classified as implicitly instantiable, I'm going to try moving this into `FunctionDefinitionCanBeLazilyInstantiated` instead. We'll see if tests pass.

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


More information about the cfe-commits mailing list