15424 Commits

Author SHA1 Message Date
Martin Wickham
1d2c3af906 Remove address of pointer 2021-10-02 15:21:49 -05:00
Martin Wickham
272bad3f12 Delete Module.Scope, move Block into Sema 2021-10-02 15:21:49 -05:00
Martin Wickham
fd60012c21 Change *Scope to *Scope.Block, use Sema when required 2021-10-02 15:21:49 -05:00
Martin Wickham
01e08c92b3 Revert collateral changes, clarify abortAnonDecl() 2021-10-02 15:21:49 -05:00
Martin Wickham
53a36eacfa Remove my dumb "namespace decl" hack 2021-10-02 15:21:48 -05:00
Martin Wickham
d1a4bdb1f3 Declare generic fn dependency earlier to keep invariant 2021-10-02 15:21:48 -05:00
Martin Wickham
f7c11acb7f Resolve struct fields in a separate sema context 2021-10-02 15:21:48 -05:00
Martin Wickham
806eee8e99 Fix abortAnonDecl() 2021-10-02 15:21:48 -05:00
Martin Wickham
8d42500699 Implement hashing and equals for some pointer values 2021-10-02 15:21:48 -05:00
Martin Wickham
0b8ddb4478 Improve debug names of decls 2021-10-02 15:21:48 -05:00
Martin Wickham
993dc2ae77 Fix ownership of array type and elements 2021-10-02 15:21:48 -05:00
Martin Wickham
7ef5938450 Fix decl removal from namespace when destroyed 2021-10-02 15:21:48 -05:00
Martin Wickham
b1e5081826 Fix rendering of type names 2021-10-02 15:21:48 -05:00
Martin Wickham
269e548770 Fix namespace references for deeply nested structs 2021-10-02 15:21:48 -05:00
Nathan Michaels
4916e26be4 Document some functions in std.math. 2021-10-02 16:06:03 -04:00
Andrew Kelley
468ed7ada5
Merge pull request #9875 from g-w1/timestimes
stage2: emit Value.repeated for `**` with array len 1
2021-10-02 16:05:12 -04:00
Martin Wickham
05d36fce9c Add zlib to needed libraries 2021-10-02 14:58:16 -05:00
Andrew Kelley
49f687f7c6 build.zig: omit LLVMTableGen from the llvm lib list 2021-10-02 12:41:08 -07:00
Andrew Kelley
b9ec7c5675 build.zig: update list of LLVM libs
companion commit to 0f35a1f37ade9cf25707c41711b352174f1e2789

fixes compiling with a dev kit.
2021-10-02 12:40:40 -07:00
Andrew Kelley
dde0adcb36 Merge branch 'llvm13' 2021-10-02 10:45:56 -07:00
Andrew Kelley
7a2624c3e4 std: disable ArrayBitSet test on aarch64
See #9879. This regressed with the release of LLVM 13.0.0.
2021-10-01 22:32:13 -07:00
Andrew Kelley
c7b32eb99a ci: windows: update tar command line parameter order
you have got to be kidding me
2021-10-01 22:27:16 -07:00
Andrew Kelley
86bb09a0ff ci: update macos tarballs
These bring in a bug fix to libcxx.zig that is currently causing the CI
to fail.
2021-10-01 18:32:19 -07:00
Andrew Kelley
210ef5af8e ci: windows: adjust tar workaround
tar does not properly implement the -k feature, so don't use it.
It incorrectly reports "file exists" when the expected behavior is to
leave the existing file alone.
2021-10-01 18:07:50 -07:00
Andrew Kelley
f317acb2cd libcxx: pass -faligned-allocation flag when needed
libc++ now requires this flag
2021-10-01 18:06:17 -07:00
Andrew Kelley
acb0a87158 ci: windows: workaround for tar symlink behavior 2021-10-01 17:18:32 -07:00
Andrew Kelley
43e3734d3b ci: macos arm64 script uses release build of zig
even for the host. This prevents a dependency on "dump" functions of
LLVM, which are not included in the tarballs used for the CI.
2021-10-01 16:53:42 -07:00
Andrew Kelley
9bf10b1018 ci: update windows tarballs to llvm 13 2021-10-01 16:53:33 -07:00
Andrew Kelley
7350cb2fc7 ci: update tarballs for LLVM 13
NetBSD CI is disabled because it is not yet supported in
zig-bootstrap. Once NetBSD has proper zig-bootstrap support, it can be
re-enabled.

Windows is not solved here yet; will be pushing a separate commit for
that.
2021-10-01 16:07:42 -07:00
Jacob G-W
83dcd9f038 stage2: emit Value.repeated for ** where the array size is one
This takes advantage of the repeated value.
2021-10-01 16:46:28 -04:00
Andrew Kelley
456d7e5f5f libcxx: update to compile with -std=c++20
This is required to successfully build libc++.
2021-10-01 11:40:06 -07:00
Andrew Kelley
1bbec59e07 clang API bindings: fix enum detection functions
These functions are intended to emit compile errors when Clang adds new
items to its enums. However, two of them were casting to the Zig enum
and switching on that, which wouldn't detect anything useful.
2021-10-01 11:39:12 -07:00
Andrew Kelley
0f35a1f37a fix the list of llvm libraries
not sure what "HelloNew" was doing in there
2021-09-30 23:33:03 -07:00
Andrew Kelley
3eb729b442 Merge remote-tracking branch 'origin/master' into llvm13 2021-09-30 21:38:04 -07:00
Nathan Michaels
c4cd592f0e Fix a typo in @ceil documentation. 2021-09-30 23:32:09 -04:00
Jacob G-W
b0e89ee499 stage2 llvm backend: implement codegen for Value.repeated 2021-09-30 21:29:52 -04:00
g-w1
5e7406bdd9
stage2: implement array_init instruction (#9843)
* stage2: array mul support more types of operands
* stage2: array cat support more types of operands
* print_zir: print array_init
* stage2: implement Sema for array_init
2021-09-30 18:31:27 -04:00
Martin Wickham
c82c3585c8 Add error message to test runner for bad arguments 2021-09-30 18:00:13 -04:00
Martin Wickham
f87156e33c Add a panic handler to give better errors for crashes in sema 2021-09-30 17:39:01 -04:00
Matthew Borkowski
2ed9288246 parse.zig: better c pointer prefix parsing, don't index out of bounds on eof 2021-09-30 15:36:57 +02:00
Andrew Kelley
ba7f40c430 stage2: fix ELF linking to include compiler_rt
There was duplicated logic for whether to include compiler_rt in the
linker line both in the frontend and in the linker backends. Now the
logic is only in the frontend; the linker puts it on the linker line if
the frontend provides it.

Fixes the CI failures.
2021-09-29 15:37:34 -07:00
Andrew Kelley
bdbedff910 stage2: LLVM backend: properly set module target data
Also fix tripping LLVM assert having to do with 0 bit integers.
stage2 behavior tests now run clean in a debug build of llvm 12.
2021-09-29 15:33:45 -07:00
Andrew Kelley
ea6706b6f4 stage2: LLVM backend: implement struct type fwd decls
Makes struct types able to refer to themselves.
2021-09-29 14:04:52 -07:00
Andrew Kelley
1d1f6a0421 move some behavior tests to the "passing for stage2" section 2021-09-29 11:33:22 -07:00
Andrew Kelley
b02932f96e Sema: generic function instantiations gain addrspace of owner Decl 2021-09-29 11:09:37 -07:00
Andrew Kelley
4e85bf1185 stage2: put use_llvm and use_stage1 into the Module cache hash
This prevents a compiler_rt built with stage2 (which is intentionally
different than when built with stage1) from being used for stage1 and
vice versa.

Fixes the regression from the previous commit.
2021-09-29 10:46:32 -07:00
Andrew Kelley
99961f22dc stage2: enable building compiler_rt when using LLVM backend
* AstGen: fix emitting `store_to_inferred_ptr` when it should be emitting
   `store` for a variable that has an explicit alignment.
 * Compilation: fix a couple memory leaks
 * Sema: implement support for locals that have specified alignment.
 * Sema: implement `@intCast` when it needs to emit an AIR instruction.
 * Sema: implement `@alignOf`
 * Implement debug printing for extended alloc ZIR instructions.
2021-09-29 00:13:21 -07:00
Andrew Kelley
33e77f127d stage2: implement @clz and @ctz
Also improve the LLVM backend to support lowering bigints to LLVM
values.

Moves over a bunch of math.zig test cases to the "passing for stage2"
section.
2021-09-28 22:38:51 -07:00
Andrew Kelley
7efc2a0626 AstGen: improved logic for nodeMayNeedMemoryLocation
* `@as` and `@bitCast` no longer unconditionally return `true` from
   this function; they forward the question to their sub-expression.
 * fix `@splat` incorrectly being marked as needing a memory location
   (this function returns a SIMD vector; it definitely does not want a
   memory location).

Makes AstGen generate slightly nicer ZIR, which in turn generates
slightly nicer AIR, generating slightly nicer machine code in debug
builds.

It also means I can procrastinate implementing the bitcast_result_ptr
ZIR instruction semantic analysis :^)
2021-09-28 20:33:50 -07:00
Andrew Kelley
51a40f9a66 saturating arithmetic supports integers only 2021-09-28 20:27:28 -07:00