aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/compiler/compiler.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2024-11-13 13:40:58 +0100
committerDmitry Vyukov <dvyukov@google.com>2024-11-13 15:00:09 +0000
commitc22c6600ea5172145e20d546d9856421eaee0527 (patch)
tree594aa44ead8e823e0f82d4cbf814c429d35ba248 /pkg/compiler/compiler.go
parent354ef1b79576274b4f240cee74dc43cecdbbd0db (diff)
pkg/compiler: add consts to all files that mention them
We already do this in most cases except for template structs (nlattr notably). Add consts that are used in template structs to all files that use them. This helps to avoid flakiness, and allows to replace descriptions files with other descriptions files without regenerating all const files. This also fixes check for presence of descriptions for sys/linux/auto.txt.json.
Diffstat (limited to 'pkg/compiler/compiler.go')
-rw-r--r--pkg/compiler/compiler.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/pkg/compiler/compiler.go b/pkg/compiler/compiler.go
index e5988f03e..3f10ae5fe 100644
--- a/pkg/compiler/compiler.go
+++ b/pkg/compiler/compiler.go
@@ -64,6 +64,7 @@ func createCompiler(desc *ast.Description, target *targets.Target, eh ast.ErrorH
brokenTypedefs: make(map[string]bool),
structVarlen: make(map[string]bool),
structTypes: make(map[string]prog.Type),
+ structFiles: make(map[*ast.Struct]map[string]ast.Pos),
builtinConsts: map[string]uint64{
"PTR_SIZE": target.PtrSize,
},
@@ -136,6 +137,7 @@ type compiler struct {
structVarlen map[string]bool
structTypes map[string]prog.Type
+ structFiles map[*ast.Struct]map[string]ast.Pos
builtinConsts map[string]uint64
fileMeta map[string]Meta
}