aboutsummaryrefslogtreecommitdiffstats
path: root/prog/target.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2021-05-26 13:38:38 +0200
committerDmitry Vyukov <dvyukov@google.com>2021-05-26 15:07:25 +0200
commit076dbcb04d07743faf5fe058f73af1678d8868c9 (patch)
treee3d64037bf25753395bbebef4a84d41ce00403fc /prog/target.go
parent3da9017c17c7d2432c4b76345c4d2efbeedd2935 (diff)
all: minor glob fixes
Diffstat (limited to 'prog/target.go')
-rw-r--r--prog/target.go13
1 files changed, 6 insertions, 7 deletions
diff --git a/prog/target.go b/prog/target.go
index 974880c22..2cfb25108 100644
--- a/prog/target.go
+++ b/prog/target.go
@@ -227,25 +227,24 @@ func (target *Target) DefaultChoiceTable() *ChoiceTable {
return target.defaultChoiceTable
}
-func (target *Target) GetGlobs() []string {
- var globs []string
+func (target *Target) GetGlobs() map[string]bool {
+ globs := make(map[string]bool)
ForeachType(target.Syscalls, func(typ Type, ctx TypeCtx) {
switch a := typ.(type) {
case *BufferType:
- if a.Kind == BufferGlob && a.SubKind != "" {
- globs = append(globs, a.SubKind)
+ if a.Kind == BufferGlob {
+ globs[a.SubKind] = true
}
}
})
-
return globs
}
-func (target *Target) UpdateGlobFilesForType(globFiles map[string][]string) {
+func (target *Target) UpdateGlobs(globFiles map[string][]string) {
ForeachType(target.Syscalls, func(typ Type, ctx TypeCtx) {
switch a := typ.(type) {
case *BufferType:
- if a.Kind == BufferGlob && a.SubKind != "" {
+ if a.Kind == BufferGlob {
a.Values = globFiles[a.SubKind]
}
}