From bfb4b3275371a3b53cd6562fa06e5a9dfb5627b7 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 6 Dec 2024 09:43:19 +0100 Subject: pkg/compiler: add automatic meta Mark the whole file with "meta automatic" instead of marking each syscall. This reduces size of descriptions + allows to do special things with the whole file (e.g. we already treat auto consts specially). --- pkg/compiler/compiler.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'pkg/compiler/compiler.go') diff --git a/pkg/compiler/compiler.go b/pkg/compiler/compiler.go index fa23ce6bf..713c21b08 100644 --- a/pkg/compiler/compiler.go +++ b/pkg/compiler/compiler.go @@ -7,7 +7,6 @@ package compiler import ( "fmt" - "path/filepath" "strconv" "strings" @@ -140,7 +139,7 @@ type compiler struct { structTypes map[string]prog.Type structFiles map[*ast.Struct]map[string]ast.Pos builtinConsts map[string]uint64 - fileMeta map[string]Meta + fileMetas map[string]Meta recursiveQuery map[ast.Node]bool } @@ -159,13 +158,9 @@ func (comp *compiler) warning(pos ast.Pos, msg string, args ...interface{}) { } func (comp *compiler) filterArch() { - if comp.fileMeta == nil { - comp.fileMeta = comp.fileList() - } comp.desc = comp.desc.Filter(func(n ast.Node) bool { pos, typ, name := n.Info() - meta := comp.fileMeta[filepath.Base(pos.File)] - if meta.SupportsArch(comp.target.Arch) { + if comp.fileMeta(pos).SupportsArch(comp.target.Arch) { return true } switch n.(type) { -- cgit mrf-deployment