aboutsummaryrefslogtreecommitdiffstats
path: root/prog/prog.go
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2021-08-31 17:21:33 +0000
committerAleksandr Nogikh <wp32pw@gmail.com>2021-09-22 15:40:02 +0200
commit9e4e4272d3f686e750a13d2111b0fb7041db2f4a (patch)
tree288c3421a8da52fcb7e460247f9678fece2ed1c9 /prog/prog.go
parent169724fe58e8d7d0b4be6f59ca7c1e0f300399e1 (diff)
all: introduce a prog.Call constructor
Create a constructor for the prog.Call type. It allows to reduce the duplication of code now and during further changes.
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 bcc86fb02..576348085 100644
--- a/prog/prog.go
+++ b/prog/prog.go
@@ -20,6 +20,14 @@ type Call struct {
Comment string
}
+func MakeCall(meta *Syscall, args []Arg) *Call {
+ return &Call{
+ Meta: meta,
+ Args: args,
+ Ret: MakeReturnArg(meta.Ret),
+ }
+}
+
type Arg interface {
Type() Type
Dir() Dir