Skip to content

Commit 95fb4f7

Browse files
author
Ethan Graham
committed
prog: add Extend method
1 parent ef4c23c commit 95fb4f7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

prog/target.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,16 @@ func AllTargets() []*Target {
127127
return res
128128
}
129129

130+
// Extend extends a target with a new set of syscalls, types, and resources.
131+
// It is assumed that all new syscalls, types, and resources do not conflict
132+
// with those already present in the target.
133+
func (target *Target) Extend(syscalls []*Syscall, types []Type, resources []*ResourceDesc) {
134+
target.Syscalls = append(target.Syscalls, syscalls...)
135+
target.Types = append(target.Types, types...)
136+
target.Resources = append(target.Resources, resources...)
137+
target.initTarget()
138+
}
139+
130140
func (target *Target) lazyInit() {
131141
target.Neutralize = func(c *Call, fixStructure bool) error { return nil }
132142
target.AnnotateCall = func(c ExecCall) string { return "" }

0 commit comments

Comments
 (0)