diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2023-09-14 18:03:44 +0200 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2023-10-04 09:27:33 +0000 |
| commit | c4dc646bee41c7e983a13750652f1035ae27b737 (patch) | |
| tree | 41628c9297a3fe6937dc0b1d2204b7b7d6eee4de /pkg/compiler/const_file.go | |
| parent | 12dde47641ed4c314decd0728d9d54ba6cd0aa02 (diff) | |
pkg/compiler: add ExistsAny() to ConstFile
The new method checks whether the value is defined for at least one of
the known arches.
Refactor ConstFile tests.
Diffstat (limited to 'pkg/compiler/const_file.go')
| -rw-r--r-- | pkg/compiler/const_file.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/compiler/const_file.go b/pkg/compiler/const_file.go index 0df0bb0ca..1968092a4 100644 --- a/pkg/compiler/const_file.go +++ b/pkg/compiler/const_file.go @@ -82,6 +82,10 @@ func (cf *ConstFile) Arch(arch string) map[string]uint64 { return m } +func (cf *ConstFile) ExistsAny(constName string) bool { + return len(cf.m[constName].vals) > 0 +} + func (cf *ConstFile) Serialize() []byte { if len(cf.arches) == 0 { return nil |
