Alexandros Naskos
11848fcb5f
Removed unused variable
2020-02-28 03:48:30 +02:00
Alexandros Naskos
c020bc27ac
More fixes, removed debug prints
2020-02-28 02:43:33 +02:00
Alexandros Naskos
95a1d2feb4
Fixed tuple concatenation with runtime and comptime values.
2020-02-28 02:19:17 +02:00
LemonBoy
2696c8b42d
ir: Robust checking for init expr type
...
Closes #3979
2020-02-27 10:40:22 -05:00
Vexu
d505ea6caf
fix @tagName on extern and non-exhaustive enums
2020-02-26 11:19:39 -05:00
LemonBoy
e9bac8be6b
ir: Fix array to slice conversion for zero-sized arrays
...
Closes #3848
2020-02-25 17:40:01 -05:00
LemonBoy
55ea855e2c
ir: Various fixes for comptime ptr handling
...
* Correctly fold ptrToInt on optional types
* Generate null as ConstPtrSpecialNull in intToPtr
* Correctly stop ptrToInt on ?*T where T is zero-sized
Closes #4535
2020-02-25 17:38:56 -05:00
Michael Dusan
416a547cdb
Merge pull request #4515 from mikdusan/stage1-gen-constants
...
stage1: free more heap after analysis
2020-02-25 10:57:47 -05:00
Vexu
d56115ef41
remove @IntType and @ArgType (mostly) from the compiler
2020-02-25 01:27:34 +02:00
Vexu
3458fb891d
remove @typeId, @memberCount, @memberName and @memberType from the compiler
2020-02-24 23:21:11 +02:00
xackus
9c35f680f7
nuke @bytesToSlice, @sliceToBytes in stage1
2020-02-23 19:03:55 +01:00
Michael Dusan
770631cc79
stage1: free more heap after analysis
...
- immediately free dangling IrInstGenConst after analysis
- fixup mem::List params `&Allocator` → `*Allocator`
2020-02-20 21:05:37 -05:00
LemonBoy
a385547786
ir: Compile error on result_loc type mismatch w/ slicing
...
Closes #4508
2020-02-20 13:14:19 +01:00
Andrew Kelley
ccca4b5a5e
Merge pull request #4474 from LemonBoy/saukerkraut
...
Patches
2020-02-18 18:15:11 -05:00
Timon Kruiper
7560fc716d
Makes the declaration slice resolve lazely when using @typeInfo
...
This way all the declarations in a container won't be resolved untill
the user actually uses the decls slice in the builtin TypeInfo union.
2020-02-18 15:26:37 -05:00
LemonBoy
6b74fd2e12
ir: Avoid invalidating the decl_table iterator
...
Collect the declarations to resolve first and run resolve_top_level_decl
on them later.
Closes #4310
2020-02-16 21:14:30 +01:00
LemonBoy
096f79260b
ir: Prevent crash when indexing undefined ptr to array
...
Closes #4471
2020-02-16 19:53:53 +01:00
Andrew Kelley
7f7d1fbe5a
Implement noasync awaits
...
Note that there is not yet runtime safety for this.
See #3157
2020-02-16 01:44:52 -05:00
LemonBoy
3038290a46
ir: Make all the payload captures do a copy
...
The payload doesn't alias anymore the same memory it comes from and is
instead a fresh copy of the original object.
2020-02-14 15:30:20 +01:00
LemonBoy
a090a5e3bc
ir: Don't crash when converting undefined ptrs
2020-02-13 16:18:24 -05:00
LemonBoy
c5260f7f86
ir: Allow implicit conversion between vector types
...
Only valid when the number of elements match and the types are
compatible.
Fixes #4334
2020-02-13 12:13:56 +01:00
LemonBoy
6c05f0949a
ir: Fix erroneous error message for ptr casts
...
Don't blindly throw an error if two integer types are checked for
compatibility.
Bug reported in #4430
2020-02-11 17:03:11 +01:00
Michael Dusan
e624c86289
Merge pull request #4389 from mikdusan/stage1-mem
...
stage1: memory/report overhaul
2020-02-10 23:08:33 -05:00
Michael Dusan
edb210905d
stage1: memory/report overhaul
...
- split util_base.hpp from util.hpp
- new namespaces: `mem` and `heap`
- new `mem::Allocator` interface
- new `heap::CAllocator` impl with global `heap::c_allocator`
- new `heap::ArenaAllocator` impl
- new `mem::TypeInfo` extracts names without RTTI
- name extraction is enabled w/ ZIG_ENABLE_MEM_PROFILE=1
- new `mem::List` takes explicit `Allocator&` parameter
- new `mem::HashMap` takes explicit `Allocator&` parameter
- add Codegen.pass1_arena and use for all `ZigValue` allocs
- deinit Codegen.pass1_arena early in `zig_llvm_emit_output()`
2020-02-10 21:08:08 -05:00
Timon Kruiper
2618366055
Add cast between [*c]T and ?[*:0]T on fn parameter
...
Fixes #4176
2020-02-10 19:43:58 -05:00
Andrew Kelley
3170ead9eb
compile error instead of abort for unimplemented @typeInfo
...
of `@Frame(func)`. Closes #3995
2020-02-10 19:14:54 -05:00
Andrew Kelley
70a4794c57
fix compiler assertion when duplicating fields...
...
...in nested anonymous struct literals
closes #4391
2020-02-10 10:57:40 -05:00
Andrew Kelley
014f66e6de
Merge pull request #4404 from ziglang/async-std
...
a big step towards std lib integration with async I/O
2020-02-10 00:22:59 -05:00
Andrew Kelley
5ea79bfc4a
fix not checking type of return pointer
...
Thanks to Vexu for the test cases.
Closes #3422
Closes #3646
Closes #3224
Closes #3327
Closes #3269
2020-02-09 22:34:34 -05:00
Andrew Kelley
04ee3b01a1
fix defer interfering with return value spill
2020-02-09 17:19:28 -05:00
Andrew Kelley
24d197b037
solve previous commit a better way
2020-02-08 15:28:12 -05:00
Andrew Kelley
d80db3546c
Revert "properly spill optional payload capture value"
...
This reverts commit 80ba21b83cd13849c1d1d9cdebfa070b03f334d3.
2020-02-08 15:07:12 -05:00
Andrew Kelley
80ba21b83c
properly spill optional payload capture value
2020-02-08 14:59:33 -05:00
LemonBoy
21932a0ef2
Fix edge case in cast between fn with varargs
...
* Prevent the next_param_index to become greater than the param_count
one as it's expected by every other function.
* Fix a typo in a error message.
Closes #4381
2020-02-05 20:31:18 +01:00
Andrew Kelley
f97b398b65
simplify int/float comparison
2020-01-29 17:20:41 -05:00
LemonBoy
fe4ef7b461
Fix comptime float-int comparisons
...
Closes #4259
2020-01-29 16:37:55 -05:00
LemonBoy
59bc1d2721
Fix edge case in switch with single else
...
ir_gen_switch_expr doesn't set the switch_br field at all if there are
zero cases, detect this situation and handle it gracefully.
Closes #4322
2020-01-29 16:05:14 -05:00
Benjamin Feng
a4ac7980b4
Add a spill to while error union
2020-01-29 10:01:51 -06:00
Benjamin Feng
2f239e3dbd
Add a spill to while optional
2020-01-28 23:36:43 -06:00
Andrew Kelley
504ce86ac9
fix more compile error test regressions
2020-01-28 14:17:25 -05:00
Andrew Kelley
793d81c4e8
fix result locations not handling undefined correctly
2020-01-28 13:33:51 -05:00
Andrew Kelley
86da9346e4
fix error message column/line number regressions
2020-01-28 13:25:49 -05:00
Andrew Kelley
e0000c47bd
fix regression of storing optional with 0-bit payload
2020-01-28 12:32:39 -05:00
Andrew Kelley
287d3c37e1
fix 0-bit child type coerced to optional return ptr result location
...
by un-special-casing 0 bit types in result locations
2020-01-28 11:39:36 -05:00
Andrew Kelley
8710fdbf39
fix line, column numbers of compile errors
2020-01-27 22:05:27 -05:00
Andrew Kelley
ae20574d5e
add missing spill for for loops with pointer elems
2020-01-27 21:30:11 -05:00
Andrew Kelley
9d59cdb8c1
fix auto created variables not having correct alignment
2020-01-27 19:42:32 -05:00
Andrew Kelley
37ab960492
fix not handling undefined u0 correctly
2020-01-27 18:59:46 -05:00
Andrew Kelley
b38b967844
fix triple level result location with bitcast sandwich
...
...passed as tuple element
2020-01-27 18:26:39 -05:00
Andrew Kelley
b96872ef2f
@bitCast result location: fix passing invalid alignment
...
when the value has 0 bits
2020-01-27 17:45:29 -05:00