Commit Graph

22 Commits

Author SHA1 Message Date
Andrew Kelley
581edd643f
backport copy elision changes
This commit contains everything from the copy-elision-2
branch that does not have to do with copy elision directly,
but is generally useful for master branch.

 * All const values know their parents, when applicable, not
   just structs and unions.
 * Null pointers in const values are represented explicitly,
   rather than as a HardCodedAddr value of 0.
 * Rename "maybe" to "optional" in various code locations.
 * Separate DeclVarSrc and DeclVarGen
 * Separate PtrCastSrc and PtrCastGen
 * Separate CmpxchgSrc and CmpxchgGen
 * Represent optional error set as an integer, using the 0 value.
   In a const value, it uses nullptr.
 * Introduce type_has_one_possible_value and use it where applicable.
 * Fix debug builds not setting memory to 0xaa when storing
   undefined.
 * Separate the type of a variable from the const value of a variable.
 * Use copy_const_val where appropriate.
 * Rearrange structs to pack data more efficiently.
 * Move test/cases/* to test/behavior/*
 * Use `std.debug.assertOrPanic` in behavior tests instead of
   `std.debug.assert`.
 * Fix outdated slice syntax in docs.
2019-01-29 22:30:30 -05:00
Andrew Kelley
5864d92b40
when rendering llvm const values, ensure the types align
the representation of the const expr val in zig, and the
type that we tell LLVM it is.
2019-01-09 10:43:48 -05:00
Andrew Kelley
3500d32db5
stage1: rename FnTableEntry to ZigFn 2018-09-05 18:34:33 -04:00
Andrew Kelley
db882e5d63
stage1: rename TypeTableEntry to ZigType 2018-09-05 18:33:07 -04:00
Andrew Kelley
e1d5da20a5 rewrite parseh to use AST instead of direct types
some tests still failing
2017-09-02 04:11:23 -04:00
Andrew Kelley
6de33ded81 make undefined as a constant value lazy
closes #268
2017-04-23 14:34:40 -04:00
Andrew Kelley
d784705353 IR: implement macro for function aliasing function pointer 2017-01-12 03:15:06 -05:00
Andrew Kelley
c32a060d4f IR: add unreachable code compiler error 2017-01-04 23:21:33 -05:00
Andrew Kelley
132e2fa5d9 errors from inline fn calls include stack trace 2016-12-18 20:52:40 -05:00
Andrew Kelley
e50ced44a2 IR: all structs anonymous 2016-12-18 16:56:50 -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
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
25a89e7a36 IR: compile time function evaluation 2016-12-04 23:52:43 -05:00
Andrew Kelley
c6ace9720c rename BlockContext to Scope 2016-12-01 13:55:56 -05:00
Andrew Kelley
62d0d88b56 IR: pointers to constants don't copy data 2016-11-17 04:00:02 -05:00
Andrew Kelley
afc5507b64 ir: ability to modify global vars 2016-10-29 19:14:48 -04:00
Andrew Kelley
bfcd6648e7 IR can inline loops 2016-10-27 01:08:06 -04:00
Andrew Kelley
ac6d1674e3 IR working for if statements 2016-10-16 02:19:01 -04:00
Andrew Kelley
07fe60ded1 IR in 2 passes 2016-10-06 01:09:01 -04:00
Andrew Kelley
633781e31d empty function compiles successfully with IR 2016-09-30 20:12:00 -04:00
Andrew Kelley
4e2fa2d15b *WIP* 2016-09-30 02:21:21 -04:00