diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-09-30 08:33:04 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-09-30 08:33:04 -0400 |
| commit | e0eb045b5ff03a9258e7b6db5ee9d52d10265f3f (patch) | |
| tree | 14086e76a5788f9759581bb1f1e0e08e7a86691d /doc/codegen.md | |
| parent | 0e9f86b1db1343b7e57f73906849c88627124a74 (diff) | |
| download | zig-e0eb045b5ff03a9258e7b6db5ee9d52d10265f3f.tar.gz zig-e0eb045b5ff03a9258e7b6db5ee9d52d10265f3f.zip | |
remove unhelpful/outdated/unused doc file
Diffstat (limited to 'doc/codegen.md')
| -rw-r--r-- | doc/codegen.md | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/doc/codegen.md b/doc/codegen.md deleted file mode 100644 index 65f12f4875..0000000000 --- a/doc/codegen.md +++ /dev/null @@ -1,33 +0,0 @@ -# Code Generation - -## Data Representation - -Every type has a "handle". If a type is a simple primitive type such as i32 or -f64, the handle is "by value", meaning that we pass around the value itself when -we refer to a value of that type. - -If a type is a container, error union, optional type, slice, or array, then its -handle is a pointer, and everywhere we refer to a value of this type we refer to -a pointer. - -Parameters and return values are always passed as handles. - -Error union types are represented as: - - struct { - error: u32, - payload: T, - } - -Optional types are represented as: - - struct { - payload: T, - is_non_null: u1, - } - -## Data Optimizations - -Optional pointer types are special: the 0x0 pointer value is used to represent a -null pointer. Thus, instead of the struct above, optional pointer types are -represented as a `usize` in codegen and the handle is by value. |
