tgo: Allow anonymous function declarations

Not sure why they're needed right now, though...
This commit is contained in:
Ayke van Laethem
2018-06-03 17:45:33 +02:00
parent 588910792d
commit 5fa39adb81
+8
View File
@@ -392,6 +392,14 @@ func (c *Compiler) parsePackage(program *ssa.Program, pkg *ssa.Package) error {
if member.Synthetic == "package initializer" {
c.initFuncs = append(c.initFuncs, frame.llvmFn)
}
// TODO: recursively anonymous functions
for _, child := range member.AnonFuncs {
frame, err := c.parseFuncDecl(child)
if err != nil {
return err
}
frames[child] = frame
}
case *ssa.NamedConst:
// Ignore package-level untyped constants. The SSA form doesn't need
// them.