Commit Graph

937 Commits (2e6aa6d813cf3fd4180b8c9ffc671b4bcee54586)

Author SHA1 Message Date
Andrew Kelley 2e6aa6d813 IR: fix codegen of ref instruction 2016-12-18 13:55:34 -05:00
Andrew Kelley a76b048354 IR: phi instruction handles unreachable values correctly 2016-12-18 13:37:50 -05:00
Andrew Kelley b59841a80f IR: fix err variable in ErrOkOr instruction 2016-12-18 13:20:19 -05:00
Andrew Kelley 0cdfd5c141 IR: fix container field access via container pointer 2016-12-18 02:13:07 -05:00
Andrew Kelley 0d2f2b79ea IR: basic support for implicit casting to const pointer 2016-12-18 01:54:27 -05:00
Andrew Kelley 69cf0ea568 IR: fix type of decls accessed via namespace 2016-12-18 00:53:29 -05:00
Andrew Kelley 3e4194bf9e IR: add runime negation 2016-12-18 00:36:11 -05:00
Andrew Kelley 05b3b6a45e IR: update some std code to newest zig 2016-12-18 00:25:26 -05:00
Andrew Kelley 83a668b9ca IR: unreachable has lowest priority when resolving peer types 2016-12-18 00:25:07 -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 e73faf9a9e IR: allow undefined compile time values sometimes 2016-12-17 22:13:15 -05:00
Andrew Kelley d245fabb80 IR: consolidate Ref and PrefixOpAddressOf instructions 2016-12-17 22:00:55 -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 a07d7ee53d IR: fix compile time switch eval for enums 2016-12-17 17:57:26 -05:00
Andrew Kelley c64f9991d5 IR: fix switching on enum 2016-12-17 17:48:07 -05:00
Andrew Kelley 12fcbecbf8 IR: add more instructions
* MaybeWrap
 * TestErr
 * UnwrapErrCode
 * UnwrapErrPayload
 * ErrUnionTypeChild
 * ErrWrapCode
 * ErrWrapPayload
2016-12-17 16:16:17 -05:00
Andrew Kelley 3a3cc7bf76 IR: panic with a TODO instead of generating invalid code
for returning from a function without running maybe and error defers
2016-12-14 15:43:24 -05:00
Andrew Kelley cca49b84b6 fix external function calls 2016-12-14 15:24:00 -05:00
Andrew Kelley 647d13168a IR: implement maybe return expression 2016-12-13 19:36:56 -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 8bb5f54b29 IR: implement character literal 2016-12-13 01:58:36 -05:00
Andrew Kelley a6d2bdf605 IR: implement breakpoint builtin 2016-12-13 01:48:40 -05:00
Andrew Kelley 76a849b1f2 IR: implement memberCount builtin 2016-12-12 01:59:55 -05:00
Andrew Kelley ef63bc9cca IR: implement memcpy, memset, and slice expression 2016-12-12 00:31:35 -05:00
Andrew Kelley fb21570630 IR: implement alloca builtin 2016-12-11 19:43:06 -05:00
Andrew Kelley a963fba246 IR: implement compile time array concatenation 2016-12-11 18:43:52 -05:00
Andrew Kelley df0cdceff7 IR: implement compile time array multiplication 2016-12-11 17:17:00 -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 3429639e84 IR: implement truncate builtin 2016-12-11 15:31:07 -05:00
Andrew Kelley 433c17aeb1 IR: implement divExact builtin 2016-12-11 14:27:37 -05:00
Andrew Kelley 8fcb1a141b IR: implement fence and cmpxchg builtins 2016-12-11 04:06:07 -05:00
Andrew Kelley 10cea15cc3 IR: implement embedFile builtin 2016-12-11 00:43:23 -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 3cfbec3eef IR: don't crash if number literal used with pure error 2016-12-10 18:43:28 -05:00
Andrew Kelley 6feae8a4e9 IR: support error union type 2016-12-10 18:38:53 -05:00
Andrew Kelley 443e14afbd IR: fix errorName builtin 2016-12-10 17:11:35 -05:00
Andrew Kelley 0ab953acb2 IR: better array len instruction
reference the "len" field directly instead of looking it up by
name since we already know exactly where the field metadata is
2016-12-08 02:15:48 -05:00
Andrew Kelley d4a93dbac5 IR: omit debug safety checks in for loop codegen 2016-12-08 02:09:26 -05:00
Andrew Kelley 7d0fb281fe IR: a bunch of fixes and some additions
* add errorName builtin function
 * add assertion for generated memcopy being on correct types
 * respect handle_is_ptr for constant values
 * fix return codegen to respect sret semantics
 * remove ArrayLen IR instruction; we already have StructFieldPtr
   with "len" field
 * fix gen_const_val for pointers inside aggregates
2016-12-08 01:52:57 -05:00
Andrew Kelley a148096e6a IR: add compileError builtin fn 2016-12-07 11:29:44 -05:00
Andrew Kelley 0ad580f001 IR: add minValue, maxValue, and negation 2016-12-07 01:23:38 -05:00
Andrew Kelley 5e4ee659a6 delete unused builtin function stuff 2016-12-07 00:35:39 -05:00
Andrew Kelley c0b2fe4d6c IR: add error for assigning runtime value to inline var 2016-12-07 00:22:14 -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 0c531d447d remove the boolean argument from setFnTest 2016-12-05 21:39:15 -05:00
Andrew Kelley bed83bc5a1 IR: implement short circuit bool or, and 2016-12-05 19:12:19 -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