aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.hpp
AgeCommit message (Collapse)Author
2019-02-20packed structs support comptime bitcastingAndrew Kelley
* `type_size_store` is no longer a thing. loading and storing a pointer to a value may dereference up to `@sizeOf(T)` bytes, even for integers such as `u24`. * fix `types_have_same_zig_comptime_repr` to not think that the same `ZigTypeId` means the `ConstExprValue` neccesarily has the same representation. * implement `buf_write_value_bytes` and `buf_read_value_bytes` for `ContainerLayoutPacked` closes #1120
2019-02-15typecheck the panic functionAndrew Kelley
this adds the prototype of panic to @import("builtin") and then uses it to do an implicit cast of the panic function to this prototype, rather than redoing all the implicit cast logic. closes #1894 closes #1895
2019-02-15breaking: fix @sizeOf to be alloc size rather than store sizeAndrew Kelley
* Fixes breaches of the guarantee that `@sizeOf(T) >= @alignOf(T)` * Fixes std.mem.secureZero for integers where this guarantee previously was breached * Fixes std.mem.Allocator for integers where this guarantee previously was breached Closes #1851 Closes #1864
2019-02-14omit nonnull attribute for C pointersAndrew Kelley
See #1059
2019-02-14runtime safety check for casting null to pointerAndrew Kelley
see #1059
2019-02-12disallow C pointers to non-C-ABI-compatible element typesAndrew Kelley
See #1059
2019-02-11translate-c: use C pointer type everywhereAndrew Kelley
See #1059
2019-02-06thread local storage working for linux x86_64Andrew Kelley
2019-02-04SIMD: array to vector, vector to array, wrapping int addAndrew Kelley
also vectors and arrays now use the same ConstExprVal representation See #903
2019-01-30introduce vector type for SIMDAndrew Kelley
See #903 * create with `@Vector(len, ElemType)` * only wrapping addition is implemented This feature is far from complete; this is only the beginning.
2019-01-29backport copy elision changesAndrew Kelley
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-09when rendering llvm const values, ensure the types alignAndrew Kelley
the representation of the const expr val in zig, and the type that we tell LLVM it is.
2018-11-24refactor type_requires_comptime to have possible errorAndrew Kelley
fixes a compiler crash when building https://github.com/AndreaOrru/zen
2018-11-06limit integer types to maximum bit width of 65535Andrew Kelley
closes #1541
2018-09-26the last number in a packed ptr is host int bytesAndrew Kelley
See #1121
2018-09-20better string literal caching implementationAndrew Kelley
We were caching the ConstExprValue of string literals, which works if you can never modify ConstExprValues. This premise is broken with `comptime var ...`. So I implemented an optimization in ConstExprValue arrays, where it stores a `Buf *` directly rather than an array of ConstExprValues for the elements, and then similar to array of undefined, it is expanded into the canonical form when necessary. However many operations can happen directly on the `Buf *`, which is faster. Furthermore, before a ConstExprValue array is expanded into canonical form, it removes itself from the string literal cache. This fixes the issue, because before an array element is modified it would have to be expanded. closes #1076
2018-09-18fix optional pointer to empty struct incorrectly being non-nullAndrew Kelley
closes #1178
2018-09-14fix alignment of structsAndrew Kelley
closes #1248 closes #1052 closes #1154
2018-09-14fix coroutine alignmentAndrew Kelley
zig returned the wrong alignment for coroutine promises in some cases
2018-09-13remove `this`. add `@This()`.Andrew Kelley
closes #1283
2018-09-11Merge remote-tracking branch 'origin/master' into stage1-cachingAndrew Kelley
2018-09-11ability to disable cache. off by default except for...Andrew Kelley
...zig run, zig build, compiler_rt.a, and builtin.a
2018-09-07C ABI: support returning large structs on x86_64Andrew Kelley
also panic instead of emitting bad code for returning small structs See #1481
2018-09-07stage1: refactor fn type analysis to use C ABI walk fnAndrew Kelley
2018-09-06add C ABI testsAndrew Kelley
2018-09-05stage1: improve handling of generic fn proto type exprAndrew Kelley
closes #902
2018-09-05add compile error for using outer scoped runtime variablesAndrew Kelley
from a fn defined inside it. closes #876
2018-09-05stage1: rename VariableTableEntry to ZigVarAndrew Kelley
2018-09-05stage1: rename FnTableEntry to ZigFnAndrew Kelley
2018-09-05stage1: rename TypeTableEntry to ZigTypeAndrew Kelley
2018-09-04add compile error for comptime control flow inside runtime blockAndrew Kelley
closes #834
2018-08-25fix stack traces on linuxAndrew Kelley
2018-07-16all integer sizes are available as primitivesAndrew Kelley
* fix wrong implicit cast for `@IntType` bit_count parameter. * fix incorrect docs for `@IntType` bit_count parameter. closes #1242 closes #745 closes #1240
2018-07-06add compile error notes for where struct definitions areAndrew Kelley
closes #1202
2018-06-26rename get_maybe_type to get_optional_typeAndrew Kelley
2018-06-08Allow access of array.len through a pointerJimmi HC
2018-06-04Pointer Reform: proper slicing and indexing (#1053)Andrew Kelley
* enable slicing for single-item ptr to arrays * disable slicing for other single-item pointers * enable indexing for single-item ptr to arrays * disable indexing for other single-item pointers see #770 closes #386
2018-06-04disallow single-item pointer indexingAndrew Kelley
add pointer arithmetic for unknown length pointer
2018-05-30Removed copy-pasted resolve_inferred_error_setJimmi HC
both ir.cpp and analyze.cpp have a function resolve_inferred_error_set, which is a nearly exact copy-paste. This commit removes the one in ir.cpp and exposes then one in analyze.cpp. This also allows us to make analyze_fn_body local to analyze.cpp, as it is not used anywhere in ir.cpp after this change
2018-05-09Added Slice as it's own type info in userlandJimmi HC
2018-04-18support break in suspend blocksAndrew Kelley
* you can label suspend blocks * labeled break supports suspend blocks See #803
2018-03-24fix invalid codegen for error return traces across suspend pointsAndrew Kelley
See #821 Now the code works correctly, but error return traces are missing the frames from coroutines.
2018-03-12some return types disqualify comptime fn call cachingAndrew Kelley
closes #828
2018-03-10fix await multithreaded data raceAndrew Kelley
coro return was reading from a value that coro await was writing to. that wasn't how it was designed to work, it was an implementation mistake. this commit also has some work-in-progress code for fixing error return traces across suspend points.
2018-03-09don't memoize comptime functions if they can mutate state via parametersAndrew Kelley
closes #639
2018-03-06ptrCast builtin now gives an error for removing const qualifierAndrew Kelley
closes #384
2018-03-01implementation of awaitAndrew Kelley
but it has bugs
2018-02-28another workaround for llvm coroutinesAndrew Kelley
this one doesn't work either
2018-02-25codegen for coro_id instructionAndrew Kelley
See #727
2018-02-23implement Zig IR for async functionsAndrew Kelley
See #727