2645 Commits

Author SHA1 Message Date
Andrew Kelley
aa2aad229c
Merge pull request #4497 from LemonBoy/do-do-do
The great stack-trace race (Part 1 of N)
2020-02-26 11:10:38 -05:00
LemonBoy
d2535c003c ir: Fix regression with self-referencing containers 2020-02-26 10:05:04 +01:00
Andrew Kelley
a55e536391
fix typo in previous commit
oops, forgot to actually run the test
2020-02-25 21:32:03 -05:00
Andrew Kelley
e75598af3d
add test case to catch regression from previous commit
Once this test case is passing, previous commit can be re-added.

Closes #4560
2020-02-25 21:24:27 -05:00
Andrew Kelley
dad62a7e27
Revert "ir: Fix sizeOf comparison with ptr to zst"
This reverts commit 89812217b4e5fee7e2851266c17c9d47204a1573.

This caused #4560
2020-02-25 21:23:35 -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
LemonBoy
89812217b4 ir: Fix sizeOf comparison with ptr to zst
Closes #4536
2020-02-25 17:36:54 -05:00
Andrew Kelley
f33bf48af7
Merge remote-tracking branch 'origin/master' into llvm10 2020-02-25 16:30:40 -05:00
LemonBoy
b46efcde82 ir: Fix sizeOf comparison with ptr to zst
Closes #4536
2020-02-25 12:48:08 +01:00
Vexu
d56115ef41
remove @IntType and @ArgType (mostly) from the compiler 2020-02-25 01:27:34 +02:00
Vexu
538d9a5dd8
remove uses of @ArgType and @IntType 2020-02-24 23:39:03 +02:00
Vexu
45da72c5b6
remove usages of @typeId, @memberCount, @memberName and @memberType 2020-02-24 23:09:01 +02:00
Andrew Kelley
1d06c82c3b
Merge pull request #4516 from xackus/remove-bytes-to-slice
remove @bytesToSlice, @sliceToBytes from the language
2020-02-24 13:51:47 -05:00
LemonBoy
08047cd6d7 correct test expectations 2020-02-23 22:47:48 +01:00
xackus
7664c3bc11 remove @bytesToSlice, @sliceToBytes from tests, docs 2020-02-23 18:03:50 +01:00
Andrew Kelley
570973761a
add regression test for already fixed bug
closes #3586
2020-02-21 15:31:00 -05:00
Andrew Kelley
2de7d0b10c
fix zig build, ABI ABI, and update tests to new Target layout 2020-02-20 18:50:20 -05:00
Andrew Kelley
903127f36c
Merge remote-tracking branch 'origin/master' into sub-architecture-annihilation 2020-02-20 18:36:04 -05:00
Andrew Kelley
0f016b368d
support -mcpu=baseline, both in stage1 and stage2
See e381a42de9c0f0c5439a926b0ac99026a0373f49 for more details.
This is set up so that if we wish to make "baseline" depend on the
OS in the future, it is possible to do that.
2020-02-20 18:31:17 -05:00
Andrew Kelley
b0d2ebe529 remove std.io.readLine
This was deceptive. It was always meant to be sort of a "GNU readline"
sort of thing where it provides a Command Line Interface to input text.
However that functionality did not exist and it was basically a red
herring for people trying to read line-delimited input from a stream.

In this commit the API is deleted, so that people can find the proper
API more easily.

A CLI text input abstraction would be useful but may not even need to be
in the standard library. As you can see in this commit, the guess_number
CLI game gets by just fine by using `std.fs.File.read`.
2020-02-20 15:30:00 -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
84f1893c18
remove the concept of "sub-architecture"
in favor of CPU features. Also rearrange the `std.Target`
data structure.

 * note: `@import("builtin")` was already deprecated in favor of
   `@import("std").builtin`.
 * `std.builtin.arch` is now deprecated in favor of
   `std.builtin.cpu.arch`.
 * `std.Target.CpuFeatures.Cpu` is now `std.Target.Cpu.Model`.
 * `std.Target.CpuFeatures` is now `std.Target.Cpu`.
 * `std.Target` no longer has an `arch` field. Instead it has a
   `cpu` field, which has `arch`, `model`, and `features`.
 * `std.Target` no longer has a `cpu_features` field.
 * `std.Target.Arch` is moved to `std.Target.Cpu.Arch` and
   it is an enum instead of a tagged union.
 * `std.Target.parseOs` is moved to `std.Target.Os.parse`.
 * `std.Target.parseAbi` is moved to `std.Target.Abi.parse`.
 * `std.Target.parseArchSub` is only for arch now and moved
    to `std.Target.Cpu.Arch.parse`.
 * `std.Target.parse` is improved to accept CPU name and features.
 * `std.Target.Arch.getBaselineCpuFeatures` is moved to
   `std.Target.Cpu.baseline`.
 * `std.Target.allCpus` is renamed to `std.Target.allCpuModels`.
 * `std.Target.defaultAbi` is moved to `std.Target.Abi.default`.
 * Significant cleanup of aarch64 and arm CPU features, resulting in
   the needed bit count for cpu feature set going from 174 to 138.
 * Add `std.Target.Cpu.Feature.Set.addFeatureSet` for merging
   feature sets together.

`-target-feature` and `-target-cpu` are removed in favor of
`-mcpu`, to conform to established conventions, and it gains
additional power to support cpu features. The syntax is:
-mcpu=name+on1+on2-off1-off2

closes #4261
2020-02-19 21:30:36 -05:00
Andrew Kelley
63383a8af8
consistent capitalization of error message 2020-02-19 01:24:19 -05:00
Andrew Kelley
30194f27fb
update new test case to take into account lazy @typeInfo 2020-02-18 18:27:18 -05:00
LemonBoy
a6b74cdd38
stage1: Make the parser reject extern fn with body 2020-02-18 18:18:29 -05:00
Andrew Kelley
ccca4b5a5e
Merge pull request #4474 from LemonBoy/saukerkraut
Patches
2020-02-18 18:15:11 -05:00
Andrew Kelley
dd58278dbe
add behavior test for previous commit 2020-02-18 15:28:14 -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
Andrew Kelley
64365bc5d7
enable behavior and std lib tests for RISC-V 64-bit
closes #3338
2020-02-17 00:06:19 -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
Andrew Kelley
cb3a818699
zig fmt: support noasync await 2020-02-16 01:44:52 -05:00
Andrew Kelley
72805fd66e
fix taking address of temporary async frame 2020-02-16 01:44:49 -05:00
Vexu
b15958c557 fix c tokenizer bug 2020-02-14 18:57:57 -05:00
Andrew Kelley
9e1afdc234
Merge pull request #4454 from LemonBoy/capture-reform
Payload captures no longer alias the original value
2020-02-14 14:39:00 -05:00
Andrew Kelley
a8b36fbe34
Merge remote-tracking branch 'origin/master' into llvm10 2020-02-14 10:27:44 -05:00
LemonBoy
1c8ac2a0c1 test: Add test cases for the new capture behavior 2020-02-14 15:59:28 +01:00
Vexu
9206f8a8cd translate-c improve macro cast translation 2020-02-14 09:36:44 -05:00
Andrew Kelley
e8dfc5e7f6
Merge pull request #4442 from fengb/testing-allocator-calls
Migrate tests from FixedBufferAllocator to testing.allocator
2020-02-13 16:17:21 -05:00
Andrew Kelley
1675d4f82b
Merge pull request #4443 from LemonBoy/werkzeug
A train of small patches
2020-02-13 13:12:18 -05:00
Vexu
fa377dbd15 fix c tokenizer bug 2020-02-13 12:21:28 -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
Benjamin Feng
699c50a375 Switch a bunch of FBA to use testing.allocator 2020-02-12 17:17:56 -06: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
LemonBoy
f8fd8c481a test: Skip the atomic-on-fp test for riscv64 2020-02-11 17:03:10 +01: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
Vexu
ae5ba369e1 translate-c float fixes 2020-02-10 11:02:29 -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