diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2024-12-06 09:43:19 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2024-12-11 15:22:17 +0000 |
| commit | bfb4b3275371a3b53cd6562fa06e5a9dfb5627b7 (patch) | |
| tree | 36d9f70965d8cf1080480c0d56de0b49f096cae5 /pkg/compiler/compiler.go | |
| parent | a9a0ffed7ef93dd86695100cf081438a918d6026 (diff) | |
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).
Diffstat (limited to 'pkg/compiler/compiler.go')
| -rw-r--r-- | pkg/compiler/compiler.go | 9 |
1 files changed, 2 insertions, 7 deletions
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) { |
