From 58ae5e18624eaaac79cab00e63d6f32c9bd64ee0 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sun, 3 May 2020 11:29:12 +0200 Subject: prog: remove StructDesc Remove StructDesc, KeyedStruct, StructKey and all associated logic/complexity in prog and pkg/compiler. We can now handle recursion more generically with the Ref type, and Dir/FieldName are not a part of the type anymore. This makes StructType/UnionType simpler and more natural. Reduces size of sys/linux/gen/amd64.go from 5201321 to 4180861 (-20%). Update #1580 --- sys/syz-sysgen/sysgen.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'sys') diff --git a/sys/syz-sysgen/sysgen.go b/sys/syz-sysgen/sysgen.go index 1197a8cce..bf39ba9ee 100644 --- a/sys/syz-sysgen/sysgen.go +++ b/sys/syz-sysgen/sysgen.go @@ -189,20 +189,16 @@ func generate(target *targets.Target, prg *compiler.Prog, consts map[string]uint fmt.Fprintf(out, "\tRegisterTarget(&Target{"+ "OS: %q, Arch: %q, Revision: revision_%v, PtrSize: %v, "+ "PageSize: %v, NumPages: %v, DataOffset: %v, Syscalls: syscalls_%v, "+ - "Resources: resources_%v, Structs: structDescs_%v, Types: types_%v, Consts: consts_%v}, "+ + "Resources: resources_%v, Types: types_%v, Consts: consts_%v}, "+ "InitTarget)\n}\n\n", target.OS, target.Arch, target.Arch, target.PtrSize, target.PageSize, target.NumPages, target.DataOffset, - target.Arch, target.Arch, target.Arch, target.Arch, target.Arch) + target.Arch, target.Arch, target.Arch, target.Arch) fmt.Fprintf(out, "var resources_%v = ", target.Arch) serializer.Write(out, prg.Resources) fmt.Fprintf(out, "\n\n") - fmt.Fprintf(out, "var structDescs_%v = ", target.Arch) - serializer.Write(out, prg.StructDescs) - fmt.Fprintf(out, "\n\n") - fmt.Fprintf(out, "var syscalls_%v = ", target.Arch) serializer.Write(out, prg.Syscalls) fmt.Fprintf(out, "\n\n") -- cgit mrf-deployment