0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
zig/src-self-hosted/Module.zig

2872 lines
108 KiB

2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-06-29 21:58:34 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 23:54:13 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -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-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -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-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-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -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
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: 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
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: 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: 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: 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: 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: 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-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -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-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-07-08 20:33:33 -07:00
2020-05-15 21:44:33 -04:00
2020-07-08 20:33:33 -07: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
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: 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: 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-05-15 21:44:33 -04:00
2020-05-15 23:54:13 -04:00
2020-05-15 23:54:13 -04:00
2020-05-15 23:54:13 -04:00
2020-05-15 23:54:13 -04:00
2020-05-15 23:54:13 -04: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-05-15 23:54:13 -04:00
2020-05-15 23:54:13 -04:00
2020-05-15 23:54:13 -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-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-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-07-04 22:25:49 +00:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04: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-05-15 21:44:33 -04:00
2020-07-04 22:25:49 +00:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04: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-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-06-29 21:58:34 -04:00
2020-06-29 21:58:34 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-07-08 20:33:33 -07:00
2020-07-08 20:33:33 -07:00
2020-07-08 20:33:33 -07: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
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: 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: 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-08 20:33:33 -07:00
2020-07-08 20:33:33 -07: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-13 00:28:11 -07:00
2020-07-08 20:33:33 -07:00
2020-07-08 20:33:33 -07:00
2020-07-08 20:33:33 -07:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-06-27 21:10:44 -04:00
2020-07-04 22:25:49 +00:00
2020-07-04 22:25:49 +00:00
2020-07-04 22:25:49 +00:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-07-04 22:25:49 +00: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-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-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -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-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04: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-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-27 21:39:39 -04:00
2020-07-04 22:25:49 +00:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04: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-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04: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-05-15 21:44:33 -04:00
2020-07-23 19:25:22 +02:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-07-21 17:14:40 +03:00
2020-07-21 17:14:40 +03:00
2020-05-15 21:44:33 -04:00
2020-07-21 17:14:40 +03:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -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-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-05-15 21:44:33 -04:00
2020-07-23 19:25:22 +02:00
2020-07-23 19:25:22 +02:00
2020-07-23 19:25:22 +02:00
2020-07-23 19:25:22 +02:00
2020-07-23 19:25:22 +02:00
2020-07-23 19:25:22 +02:00
2020-07-23 19:25:22 +02:00
2020-07-23 19:25:22 +02:00
2020-07-23 19:25:22 +02:00
2020-07-23 19:25:22 +02:00
2020-07-23 19:25:22 +02:00
2020-07-23 19:25:22 +02:00
2020-07-23 19:25:22 +02:00