From 66288e0e0b7af2f82427cfcfad606ea21880a837 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sun, 7 Jan 2018 21:38:54 +0100 Subject: 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) --- docs/syscall_descriptions_syntax.md | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'docs/syscall_descriptions_syntax.md') 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: -- cgit mrf-deployment