================ @@ -389,10 +390,29 @@ template <class Emitter> class LocalScope : public VariableScope<Emitter> { if (!Local.Desc->isPrimitive() && !Local.Desc->isPrimitiveArray()) { this->Ctx->emitGetPtrLocal(Local.Offset, SourceInfo{}); this->Ctx->emitRecordDestruction(Local.Desc); + removeIfStoredOpaqueValue(Local); } } } + void removeStoredOpaqueValues() { + if (!Idx) + return; + + for (const Scope::Local &Local : this->Ctx->Descriptors[*Idx]) { + removeIfStoredOpaqueValue(Local); + } + } + + void removeIfStoredOpaqueValue(const Scope::Local &Local) { + if (auto *OVE = + llvm::dyn_cast_if_present<OpaqueValueExpr>(Local.Desc->asExpr())) { + if (auto it = this->Ctx->OpaqueExprs.find(OVE); ---------------- tbaederr wrote:
```suggestion if (auto It = this->Ctx->OpaqueExprs.find(OVE); ``` https://github.com/llvm/llvm-project/pull/70053 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits