aboutsummaryrefslogtreecommitdiffstats
path: root/prog/prog.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-12-06 18:53:57 +0100
committerDmitry Vyukov <dvyukov@google.com>2018-12-06 18:56:08 +0100
commitab4b148b34b55427cf82f4dd67f0773aada301be (patch)
tree2e8c7b5c4ad7f7722a357b43bfbce68f2505ee69 /prog/prog.go
parentceaec61a833bf78e2aa2a1feb964e1915d3f465b (diff)
prog: add Prog.Finalize
Prog.Finalize combines assignSizesCall, SanitizeCall and validate. Intended for users who build own programs, so that we don't need to expose all individual methods.
Diffstat (limited to 'prog/prog.go')
-rw-r--r--prog/prog.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/prog/prog.go b/prog/prog.go
index 575680882..69c76c019 100644
--- a/prog/prog.go
+++ b/prog/prog.go
@@ -20,6 +20,14 @@ type Call struct {
Comment string
}
+func (p *Prog) Finalize() error {
+ for _, c := range p.Calls {
+ p.Target.assignSizesCall(c)
+ p.Target.SanitizeCall(c)
+ }
+ return p.validate()
+}
+
type Arg interface {
Type() Type
Size() uint64