From 8b626e6ea7e98887fbd48e3c55216fdd9327fac6 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Thu, 15 Aug 2024 19:55:39 +0200 Subject: compiler: add support for Go 1.23 range-over-func --- compiler/compiler.go | 2 +- compiler/symbol.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'compiler') diff --git a/compiler/compiler.go b/compiler/compiler.go index bc17250d9..201605d78 100644 --- a/compiler/compiler.go +++ b/compiler/compiler.go @@ -1963,7 +1963,7 @@ func (b *builder) getValue(expr ssa.Value, pos token.Pos) llvm.Value { return value } else { // indicates a compiler bug - panic("local has not been parsed: " + expr.String()) + panic("SSA value not previously found in function: " + expr.String()) } } } diff --git a/compiler/symbol.go b/compiler/symbol.go index 37c987859..29f009520 100644 --- a/compiler/symbol.go +++ b/compiler/symbol.go @@ -218,7 +218,7 @@ func (c *compilerContext) getFunction(fn *ssa.Function) (llvm.Type, llvm.Value) // should be created right away. // The exception is the package initializer, which does appear in the // *ssa.Package members and so shouldn't be created here. - if fn.Synthetic != "" && fn.Synthetic != "package initializer" && fn.Synthetic != "generic function" { + if fn.Synthetic != "" && fn.Synthetic != "package initializer" && fn.Synthetic != "generic function" && fn.Synthetic != "range-over-func yield" { irbuilder := c.ctx.NewBuilder() b := newBuilder(c, irbuilder, fn) b.createFunction() -- cgit v1.2.3