2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-03 21:56:21 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-06-18 19:03:41 -04:00
|
|
|
|
2020-06-29 21:58:34 -04:00
|
|
|
|
2020-07-15 15:42:02 -07:00
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-05-15 23:54:13 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
2020-07-07 14:55:44 -04:00
|
|
|
|
2020-05-16 15:44:20 -04:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-27 21:50:59 -04:00
|
|
|
|
|
|
|
|
|
2020-07-13 15:34:31 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-07 14:55:44 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 19:53:32 -04:00
|
|
|
|
|
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
2020-07-30 20:30:31 -07:00
|
|
|
|
|
|
|
|
|
2020-06-24 20:28:52 -04:00
|
|
|
|
|
|
|
|
|
2020-07-15 15:42:02 -07:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-08-04 00:22:11 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-07 14:55:44 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-08 01:18:22 +02:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-08-03 22:22:47 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-08 01:18:22 +02:00
|
|
|
|
2020-08-03 22:22:47 -07:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-05-28 12:19:00 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-28 12:19:00 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 19:53:32 -04:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self-hosted: AST flattening, astgen improvements, result locations, and more
* AST: flatten ControlFlowExpression into Continue, Break, and Return.
* AST: unify identifiers and literals into the same AST type: OneToken
* AST: ControlFlowExpression uses TrailerFlags to optimize storage
space.
* astgen: support `var` as well as `const` locals, and support
explicitly typed locals. Corresponding Module and codegen code is not
implemented yet.
* astgen: support result locations.
* ZIR: add the following instructions (see the corresponding doc
comments for explanations of semantics):
- alloc
- alloc_inferred
- bitcast_result_ptr
- coerce_result_block_ptr
- coerce_result_ptr
- coerce_to_ptr_elem
- ensure_result_used
- ensure_result_non_error
- ret_ptr
- ret_type
- store
- param_type
* the skeleton structure for result locations is set up. It's looking
pretty clean so far.
* add compile error for unused result and compile error for discarding
errors.
* astgen: split builtin calls up to implemented manually, and implement
`@as`, `@bitCast` (and others) with respect to result locations.
* add CLI support for hex and raw object formats. They are not
supported by the self-hosted compiler yet, and emit errors.
* rename `--c` CLI to `-ofmt=[objectformat]` which can be any of the
object formats. Only ELF and C are supported so far. Also added missing
help to the help text.
* Remove hard tabs from C backend test cases. Shame on you Noam, you
are grounded, you should know better, etc. Bad boy.
* Delete C backend code and test case that relied on comptime_int
incorrectly making it all the way to codegen.
2020-07-23 23:05:26 -07:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-03 21:56:21 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-03 21:56:21 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-08-03 21:56:21 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-05-28 12:19:00 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-28 12:19:00 -04:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-19 13:33:36 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
self-hosted: AST flattening, astgen improvements, result locations, and more
* AST: flatten ControlFlowExpression into Continue, Break, and Return.
* AST: unify identifiers and literals into the same AST type: OneToken
* AST: ControlFlowExpression uses TrailerFlags to optimize storage
space.
* astgen: support `var` as well as `const` locals, and support
explicitly typed locals. Corresponding Module and codegen code is not
implemented yet.
* astgen: support result locations.
* ZIR: add the following instructions (see the corresponding doc
comments for explanations of semantics):
- alloc
- alloc_inferred
- bitcast_result_ptr
- coerce_result_block_ptr
- coerce_result_ptr
- coerce_to_ptr_elem
- ensure_result_used
- ensure_result_non_error
- ret_ptr
- ret_type
- store
- param_type
* the skeleton structure for result locations is set up. It's looking
pretty clean so far.
* add compile error for unused result and compile error for discarding
errors.
* astgen: split builtin calls up to implemented manually, and implement
`@as`, `@bitCast` (and others) with respect to result locations.
* add CLI support for hex and raw object formats. They are not
supported by the self-hosted compiler yet, and emit errors.
* rename `--c` CLI to `-ofmt=[objectformat]` which can be any of the
object formats. Only ELF and C are supported so far. Also added missing
help to the help text.
* Remove hard tabs from C backend test cases. Shame on you Noam, you
are grounded, you should know better, etc. Bad boy.
* Delete C backend code and test case that relied on comptime_int
incorrectly making it all the way to codegen.
2020-07-23 23:05:26 -07:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
|
|
|
|
|
2020-05-28 12:19:00 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
self-hosted: AST flattening, astgen improvements, result locations, and more
* AST: flatten ControlFlowExpression into Continue, Break, and Return.
* AST: unify identifiers and literals into the same AST type: OneToken
* AST: ControlFlowExpression uses TrailerFlags to optimize storage
space.
* astgen: support `var` as well as `const` locals, and support
explicitly typed locals. Corresponding Module and codegen code is not
implemented yet.
* astgen: support result locations.
* ZIR: add the following instructions (see the corresponding doc
comments for explanations of semantics):
- alloc
- alloc_inferred
- bitcast_result_ptr
- coerce_result_block_ptr
- coerce_result_ptr
- coerce_to_ptr_elem
- ensure_result_used
- ensure_result_non_error
- ret_ptr
- ret_type
- store
- param_type
* the skeleton structure for result locations is set up. It's looking
pretty clean so far.
* add compile error for unused result and compile error for discarding
errors.
* astgen: split builtin calls up to implemented manually, and implement
`@as`, `@bitCast` (and others) with respect to result locations.
* add CLI support for hex and raw object formats. They are not
supported by the self-hosted compiler yet, and emit errors.
* rename `--c` CLI to `-ofmt=[objectformat]` which can be any of the
object formats. Only ELF and C are supported so far. Also added missing
help to the help text.
* Remove hard tabs from C backend test cases. Shame on you Noam, you
are grounded, you should know better, etc. Bad boy.
* Delete C backend code and test case that relied on comptime_int
incorrectly making it all the way to codegen.
2020-07-23 23:05:26 -07:00
|
|
|
|
|
|
|
|
|
2020-05-28 12:19:00 -04:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-05-28 12:19:00 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
self-hosted: AST flattening, astgen improvements, result locations, and more
* AST: flatten ControlFlowExpression into Continue, Break, and Return.
* AST: unify identifiers and literals into the same AST type: OneToken
* AST: ControlFlowExpression uses TrailerFlags to optimize storage
space.
* astgen: support `var` as well as `const` locals, and support
explicitly typed locals. Corresponding Module and codegen code is not
implemented yet.
* astgen: support result locations.
* ZIR: add the following instructions (see the corresponding doc
comments for explanations of semantics):
- alloc
- alloc_inferred
- bitcast_result_ptr
- coerce_result_block_ptr
- coerce_result_ptr
- coerce_to_ptr_elem
- ensure_result_used
- ensure_result_non_error
- ret_ptr
- ret_type
- store
- param_type
* the skeleton structure for result locations is set up. It's looking
pretty clean so far.
* add compile error for unused result and compile error for discarding
errors.
* astgen: split builtin calls up to implemented manually, and implement
`@as`, `@bitCast` (and others) with respect to result locations.
* add CLI support for hex and raw object formats. They are not
supported by the self-hosted compiler yet, and emit errors.
* rename `--c` CLI to `-ofmt=[objectformat]` which can be any of the
object formats. Only ELF and C are supported so far. Also added missing
help to the help text.
* Remove hard tabs from C backend test cases. Shame on you Noam, you
are grounded, you should know better, etc. Bad boy.
* Delete C backend code and test case that relied on comptime_int
incorrectly making it all the way to codegen.
2020-07-23 23:05:26 -07:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self-hosted: AST flattening, astgen improvements, result locations, and more
* AST: flatten ControlFlowExpression into Continue, Break, and Return.
* AST: unify identifiers and literals into the same AST type: OneToken
* AST: ControlFlowExpression uses TrailerFlags to optimize storage
space.
* astgen: support `var` as well as `const` locals, and support
explicitly typed locals. Corresponding Module and codegen code is not
implemented yet.
* astgen: support result locations.
* ZIR: add the following instructions (see the corresponding doc
comments for explanations of semantics):
- alloc
- alloc_inferred
- bitcast_result_ptr
- coerce_result_block_ptr
- coerce_result_ptr
- coerce_to_ptr_elem
- ensure_result_used
- ensure_result_non_error
- ret_ptr
- ret_type
- store
- param_type
* the skeleton structure for result locations is set up. It's looking
pretty clean so far.
* add compile error for unused result and compile error for discarding
errors.
* astgen: split builtin calls up to implemented manually, and implement
`@as`, `@bitCast` (and others) with respect to result locations.
* add CLI support for hex and raw object formats. They are not
supported by the self-hosted compiler yet, and emit errors.
* rename `--c` CLI to `-ofmt=[objectformat]` which can be any of the
object formats. Only ELF and C are supported so far. Also added missing
help to the help text.
* Remove hard tabs from C backend test cases. Shame on you Noam, you
are grounded, you should know better, etc. Bad boy.
* Delete C backend code and test case that relied on comptime_int
incorrectly making it all the way to codegen.
2020-07-23 23:05:26 -07:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
self-hosted: AST flattening, astgen improvements, result locations, and more
* AST: flatten ControlFlowExpression into Continue, Break, and Return.
* AST: unify identifiers and literals into the same AST type: OneToken
* AST: ControlFlowExpression uses TrailerFlags to optimize storage
space.
* astgen: support `var` as well as `const` locals, and support
explicitly typed locals. Corresponding Module and codegen code is not
implemented yet.
* astgen: support result locations.
* ZIR: add the following instructions (see the corresponding doc
comments for explanations of semantics):
- alloc
- alloc_inferred
- bitcast_result_ptr
- coerce_result_block_ptr
- coerce_result_ptr
- coerce_to_ptr_elem
- ensure_result_used
- ensure_result_non_error
- ret_ptr
- ret_type
- store
- param_type
* the skeleton structure for result locations is set up. It's looking
pretty clean so far.
* add compile error for unused result and compile error for discarding
errors.
* astgen: split builtin calls up to implemented manually, and implement
`@as`, `@bitCast` (and others) with respect to result locations.
* add CLI support for hex and raw object formats. They are not
supported by the self-hosted compiler yet, and emit errors.
* rename `--c` CLI to `-ofmt=[objectformat]` which can be any of the
object formats. Only ELF and C are supported so far. Also added missing
help to the help text.
* Remove hard tabs from C backend test cases. Shame on you Noam, you
are grounded, you should know better, etc. Bad boy.
* Delete C backend code and test case that relied on comptime_int
incorrectly making it all the way to codegen.
2020-07-23 23:05:26 -07:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-15 18:15:59 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self-hosted: AST flattening, astgen improvements, result locations, and more
* AST: flatten ControlFlowExpression into Continue, Break, and Return.
* AST: unify identifiers and literals into the same AST type: OneToken
* AST: ControlFlowExpression uses TrailerFlags to optimize storage
space.
* astgen: support `var` as well as `const` locals, and support
explicitly typed locals. Corresponding Module and codegen code is not
implemented yet.
* astgen: support result locations.
* ZIR: add the following instructions (see the corresponding doc
comments for explanations of semantics):
- alloc
- alloc_inferred
- bitcast_result_ptr
- coerce_result_block_ptr
- coerce_result_ptr
- coerce_to_ptr_elem
- ensure_result_used
- ensure_result_non_error
- ret_ptr
- ret_type
- store
- param_type
* the skeleton structure for result locations is set up. It's looking
pretty clean so far.
* add compile error for unused result and compile error for discarding
errors.
* astgen: split builtin calls up to implemented manually, and implement
`@as`, `@bitCast` (and others) with respect to result locations.
* add CLI support for hex and raw object formats. They are not
supported by the self-hosted compiler yet, and emit errors.
* rename `--c` CLI to `-ofmt=[objectformat]` which can be any of the
object formats. Only ELF and C are supported so far. Also added missing
help to the help text.
* Remove hard tabs from C backend test cases. Shame on you Noam, you
are grounded, you should know better, etc. Bad boy.
* Delete C backend code and test case that relied on comptime_int
incorrectly making it all the way to codegen.
2020-07-23 23:05:26 -07:00
|
|
|
|
|
|
|
|
|
2020-07-15 18:15:59 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
self-hosted: AST flattening, astgen improvements, result locations, and more
* AST: flatten ControlFlowExpression into Continue, Break, and Return.
* AST: unify identifiers and literals into the same AST type: OneToken
* AST: ControlFlowExpression uses TrailerFlags to optimize storage
space.
* astgen: support `var` as well as `const` locals, and support
explicitly typed locals. Corresponding Module and codegen code is not
implemented yet.
* astgen: support result locations.
* ZIR: add the following instructions (see the corresponding doc
comments for explanations of semantics):
- alloc
- alloc_inferred
- bitcast_result_ptr
- coerce_result_block_ptr
- coerce_result_ptr
- coerce_to_ptr_elem
- ensure_result_used
- ensure_result_non_error
- ret_ptr
- ret_type
- store
- param_type
* the skeleton structure for result locations is set up. It's looking
pretty clean so far.
* add compile error for unused result and compile error for discarding
errors.
* astgen: split builtin calls up to implemented manually, and implement
`@as`, `@bitCast` (and others) with respect to result locations.
* add CLI support for hex and raw object formats. They are not
supported by the self-hosted compiler yet, and emit errors.
* rename `--c` CLI to `-ofmt=[objectformat]` which can be any of the
object formats. Only ELF and C are supported so far. Also added missing
help to the help text.
* Remove hard tabs from C backend test cases. Shame on you Noam, you
are grounded, you should know better, etc. Bad boy.
* Delete C backend code and test case that relied on comptime_int
incorrectly making it all the way to codegen.
2020-07-23 23:05:26 -07:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
self-hosted: AST flattening, astgen improvements, result locations, and more
* AST: flatten ControlFlowExpression into Continue, Break, and Return.
* AST: unify identifiers and literals into the same AST type: OneToken
* AST: ControlFlowExpression uses TrailerFlags to optimize storage
space.
* astgen: support `var` as well as `const` locals, and support
explicitly typed locals. Corresponding Module and codegen code is not
implemented yet.
* astgen: support result locations.
* ZIR: add the following instructions (see the corresponding doc
comments for explanations of semantics):
- alloc
- alloc_inferred
- bitcast_result_ptr
- coerce_result_block_ptr
- coerce_result_ptr
- coerce_to_ptr_elem
- ensure_result_used
- ensure_result_non_error
- ret_ptr
- ret_type
- store
- param_type
* the skeleton structure for result locations is set up. It's looking
pretty clean so far.
* add compile error for unused result and compile error for discarding
errors.
* astgen: split builtin calls up to implemented manually, and implement
`@as`, `@bitCast` (and others) with respect to result locations.
* add CLI support for hex and raw object formats. They are not
supported by the self-hosted compiler yet, and emit errors.
* rename `--c` CLI to `-ofmt=[objectformat]` which can be any of the
object formats. Only ELF and C are supported so far. Also added missing
help to the help text.
* Remove hard tabs from C backend test cases. Shame on you Noam, you
are grounded, you should know better, etc. Bad boy.
* Delete C backend code and test case that relied on comptime_int
incorrectly making it all the way to codegen.
2020-07-23 23:05:26 -07:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
self-hosted: AST flattening, astgen improvements, result locations, and more
* AST: flatten ControlFlowExpression into Continue, Break, and Return.
* AST: unify identifiers and literals into the same AST type: OneToken
* AST: ControlFlowExpression uses TrailerFlags to optimize storage
space.
* astgen: support `var` as well as `const` locals, and support
explicitly typed locals. Corresponding Module and codegen code is not
implemented yet.
* astgen: support result locations.
* ZIR: add the following instructions (see the corresponding doc
comments for explanations of semantics):
- alloc
- alloc_inferred
- bitcast_result_ptr
- coerce_result_block_ptr
- coerce_result_ptr
- coerce_to_ptr_elem
- ensure_result_used
- ensure_result_non_error
- ret_ptr
- ret_type
- store
- param_type
* the skeleton structure for result locations is set up. It's looking
pretty clean so far.
* add compile error for unused result and compile error for discarding
errors.
* astgen: split builtin calls up to implemented manually, and implement
`@as`, `@bitCast` (and others) with respect to result locations.
* add CLI support for hex and raw object formats. They are not
supported by the self-hosted compiler yet, and emit errors.
* rename `--c` CLI to `-ofmt=[objectformat]` which can be any of the
object formats. Only ELF and C are supported so far. Also added missing
help to the help text.
* Remove hard tabs from C backend test cases. Shame on you Noam, you
are grounded, you should know better, etc. Bad boy.
* Delete C backend code and test case that relied on comptime_int
incorrectly making it all the way to codegen.
2020-07-23 23:05:26 -07:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self-hosted: AST flattening, astgen improvements, result locations, and more
* AST: flatten ControlFlowExpression into Continue, Break, and Return.
* AST: unify identifiers and literals into the same AST type: OneToken
* AST: ControlFlowExpression uses TrailerFlags to optimize storage
space.
* astgen: support `var` as well as `const` locals, and support
explicitly typed locals. Corresponding Module and codegen code is not
implemented yet.
* astgen: support result locations.
* ZIR: add the following instructions (see the corresponding doc
comments for explanations of semantics):
- alloc
- alloc_inferred
- bitcast_result_ptr
- coerce_result_block_ptr
- coerce_result_ptr
- coerce_to_ptr_elem
- ensure_result_used
- ensure_result_non_error
- ret_ptr
- ret_type
- store
- param_type
* the skeleton structure for result locations is set up. It's looking
pretty clean so far.
* add compile error for unused result and compile error for discarding
errors.
* astgen: split builtin calls up to implemented manually, and implement
`@as`, `@bitCast` (and others) with respect to result locations.
* add CLI support for hex and raw object formats. They are not
supported by the self-hosted compiler yet, and emit errors.
* rename `--c` CLI to `-ofmt=[objectformat]` which can be any of the
object formats. Only ELF and C are supported so far. Also added missing
help to the help text.
* Remove hard tabs from C backend test cases. Shame on you Noam, you
are grounded, you should know better, etc. Bad boy.
* Delete C backend code and test case that relied on comptime_int
incorrectly making it all the way to codegen.
2020-07-23 23:05:26 -07:00
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
self-hosted: AST flattening, astgen improvements, result locations, and more
* AST: flatten ControlFlowExpression into Continue, Break, and Return.
* AST: unify identifiers and literals into the same AST type: OneToken
* AST: ControlFlowExpression uses TrailerFlags to optimize storage
space.
* astgen: support `var` as well as `const` locals, and support
explicitly typed locals. Corresponding Module and codegen code is not
implemented yet.
* astgen: support result locations.
* ZIR: add the following instructions (see the corresponding doc
comments for explanations of semantics):
- alloc
- alloc_inferred
- bitcast_result_ptr
- coerce_result_block_ptr
- coerce_result_ptr
- coerce_to_ptr_elem
- ensure_result_used
- ensure_result_non_error
- ret_ptr
- ret_type
- store
- param_type
* the skeleton structure for result locations is set up. It's looking
pretty clean so far.
* add compile error for unused result and compile error for discarding
errors.
* astgen: split builtin calls up to implemented manually, and implement
`@as`, `@bitCast` (and others) with respect to result locations.
* add CLI support for hex and raw object formats. They are not
supported by the self-hosted compiler yet, and emit errors.
* rename `--c` CLI to `-ofmt=[objectformat]` which can be any of the
object formats. Only ELF and C are supported so far. Also added missing
help to the help text.
* Remove hard tabs from C backend test cases. Shame on you Noam, you
are grounded, you should know better, etc. Bad boy.
* Delete C backend code and test case that relied on comptime_int
incorrectly making it all the way to codegen.
2020-07-23 23:05:26 -07:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 06:08:37 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
self-hosted: AST flattening, astgen improvements, result locations, and more
* AST: flatten ControlFlowExpression into Continue, Break, and Return.
* AST: unify identifiers and literals into the same AST type: OneToken
* AST: ControlFlowExpression uses TrailerFlags to optimize storage
space.
* astgen: support `var` as well as `const` locals, and support
explicitly typed locals. Corresponding Module and codegen code is not
implemented yet.
* astgen: support result locations.
* ZIR: add the following instructions (see the corresponding doc
comments for explanations of semantics):
- alloc
- alloc_inferred
- bitcast_result_ptr
- coerce_result_block_ptr
- coerce_result_ptr
- coerce_to_ptr_elem
- ensure_result_used
- ensure_result_non_error
- ret_ptr
- ret_type
- store
- param_type
* the skeleton structure for result locations is set up. It's looking
pretty clean so far.
* add compile error for unused result and compile error for discarding
errors.
* astgen: split builtin calls up to implemented manually, and implement
`@as`, `@bitCast` (and others) with respect to result locations.
* add CLI support for hex and raw object formats. They are not
supported by the self-hosted compiler yet, and emit errors.
* rename `--c` CLI to `-ofmt=[objectformat]` which can be any of the
object formats. Only ELF and C are supported so far. Also added missing
help to the help text.
* Remove hard tabs from C backend test cases. Shame on you Noam, you
are grounded, you should know better, etc. Bad boy.
* Delete C backend code and test case that relied on comptime_int
incorrectly making it all the way to codegen.
2020-07-23 23:05:26 -07:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
2020-08-03 21:56:21 -07:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-16 20:23:15 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-16 20:23:15 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-06-24 20:28:52 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-06-24 20:28:52 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-05-16 20:23:15 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-16 20:23:15 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-05-16 20:23:15 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-08-03 21:56:21 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-15 22:36:35 -07:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
2020-07-15 22:36:35 -07:00
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-07-15 18:15:59 -07:00
|
|
|
|
self-hosted: AST flattening, astgen improvements, result locations, and more
* AST: flatten ControlFlowExpression into Continue, Break, and Return.
* AST: unify identifiers and literals into the same AST type: OneToken
* AST: ControlFlowExpression uses TrailerFlags to optimize storage
space.
* astgen: support `var` as well as `const` locals, and support
explicitly typed locals. Corresponding Module and codegen code is not
implemented yet.
* astgen: support result locations.
* ZIR: add the following instructions (see the corresponding doc
comments for explanations of semantics):
- alloc
- alloc_inferred
- bitcast_result_ptr
- coerce_result_block_ptr
- coerce_result_ptr
- coerce_to_ptr_elem
- ensure_result_used
- ensure_result_non_error
- ret_ptr
- ret_type
- store
- param_type
* the skeleton structure for result locations is set up. It's looking
pretty clean so far.
* add compile error for unused result and compile error for discarding
errors.
* astgen: split builtin calls up to implemented manually, and implement
`@as`, `@bitCast` (and others) with respect to result locations.
* add CLI support for hex and raw object formats. They are not
supported by the self-hosted compiler yet, and emit errors.
* rename `--c` CLI to `-ofmt=[objectformat]` which can be any of the
object formats. Only ELF and C are supported so far. Also added missing
help to the help text.
* Remove hard tabs from C backend test cases. Shame on you Noam, you
are grounded, you should know better, etc. Bad boy.
* Delete C backend code and test case that relied on comptime_int
incorrectly making it all the way to codegen.
2020-07-23 23:05:26 -07:00
|
|
|
|
2020-07-15 18:15:59 -07:00
|
|
|
|
2020-07-15 22:36:35 -07:00
|
|
|
|
self-hosted: AST flattening, astgen improvements, result locations, and more
* AST: flatten ControlFlowExpression into Continue, Break, and Return.
* AST: unify identifiers and literals into the same AST type: OneToken
* AST: ControlFlowExpression uses TrailerFlags to optimize storage
space.
* astgen: support `var` as well as `const` locals, and support
explicitly typed locals. Corresponding Module and codegen code is not
implemented yet.
* astgen: support result locations.
* ZIR: add the following instructions (see the corresponding doc
comments for explanations of semantics):
- alloc
- alloc_inferred
- bitcast_result_ptr
- coerce_result_block_ptr
- coerce_result_ptr
- coerce_to_ptr_elem
- ensure_result_used
- ensure_result_non_error
- ret_ptr
- ret_type
- store
- param_type
* the skeleton structure for result locations is set up. It's looking
pretty clean so far.
* add compile error for unused result and compile error for discarding
errors.
* astgen: split builtin calls up to implemented manually, and implement
`@as`, `@bitCast` (and others) with respect to result locations.
* add CLI support for hex and raw object formats. They are not
supported by the self-hosted compiler yet, and emit errors.
* rename `--c` CLI to `-ofmt=[objectformat]` which can be any of the
object formats. Only ELF and C are supported so far. Also added missing
help to the help text.
* Remove hard tabs from C backend test cases. Shame on you Noam, you
are grounded, you should know better, etc. Bad boy.
* Delete C backend code and test case that relied on comptime_int
incorrectly making it all the way to codegen.
2020-07-23 23:05:26 -07:00
|
|
|
|
|
|
|
|
|
2020-07-15 18:15:59 -07:00
|
|
|
|
self-hosted: AST flattening, astgen improvements, result locations, and more
* AST: flatten ControlFlowExpression into Continue, Break, and Return.
* AST: unify identifiers and literals into the same AST type: OneToken
* AST: ControlFlowExpression uses TrailerFlags to optimize storage
space.
* astgen: support `var` as well as `const` locals, and support
explicitly typed locals. Corresponding Module and codegen code is not
implemented yet.
* astgen: support result locations.
* ZIR: add the following instructions (see the corresponding doc
comments for explanations of semantics):
- alloc
- alloc_inferred
- bitcast_result_ptr
- coerce_result_block_ptr
- coerce_result_ptr
- coerce_to_ptr_elem
- ensure_result_used
- ensure_result_non_error
- ret_ptr
- ret_type
- store
- param_type
* the skeleton structure for result locations is set up. It's looking
pretty clean so far.
* add compile error for unused result and compile error for discarding
errors.
* astgen: split builtin calls up to implemented manually, and implement
`@as`, `@bitCast` (and others) with respect to result locations.
* add CLI support for hex and raw object formats. They are not
supported by the self-hosted compiler yet, and emit errors.
* rename `--c` CLI to `-ofmt=[objectformat]` which can be any of the
object formats. Only ELF and C are supported so far. Also added missing
help to the help text.
* Remove hard tabs from C backend test cases. Shame on you Noam, you
are grounded, you should know better, etc. Bad boy.
* Delete C backend code and test case that relied on comptime_int
incorrectly making it all the way to codegen.
2020-07-23 23:05:26 -07:00
|
|
|
|
2020-07-15 18:15:59 -07:00
|
|
|
|
2020-07-15 22:36:35 -07:00
|
|
|
|
2020-07-15 18:15:59 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self-hosted: AST flattening, astgen improvements, result locations, and more
* AST: flatten ControlFlowExpression into Continue, Break, and Return.
* AST: unify identifiers and literals into the same AST type: OneToken
* AST: ControlFlowExpression uses TrailerFlags to optimize storage
space.
* astgen: support `var` as well as `const` locals, and support
explicitly typed locals. Corresponding Module and codegen code is not
implemented yet.
* astgen: support result locations.
* ZIR: add the following instructions (see the corresponding doc
comments for explanations of semantics):
- alloc
- alloc_inferred
- bitcast_result_ptr
- coerce_result_block_ptr
- coerce_result_ptr
- coerce_to_ptr_elem
- ensure_result_used
- ensure_result_non_error
- ret_ptr
- ret_type
- store
- param_type
* the skeleton structure for result locations is set up. It's looking
pretty clean so far.
* add compile error for unused result and compile error for discarding
errors.
* astgen: split builtin calls up to implemented manually, and implement
`@as`, `@bitCast` (and others) with respect to result locations.
* add CLI support for hex and raw object formats. They are not
supported by the self-hosted compiler yet, and emit errors.
* rename `--c` CLI to `-ofmt=[objectformat]` which can be any of the
object formats. Only ELF and C are supported so far. Also added missing
help to the help text.
* Remove hard tabs from C backend test cases. Shame on you Noam, you
are grounded, you should know better, etc. Bad boy.
* Delete C backend code and test case that relied on comptime_int
incorrectly making it all the way to codegen.
2020-07-23 23:05:26 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 23:54:13 -04:00
|
|
|
|
|
|
|
|
|
2020-07-30 20:30:31 -07:00
|
|
|
|
2020-05-15 23:54:13 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-24 20:28:52 -04:00
|
|
|
|
2020-05-15 23:54:13 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-30 20:30:31 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 23:54:13 -04:00
|
|
|
|
2020-08-02 12:16:03 +02:00
|
|
|
|
2020-07-30 20:30:31 -07:00
|
|
|
|
2020-07-31 23:22:35 -07:00
|
|
|
|
2020-05-15 23:54:13 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-28 21:57:13 -07:00
|
|
|
|
2020-05-15 23:54:13 -04:00
|
|
|
|
2020-07-07 23:24:30 -04:00
|
|
|
|
2020-05-15 23:54:13 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 23:54:13 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-07-30 20:30:31 -07:00
|
|
|
|
2020-05-15 23:54:13 -04:00
|
|
|
|
|
|
|
|
|
2020-05-16 15:44:20 -04:00
|
|
|
|
|
|
|
|
|
2020-05-15 23:54:13 -04:00
|
|
|
|
|
|
|
|
|
2020-06-24 20:28:52 -04:00
|
|
|
|
2020-05-15 23:54:13 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-07 23:24:30 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-07-30 20:30:31 -07:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
2020-07-13 15:34:31 -07:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-28 12:19:00 -04:00
|
|
|
|
2020-08-04 01:38:53 -07:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-28 12:19:00 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-28 12:19:00 -04:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-28 21:57:13 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-18 19:03:41 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
2020-06-24 20:28:52 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-08 06:56:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-07 03:48:20 +00:00
|
|
|
|
2020-07-07 14:55:44 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-06-05 15:49:23 -04:00
|
|
|
|
|
|
|
|
|
2020-07-07 03:48:20 +00:00
|
|
|
|
|
|
|
|
|
2020-06-05 15:49:23 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-05-16 15:44:20 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-08 15:15:55 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-29 21:58:34 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-29 21:58:34 -04:00
|
|
|
|
2020-07-07 03:48:20 +00:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-08-04 00:22:11 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-04 00:22:11 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-03 23:47:54 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-03 21:56:21 -07:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
2020-06-18 19:03:41 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-15 18:15:59 -07:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
2020-07-15 22:36:35 -07:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
stage2: VarDecl and FnProto take advantage of TrailerFlags API
These AST nodes now have a flags field and then a bunch of optional
trailing objects. The end result is lower memory usage and consequently
better performance. This is part of an ongoing effort to reduce the
amount of memory parsed ASTs take up.
Running `zig fmt` on the std lib:
* cache-misses: 2,554,321 => 2,534,745
* instructions: 3,293,220,119 => 3,302,479,874
* peak memory: 74.0 MiB => 73.0 MiB
Holding the entire std lib AST in memory at the same time:
93.9 MiB => 88.5 MiB
2020-07-15 01:38:31 -07:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
|
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
self-hosted: AST flattening, astgen improvements, result locations, and more
* AST: flatten ControlFlowExpression into Continue, Break, and Return.
* AST: unify identifiers and literals into the same AST type: OneToken
* AST: ControlFlowExpression uses TrailerFlags to optimize storage
space.
* astgen: support `var` as well as `const` locals, and support
explicitly typed locals. Corresponding Module and codegen code is not
implemented yet.
* astgen: support result locations.
* ZIR: add the following instructions (see the corresponding doc
comments for explanations of semantics):
- alloc
- alloc_inferred
- bitcast_result_ptr
- coerce_result_block_ptr
- coerce_result_ptr
- coerce_to_ptr_elem
- ensure_result_used
- ensure_result_non_error
- ret_ptr
- ret_type
- store
- param_type
* the skeleton structure for result locations is set up. It's looking
pretty clean so far.
* add compile error for unused result and compile error for discarding
errors.
* astgen: split builtin calls up to implemented manually, and implement
`@as`, `@bitCast` (and others) with respect to result locations.
* add CLI support for hex and raw object formats. They are not
supported by the self-hosted compiler yet, and emit errors.
* rename `--c` CLI to `-ofmt=[objectformat]` which can be any of the
object formats. Only ELF and C are supported so far. Also added missing
help to the help text.
* Remove hard tabs from C backend test cases. Shame on you Noam, you
are grounded, you should know better, etc. Bad boy.
* Delete C backend code and test case that relied on comptime_int
incorrectly making it all the way to codegen.
2020-07-23 23:05:26 -07:00
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
self-hosted: AST flattening, astgen improvements, result locations, and more
* AST: flatten ControlFlowExpression into Continue, Break, and Return.
* AST: unify identifiers and literals into the same AST type: OneToken
* AST: ControlFlowExpression uses TrailerFlags to optimize storage
space.
* astgen: support `var` as well as `const` locals, and support
explicitly typed locals. Corresponding Module and codegen code is not
implemented yet.
* astgen: support result locations.
* ZIR: add the following instructions (see the corresponding doc
comments for explanations of semantics):
- alloc
- alloc_inferred
- bitcast_result_ptr
- coerce_result_block_ptr
- coerce_result_ptr
- coerce_to_ptr_elem
- ensure_result_used
- ensure_result_non_error
- ret_ptr
- ret_type
- store
- param_type
* the skeleton structure for result locations is set up. It's looking
pretty clean so far.
* add compile error for unused result and compile error for discarding
errors.
* astgen: split builtin calls up to implemented manually, and implement
`@as`, `@bitCast` (and others) with respect to result locations.
* add CLI support for hex and raw object formats. They are not
supported by the self-hosted compiler yet, and emit errors.
* rename `--c` CLI to `-ofmt=[objectformat]` which can be any of the
object formats. Only ELF and C are supported so far. Also added missing
help to the help text.
* Remove hard tabs from C backend test cases. Shame on you Noam, you
are grounded, you should know better, etc. Bad boy.
* Delete C backend code and test case that relied on comptime_int
incorrectly making it all the way to codegen.
2020-07-23 23:05:26 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
|
|
|
|
|
2020-07-11 22:04:38 +03:00
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
|
|
|
|
|
self-hosted: AST flattening, astgen improvements, result locations, and more
* AST: flatten ControlFlowExpression into Continue, Break, and Return.
* AST: unify identifiers and literals into the same AST type: OneToken
* AST: ControlFlowExpression uses TrailerFlags to optimize storage
space.
* astgen: support `var` as well as `const` locals, and support
explicitly typed locals. Corresponding Module and codegen code is not
implemented yet.
* astgen: support result locations.
* ZIR: add the following instructions (see the corresponding doc
comments for explanations of semantics):
- alloc
- alloc_inferred
- bitcast_result_ptr
- coerce_result_block_ptr
- coerce_result_ptr
- coerce_to_ptr_elem
- ensure_result_used
- ensure_result_non_error
- ret_ptr
- ret_type
- store
- param_type
* the skeleton structure for result locations is set up. It's looking
pretty clean so far.
* add compile error for unused result and compile error for discarding
errors.
* astgen: split builtin calls up to implemented manually, and implement
`@as`, `@bitCast` (and others) with respect to result locations.
* add CLI support for hex and raw object formats. They are not
supported by the self-hosted compiler yet, and emit errors.
* rename `--c` CLI to `-ofmt=[objectformat]` which can be any of the
object formats. Only ELF and C are supported so far. Also added missing
help to the help text.
* Remove hard tabs from C backend test cases. Shame on you Noam, you
are grounded, you should know better, etc. Bad boy.
* Delete C backend code and test case that relied on comptime_int
incorrectly making it all the way to codegen.
2020-07-23 23:05:26 -07:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
stage2: VarDecl and FnProto take advantage of TrailerFlags API
These AST nodes now have a flags field and then a bunch of optional
trailing objects. The end result is lower memory usage and consequently
better performance. This is part of an ongoing effort to reduce the
amount of memory parsed ASTs take up.
Running `zig fmt` on the std lib:
* cache-misses: 2,554,321 => 2,534,745
* instructions: 3,293,220,119 => 3,302,479,874
* peak memory: 74.0 MiB => 73.0 MiB
Holding the entire std lib AST in memory at the same time:
93.9 MiB => 88.5 MiB
2020-07-15 01:38:31 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
stage2: VarDecl and FnProto take advantage of TrailerFlags API
These AST nodes now have a flags field and then a bunch of optional
trailing objects. The end result is lower memory usage and consequently
better performance. This is part of an ongoing effort to reduce the
amount of memory parsed ASTs take up.
Running `zig fmt` on the std lib:
* cache-misses: 2,554,321 => 2,534,745
* instructions: 3,293,220,119 => 3,302,479,874
* peak memory: 74.0 MiB => 73.0 MiB
Holding the entire std lib AST in memory at the same time:
93.9 MiB => 88.5 MiB
2020-07-15 01:38:31 -07:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
stage2: VarDecl and FnProto take advantage of TrailerFlags API
These AST nodes now have a flags field and then a bunch of optional
trailing objects. The end result is lower memory usage and consequently
better performance. This is part of an ongoing effort to reduce the
amount of memory parsed ASTs take up.
Running `zig fmt` on the std lib:
* cache-misses: 2,554,321 => 2,534,745
* instructions: 3,293,220,119 => 3,302,479,874
* peak memory: 74.0 MiB => 73.0 MiB
Holding the entire std lib AST in memory at the same time:
93.9 MiB => 88.5 MiB
2020-07-15 01:38:31 -07:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
stage2: VarDecl and FnProto take advantage of TrailerFlags API
These AST nodes now have a flags field and then a bunch of optional
trailing objects. The end result is lower memory usage and consequently
better performance. This is part of an ongoing effort to reduce the
amount of memory parsed ASTs take up.
Running `zig fmt` on the std lib:
* cache-misses: 2,554,321 => 2,534,745
* instructions: 3,293,220,119 => 3,302,479,874
* peak memory: 74.0 MiB => 73.0 MiB
Holding the entire std lib AST in memory at the same time:
93.9 MiB => 88.5 MiB
2020-07-15 01:38:31 -07:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
self-hosted: AST flattening, astgen improvements, result locations, and more
* AST: flatten ControlFlowExpression into Continue, Break, and Return.
* AST: unify identifiers and literals into the same AST type: OneToken
* AST: ControlFlowExpression uses TrailerFlags to optimize storage
space.
* astgen: support `var` as well as `const` locals, and support
explicitly typed locals. Corresponding Module and codegen code is not
implemented yet.
* astgen: support result locations.
* ZIR: add the following instructions (see the corresponding doc
comments for explanations of semantics):
- alloc
- alloc_inferred
- bitcast_result_ptr
- coerce_result_block_ptr
- coerce_result_ptr
- coerce_to_ptr_elem
- ensure_result_used
- ensure_result_non_error
- ret_ptr
- ret_type
- store
- param_type
* the skeleton structure for result locations is set up. It's looking
pretty clean so far.
* add compile error for unused result and compile error for discarding
errors.
* astgen: split builtin calls up to implemented manually, and implement
`@as`, `@bitCast` (and others) with respect to result locations.
* add CLI support for hex and raw object formats. They are not
supported by the self-hosted compiler yet, and emit errors.
* rename `--c` CLI to `-ofmt=[objectformat]` which can be any of the
object formats. Only ELF and C are supported so far. Also added missing
help to the help text.
* Remove hard tabs from C backend test cases. Shame on you Noam, you
are grounded, you should know better, etc. Bad boy.
* Delete C backend code and test case that relied on comptime_int
incorrectly making it all the way to codegen.
2020-07-23 23:05:26 -07:00
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
2020-07-15 22:36:35 -07:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-07-15 22:36:35 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-21 12:13:15 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-15 22:36:35 -07:00
|
|
|
|
self-hosted: AST flattening, astgen improvements, result locations, and more
* AST: flatten ControlFlowExpression into Continue, Break, and Return.
* AST: unify identifiers and literals into the same AST type: OneToken
* AST: ControlFlowExpression uses TrailerFlags to optimize storage
space.
* astgen: support `var` as well as `const` locals, and support
explicitly typed locals. Corresponding Module and codegen code is not
implemented yet.
* astgen: support result locations.
* ZIR: add the following instructions (see the corresponding doc
comments for explanations of semantics):
- alloc
- alloc_inferred
- bitcast_result_ptr
- coerce_result_block_ptr
- coerce_result_ptr
- coerce_to_ptr_elem
- ensure_result_used
- ensure_result_non_error
- ret_ptr
- ret_type
- store
- param_type
* the skeleton structure for result locations is set up. It's looking
pretty clean so far.
* add compile error for unused result and compile error for discarding
errors.
* astgen: split builtin calls up to implemented manually, and implement
`@as`, `@bitCast` (and others) with respect to result locations.
* add CLI support for hex and raw object formats. They are not
supported by the self-hosted compiler yet, and emit errors.
* rename `--c` CLI to `-ofmt=[objectformat]` which can be any of the
object formats. Only ELF and C are supported so far. Also added missing
help to the help text.
* Remove hard tabs from C backend test cases. Shame on you Noam, you
are grounded, you should know better, etc. Bad boy.
* Delete C backend code and test case that relied on comptime_int
incorrectly making it all the way to codegen.
2020-07-23 23:05:26 -07:00
|
|
|
|
2020-07-15 22:36:35 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
2020-07-15 22:36:35 -07:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-07-13 00:28:11 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-12 23:50:25 -07:00
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-07-12 23:50:25 -07:00
|
|
|
|
|
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-07-08 20:33:33 -07:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
stage2: VarDecl and FnProto take advantage of TrailerFlags API
These AST nodes now have a flags field and then a bunch of optional
trailing objects. The end result is lower memory usage and consequently
better performance. This is part of an ongoing effort to reduce the
amount of memory parsed ASTs take up.
Running `zig fmt` on the std lib:
* cache-misses: 2,554,321 => 2,534,745
* instructions: 3,293,220,119 => 3,302,479,874
* peak memory: 74.0 MiB => 73.0 MiB
Holding the entire std lib AST in memory at the same time:
93.9 MiB => 88.5 MiB
2020-07-15 01:38:31 -07:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
stage2: VarDecl and FnProto take advantage of TrailerFlags API
These AST nodes now have a flags field and then a bunch of optional
trailing objects. The end result is lower memory usage and consequently
better performance. This is part of an ongoing effort to reduce the
amount of memory parsed ASTs take up.
Running `zig fmt` on the std lib:
* cache-misses: 2,554,321 => 2,534,745
* instructions: 3,293,220,119 => 3,302,479,874
* peak memory: 74.0 MiB => 73.0 MiB
Holding the entire std lib AST in memory at the same time:
93.9 MiB => 88.5 MiB
2020-07-15 01:38:31 -07:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-28 12:19:00 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-05-28 12:19:00 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-05-28 12:19:00 -04:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-05-16 20:23:15 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-16 20:23:15 -04:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-06-18 19:03:41 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-03 21:01:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stage2: VarDecl and FnProto take advantage of TrailerFlags API
These AST nodes now have a flags field and then a bunch of optional
trailing objects. The end result is lower memory usage and consequently
better performance. This is part of an ongoing effort to reduce the
amount of memory parsed ASTs take up.
Running `zig fmt` on the std lib:
* cache-misses: 2,554,321 => 2,534,745
* instructions: 3,293,220,119 => 3,302,479,874
* peak memory: 74.0 MiB => 73.0 MiB
Holding the entire std lib AST in memory at the same time:
93.9 MiB => 88.5 MiB
2020-07-15 01:38:31 -07:00
|
|
|
|
2020-06-27 21:10:44 -04:00
|
|
|
|
2020-06-26 04:36:17 -04:00
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-26 04:03:54 -04:00
|
|
|
|
2020-06-26 04:36:17 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-26 04:03:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-08 01:18:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-26 04:03:54 -04:00
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stage2: VarDecl and FnProto take advantage of TrailerFlags API
These AST nodes now have a flags field and then a bunch of optional
trailing objects. The end result is lower memory usage and consequently
better performance. This is part of an ongoing effort to reduce the
amount of memory parsed ASTs take up.
Running `zig fmt` on the std lib:
* cache-misses: 2,554,321 => 2,534,745
* instructions: 3,293,220,119 => 3,302,479,874
* peak memory: 74.0 MiB => 73.0 MiB
Holding the entire std lib AST in memory at the same time:
93.9 MiB => 88.5 MiB
2020-07-15 01:38:31 -07:00
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-03 21:56:21 -07:00
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
|
|
|
|
|
2020-06-24 20:28:52 -04:00
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-06-24 20:28:52 -04:00
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-03 21:56:21 -07:00
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-08 02:31:04 -04:00
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-03 21:56:21 -07:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-08 02:31:04 -04:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
2020-06-08 02:31:04 -04:00
|
|
|
|
2020-06-05 15:49:23 -04:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
2020-06-08 02:31:04 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-08 02:31:04 -04:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-02 17:43:51 -04:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-07 14:55:44 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-27 07:16:59 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-27 07:16:59 -04:00
|
|
|
|
2020-06-27 21:50:59 -04:00
|
|
|
|
2020-08-03 22:07:21 -07:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-18 19:03:41 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-08-03 21:56:21 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
2020-08-03 21:56:21 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-06-05 15:49:23 -04:00
|
|
|
|
2020-08-03 21:56:21 -07:00
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
2020-06-05 15:49:23 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-05 15:49:23 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
2020-08-08 01:18:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self-hosted: AST flattening, astgen improvements, result locations, and more
* AST: flatten ControlFlowExpression into Continue, Break, and Return.
* AST: unify identifiers and literals into the same AST type: OneToken
* AST: ControlFlowExpression uses TrailerFlags to optimize storage
space.
* astgen: support `var` as well as `const` locals, and support
explicitly typed locals. Corresponding Module and codegen code is not
implemented yet.
* astgen: support result locations.
* ZIR: add the following instructions (see the corresponding doc
comments for explanations of semantics):
- alloc
- alloc_inferred
- bitcast_result_ptr
- coerce_result_block_ptr
- coerce_result_ptr
- coerce_to_ptr_elem
- ensure_result_used
- ensure_result_non_error
- ret_ptr
- ret_type
- store
- param_type
* the skeleton structure for result locations is set up. It's looking
pretty clean so far.
* add compile error for unused result and compile error for discarding
errors.
* astgen: split builtin calls up to implemented manually, and implement
`@as`, `@bitCast` (and others) with respect to result locations.
* add CLI support for hex and raw object formats. They are not
supported by the self-hosted compiler yet, and emit errors.
* rename `--c` CLI to `-ofmt=[objectformat]` which can be any of the
object formats. Only ELF and C are supported so far. Also added missing
help to the help text.
* Remove hard tabs from C backend test cases. Shame on you Noam, you
are grounded, you should know better, etc. Bad boy.
* Delete C backend code and test case that relied on comptime_int
incorrectly making it all the way to codegen.
2020-07-23 23:05:26 -07:00
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-03 22:07:21 -07:00
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-26 03:15:12 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-08-03 22:07:21 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-28 12:19:00 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-03 22:07:21 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-08-03 22:07:21 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-27 21:50:59 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-26 03:17:13 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-26 03:17:13 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-27 21:50:59 -04:00
|
|
|
|
2020-06-27 07:16:59 -04:00
|
|
|
|
2020-06-27 21:39:39 -04:00
|
|
|
|
2020-06-26 03:17:13 -04:00
|
|
|
|
2020-06-27 21:50:59 -04:00
|
|
|
|
2020-07-13 15:34:31 -07:00
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-20 13:11:07 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-20 13:11:07 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-07-20 13:11:07 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-07-20 13:11:07 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-07-20 13:11:07 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-07-20 13:11:07 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-07-20 13:11:07 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-07-28 21:57:13 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
2020-07-28 21:57:13 -07:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-06-23 19:53:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-08 20:46:06 -07:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
2020-06-23 19:53:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-15 15:42:02 -07:00
|
|
|
|
2020-06-23 19:53:32 -04:00
|
|
|
|
|
|
|
|
|
2020-07-04 22:25:49 +00:00
|
|
|
|
2020-06-23 19:53:32 -04:00
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-28 17:27:44 -07:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-07-28 21:57:13 -07:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-07-27 17:09:47 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-20 13:11:07 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-08 06:56:20 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-20 13:11:07 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
|
|
|
|
|
2020-07-12 23:04:00 -07:00
|
|
|
|
2020-07-07 08:01:54 +00:00
|
|
|
|
|
|
|
|
|
2020-07-12 23:04:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-24 17:51:24 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-23 19:25:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-12 23:04:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self-hosted: working towards conditional branching test case
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:25:09 -04:00
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-20 22:45:27 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-07-28 01:39:05 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-20 22:45:27 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-21 21:43:40 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-20 22:45:27 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-20 22:45:27 +03:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-07-21 17:14:40 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-20 22:45:27 +03:00
|
|
|
|
2020-07-21 17:14:40 +03:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-20 22:45:27 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-21 17:14:40 +03:00
|
|
|
|
2020-07-20 22:45:27 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-28 17:27:44 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-28 21:57:13 -07:00
|
|
|
|
2020-07-28 17:27:44 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-20 13:11:07 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-15 15:42:02 -07:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-16 20:23:15 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-15 15:42:02 -07:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-11 14:09:04 +03:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-15 15:42:02 -07:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-11 14:09:04 +03:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-16 20:23:15 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-16 20:23:15 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-28 21:15:08 -04:00
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-24 03:46:32 -04:00
|
|
|
|
2020-06-17 04:29:54 -04:00
|
|
|
|
|
|
|
|
|
self-hosted: AST flattening, astgen improvements, result locations, and more
* AST: flatten ControlFlowExpression into Continue, Break, and Return.
* AST: unify identifiers and literals into the same AST type: OneToken
* AST: ControlFlowExpression uses TrailerFlags to optimize storage
space.
* astgen: support `var` as well as `const` locals, and support
explicitly typed locals. Corresponding Module and codegen code is not
implemented yet.
* astgen: support result locations.
* ZIR: add the following instructions (see the corresponding doc
comments for explanations of semantics):
- alloc
- alloc_inferred
- bitcast_result_ptr
- coerce_result_block_ptr
- coerce_result_ptr
- coerce_to_ptr_elem
- ensure_result_used
- ensure_result_non_error
- ret_ptr
- ret_type
- store
- param_type
* the skeleton structure for result locations is set up. It's looking
pretty clean so far.
* add compile error for unused result and compile error for discarding
errors.
* astgen: split builtin calls up to implemented manually, and implement
`@as`, `@bitCast` (and others) with respect to result locations.
* add CLI support for hex and raw object formats. They are not
supported by the self-hosted compiler yet, and emit errors.
* rename `--c` CLI to `-ofmt=[objectformat]` which can be any of the
object formats. Only ELF and C are supported so far. Also added missing
help to the help text.
* Remove hard tabs from C backend test cases. Shame on you Noam, you
are grounded, you should know better, etc. Bad boy.
* Delete C backend code and test case that relied on comptime_int
incorrectly making it all the way to codegen.
2020-07-23 23:05:26 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-15 18:15:59 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
2020-06-11 01:22:07 -04:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-11 14:09:04 +03:00
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-07-11 14:09:04 +03:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 06:10:44 +00:00
|
|
|
|
|
|
|
|
|
2020-05-15 21:44:33 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 23:29:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-23 19:25:22 +02:00
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-07-23 19:25:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-07-23 19:25:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-07-23 19:25:22 +02:00
|
|
|
|
|
|
|
|
|
2020-07-24 17:51:24 +02:00
|
|
|
|
2020-07-23 19:25:22 +02:00
|
|
|
|
|
|
|
|
|
2020-07-24 17:51:24 +02:00
|
|
|
|
2020-07-23 19:25:22 +02:00
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-07-23 19:25:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-07-23 19:25:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-07-23 19:25:22 +02:00
|
|
|
|
|
|
|
|
|
2020-07-24 17:51:24 +02:00
|
|
|
|
2020-07-23 19:25:22 +02:00
|
|
|
|
|
|
|
|
|
2020-07-24 17:51:24 +02:00
|
|
|
|
2020-07-23 19:25:22 +02:00
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-07-23 19:25:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-27 22:44:18 -07:00
|
|
|
|
2020-07-23 19:25:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-28 01:39:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-28 17:27:44 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-28 21:57:13 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-03 21:56:21 -07:00
|
|
|
|
2020-07-28 21:57:13 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-03 21:56:21 -07:00
|
|
|
|
2020-07-28 21:57:13 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-03 21:56:21 -07:00
|
|
|
|
2020-07-28 21:57:13 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|