aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/compiler/const_file.go
Commit message (Collapse)AuthorAgeFilesLines
* all: use any instead of interface{}Dmitry Vyukov2025-12-221-2/+2
| | | | Any is the preferred over interface{} now in Go.
* pkg/compiler: allow manual consts to override auto-extracted constsDmitry Vyukov2024-11-261-12/+25
| | | | | | | | | | | | | | | | | | | | Currently if const values in 2 .const files have different value, the compiler produces an error. This is problematic for auto-extacted consts since we extract them for only 1 arch now. So if a const has different values for different arches, auto-extacted consts may not reflect that, and we can get a mismatch with manual descriptions that has correct values for all arches. So if both manual and auto-extacted consts have different values, silently prefer the manual ones. I've tried to do some whitelisting of consts during auto-extaction, but the list is large and changing over time. This solution is not perfect since the manual descriptions may have a bug, and the mismatch is actually pointing to that bug. Maybe in future we could extract for all arches separately, or do something else. But let's do this for now.
* pkg/compiler: add ExistsAny() to ConstFileAleksandr Nogikh2023-10-041-0/+4
| | | | | | The new method checks whether the value is defined for at least one of the known arches. Refactor ConstFile tests.
* all: ioutil is deprecated in go1.19 (#3718)Taras Madan2023-02-231-2/+2
|
* pkg/compiler: remove some leftoversP1umer2023-01-031-1/+0
|
* all: add freebsd/riscv64 supportP1umer2023-01-031-0/+2
|
* 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