From f29cfd2af39e27ffea851296d32ff37895647cac Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Fri, 21 Jun 2024 20:01:50 -0700 Subject: [PATCH] Clear funcation analysis cache before erasing. --- src/tcompiler.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tcompiler.cpp b/src/tcompiler.cpp index 2966cad7..1084845d 100644 --- a/src/tcompiler.cpp +++ b/src/tcompiler.cpp @@ -2028,6 +2028,9 @@ struct FunctionEmitter { cast(fstate->func->getEntryBlock().getTerminator()); Constant *r = dyn_cast(term->getReturnValue()); assert(r || !"constant expression was not constant"); +#if LLVM_VERSION >= 170 + CU->fam.clear(*fstate->func, fstate->func->getName()); +#endif fstate->func->eraseFromParent(); return r; }