aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/compiler/const_file.go
Commit message (Collapse)AuthorAgeFilesLines
* pkg/compiler: fix handling of defines with a 0 valueAnton Lindqvist2020-10-311-1/+1
| | | | | | | | | | | | | | | While adding new syscall descriptions to OpenBSD I ran into the following problem: $ gmake extract SOURCEDIR=/home/src && ./bin/syz-sysgen fs.txt.const:15: failed to parse int: strconv.ParseUint: parsing "": invalid syntax $ tail -n +15 sys/openbsd/fs.txt.const | head -1 O_RDONLY = Note that `O_RDONLY` lacks a value and the same directive is defined as 0 on OpenBSD. In `ConstFile.Serialize()`, if val is equal to the default value is has only already been serialized if `max != 0`.
* pkg/compiler: merge const files into a single fileDmitry Vyukov2020-08-131-0/+294
We now have 8 arches for Linux and .const files produce lots of noise in PRs and lots of diffs. If 3 .txt files are touched, the PR will have 24 .const files, which will be intermixed with .txt files. Frequently const values are equal across arches, and even if they don't spreading a single value across 8 files is inconvinient. Merge all 8 *_arch.const files into a single .const file. See the test for details of the new format. The old format is still parsed for now, we can't update all OSes at once. For Linux this reduces number of const files/lines from 1288/96599 to 158/11603. Fixes #1983