Andrew Kelley
9b61682037
IR: implement runtime enum init and switch on enum with variable
2016-12-21 21:49:05 -05:00
Andrew Kelley
1f6dacbb2f
IR: enum init support
2016-12-20 01:50:32 -05:00
Andrew Kelley
09c34352f8
IR: if and switch guaranteed compile time if target expr is
2016-12-19 00:04:51 -05:00
Andrew Kelley
132e2fa5d9
errors from inline fn calls include stack trace
2016-12-18 20:52:40 -05:00
Andrew Kelley
82101198f1
workaround for Arch being a primitive type
2016-12-18 20:09:34 -05:00
Andrew Kelley
f12fbce0f5
IR: memoize compile-time evaluated fn invocations
2016-12-18 18:23:46 -05:00
Andrew Kelley
37b13bf151
hello.zig working with all structs anonymous
2016-12-18 17:24:52 -05:00
Andrew Kelley
e50ced44a2
IR: all structs anonymous
2016-12-18 16:56:50 -05:00
Andrew Kelley
9f08bfb38d
IR: make generic function type have zero_bits flag
2016-12-18 00:24:39 -05:00
Andrew Kelley
85b6d14637
IR: support var type args and fix phi peer type resolution
2016-12-18 00:09:43 -05:00
Andrew Kelley
0f047337ac
IR: fix this expression
...
Previously it returned a block instead of a function when
a function had any arguments.
2016-12-17 20:47:35 -05:00
Andrew Kelley
cca49b84b6
fix external function calls
2016-12-14 15:24:00 -05:00
Andrew Kelley
3f3630d7e3
IR: implement the rest of the builtin functions
...
* returnAddress
* frameAddress
* addWithOverflow
* subWithOverflow
* mulWithOverflow
* shlWithOverflow
* alignOf
2016-12-13 04:30:41 -05:00
Andrew Kelley
76a849b1f2
IR: implement memberCount builtin
2016-12-12 01:59:55 -05:00
Andrew Kelley
9b17c0ff7f
IR: implement intType builtin
...
and int type field access
and fix compile time bool not
2016-12-11 16:30:01 -05:00
Andrew Kelley
8fcb1a141b
IR: implement fence and cmpxchg builtins
2016-12-11 04:06:07 -05:00
Andrew Kelley
2dd85d52cc
IR: fix implementation of parseh
...
libc hello world works now
2016-12-11 00:13:43 -05:00
Andrew Kelley
7d9fa01ed5
IR: implement compile time eval unwrap maybe
2016-12-06 22:04:55 -05:00
Andrew Kelley
6ed202ab16
IR: implement defer
2016-12-06 21:26:17 -05:00
Andrew Kelley
24048b2af6
IR: implement break and continue
2016-12-05 18:43:16 -05:00
Andrew Kelley
0541532ed6
IR: implement generic function calls
2016-12-05 05:12:44 -05:00
Andrew Kelley
363606d87b
IR: inline function evaluation works on generic functions
2016-12-05 01:08:17 -05:00
Andrew Kelley
25a89e7a36
IR: compile time function evaluation
2016-12-04 23:52:43 -05:00
Andrew Kelley
2f259b8176
IR: re-organize where state goes to prepare for generics
...
* Rip out legacy code for generics
* put scope in instruction instead of AST nodes
* separate top level decl stuff from AST nodes
- remove the assumption that there is a 1:1 correspondence
between an output instruction and an AST node
- This way we won't have to clone AST nodes for generics.
2016-12-04 03:40:40 -05:00
Andrew Kelley
f6cbb73c74
rewrite scope implementation
...
* now there are not extra unused hash tables
* each variable declaration opens a new scope inside a function
2016-12-01 21:08:12 -05:00
Andrew Kelley
c6ace9720c
rename BlockContext to Scope
2016-12-01 13:55:56 -05:00
Andrew Kelley
eb5693d91f
IR: function call porting progress
...
also implemented container init
generics is still todo
2016-11-28 02:40:01 -05:00
Andrew Kelley
9e7c475979
IR: silence irrelevant function prototype errors
2016-11-27 01:45:29 -05:00
Andrew Kelley
bd4d4ee51e
IR: detect error for exceeding branch quota
2016-11-27 00:14:19 -05:00
Andrew Kelley
84f7805029
IR: support import builtin function
2016-11-26 20:52:22 -05:00
Andrew Kelley
bbf785bc1d
IR: switch expression works with numbers
2016-11-26 00:25:48 -05:00
Andrew Kelley
e80e8a8099
IR: fix detection of invalid codegen
2016-11-21 13:53:08 -05:00
Andrew Kelley
2f8dd46174
IR: error for uncasted null lit variable
2016-11-19 01:53:14 -05:00
Andrew Kelley
8a81f8aa13
IR: implement compileVar builtin and more
...
* implicit array to slice cast
* fix if statements at global scope
* implement array type IR
2016-11-19 01:39:51 -05:00
Andrew Kelley
d94cb0566b
IR: correctly codegening memset and memcpy
2016-11-18 22:24:41 -05:00
Andrew Kelley
62d0d88b56
IR: pointers to constants don't copy data
2016-11-17 04:00:02 -05:00
Andrew Kelley
d4f2394dcf
IR handles global variables correctly
2016-11-13 01:56:28 -05:00
Andrew Kelley
05de70017d
IR: support slice types
2016-11-07 18:58:01 -05:00
Andrew Kelley
a2e3293930
WIP moving all analysis to IR
2016-11-04 15:36:30 -04:00
Andrew Kelley
bc6c33b1b6
IR: support this literal and bool literal
2016-11-03 14:26:21 -04:00
Andrew Kelley
c8333d0cc9
add concept of inline for, inline while, inline var
2016-11-03 14:13:57 -04:00
Andrew Kelley
1a0111d4c3
*WIP*
2016-10-30 02:46:16 -04:00
Andrew Kelley
56cdaff9e7
ir: support return expression
2016-10-29 19:24:59 -04:00
Andrew Kelley
afc5507b64
ir: ability to modify global vars
2016-10-29 19:14:48 -04:00
Andrew Kelley
114049a220
IR analysis unrolls a complicated loop
2016-10-27 03:28:29 -04:00
Andrew Kelley
bfcd6648e7
IR can inline loops
2016-10-27 01:08:06 -04:00
Andrew Kelley
44d6f8ffd8
IR supports variable assignment
2016-10-23 01:33:23 -04:00
Andrew Kelley
d7a2b05a81
IR: introduce concept of lvalues
2016-10-23 00:21:29 -04:00
Andrew Kelley
a9a6f77a1f
add variable declaration initialization IR
2016-10-20 01:13:39 -04:00
Andrew Kelley
ac6d1674e3
IR working for if statements
2016-10-16 02:19:01 -04:00