compiler: add support for Go 1.23 range-over-func

This commit is contained in:
Ayke van Laethem
2024-08-15 19:55:39 +02:00
committed by Ron Evans
parent 1d1f4fc401
commit 8b626e6ea7
6 changed files with 37 additions and 2 deletions
+1 -1
View File
@@ -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())
}
}
}
+1 -1
View File
@@ -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()