authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-09-30 08:33:04-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-09-30 08:33:04-04:00
loge0eb045b5ff03a9258e7b6db5ee9d52d10265f3f
tree14086e76a5788f9759581bb1f1e0e08e7a86691d
parent0e9f86b1db1343b7e57f73906849c88627124a74
signaturelock-open Commit is signed but in an unrecognized format.

remove unhelpful/outdated/unused doc file


1 files changed, 0 insertions(+), 33 deletions(-)

doc/codegen.md deleted-33
......@@ -1,33 +0,0 @@
1# Code Generation
2
3## Data Representation
4
5Every type has a "handle". If a type is a simple primitive type such as i32 or
6f64, the handle is "by value", meaning that we pass around the value itself when
7we refer to a value of that type.
8
9If a type is a container, error union, optional type, slice, or array, then its
10handle is a pointer, and everywhere we refer to a value of this type we refer to
11a pointer.
12
13Parameters and return values are always passed as handles.
14
15Error union types are represented as:
16
17 struct {
18 error: u32,
19 payload: T,
20 }
21
22Optional types are represented as:
23
24 struct {
25 payload: T,
26 is_non_null: u1,
27 }
28
29## Data Optimizations
30
31Optional pointer types are special: the 0x0 pointer value is used to represent a
32null pointer. Thus, instead of the struct above, optional pointer types are
33represented as a `usize` in codegen and the handle is by value.