diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-12-10 15:49:04 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-12-10 16:37:02 +0100 |
| commit | 28bd3e371b1f31cb243f0df56b9c7720971a89db (patch) | |
| tree | ac2ff223b4b855f0bcb554bc65dcff07a2f4e49c /prog/target.go | |
| parent | c7ba317e9bfa7672d851df1217c2c3ea045c55f1 (diff) | |
prog: support AUTO args in programs
AUTO arguments can be used for:
- consts
- lens
- pointers
For const's and len's AUTO is replaced with the natural value,
addresses for AUTO pointers are allocated linearly.
This greatly simplifies writing test programs by hand
as most of the time we want these natural values.
Update tests to use AUTO.
Diffstat (limited to 'prog/target.go')
| -rw-r--r-- | prog/target.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/prog/target.go b/prog/target.go index 360e2e60f..b64af0027 100644 --- a/prog/target.go +++ b/prog/target.go @@ -212,7 +212,7 @@ func (g *Gen) GenerateSpecialArg(typ Type, pcalls *[]*Call) Arg { func (g *Gen) generateArg(typ Type, pcalls *[]*Call, ignoreSpecial bool) Arg { arg, calls := g.r.generateArgImpl(g.s, typ, ignoreSpecial) *pcalls = append(*pcalls, calls...) - g.r.target.assignSizesArray([]Arg{arg}) + g.r.target.assignSizesArray([]Arg{arg}, nil) return arg } |
