diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-01-07 21:38:54 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-01-08 12:52:31 +0100 |
| commit | 66288e0e0b7af2f82427cfcfad606ea21880a837 (patch) | |
| tree | 66a061dae128abbbd1ec29542532a22b7438037c /docs/syscall_descriptions_syntax.md | |
| parent | 0ae499850c25196ca5b61653b3e498ed65f87725 (diff) | |
pkg/compiler: add builtin bool type aliases
This adds builtin:
type bool8 int8[0:1]
type bool16 int16[0:1]
type bool32 int32[0:1]
type bool64 int64[0:1]
type boolptr intptr[0:1]
We used to use just int's for bools.
But bool types provide several advantages:
- make true/false probability equal
- improve description expressiveness
- reduce search space (we will take advantage of this later)
Diffstat (limited to 'docs/syscall_descriptions_syntax.md')
| -rw-r--r-- | docs/syscall_descriptions_syntax.md | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/syscall_descriptions_syntax.md b/docs/syscall_descriptions_syntax.md index bafe0480c..a0b7b45b5 100644 --- a/docs/syscall_descriptions_syntax.md +++ b/docs/syscall_descriptions_syntax.md @@ -159,6 +159,15 @@ with the base type if it's required. However, type alias can be used as syscall arguments as well. Underlying types are currently restricted to integer types, `ptr`, `ptr64`, `const`, `flags` and `proc` types. +There are some builtin type aliases: +``` +type bool8 int8[0:1] +type bool16 int16[0:1] +type bool32 int32[0:1] +type bool64 int64[0:1] +type boolptr intptr[0:1] +``` + ## Length You can specify length of a particular field in struct or a named argument by using `len`, `bytesize` and `bitsize` types, for example: |
