14398 Commits

Author SHA1 Message Date
Andrew Kelley
d3ddb48075 AstGen: remove unused parameters 2021-06-21 17:03:04 -07:00
Andrew Kelley
06412e04f9 cleanups related to unused params 2021-06-21 17:03:04 -07:00
Andrew Kelley
d279a23c93 mips: fix syscall_pipe
Previously the fd parameter was ignored and so the result would not get
populated. Now it passes the fd pointer to the inline assembly so that
the results can be observed.
2021-06-21 17:03:04 -07:00
Andrew Kelley
af9a2c7c50 Sema: don't miscompile fns with inferred error sets 2021-06-21 17:03:04 -07:00
Andrew Kelley
fee5aad699 stage2: remove unused parameter from importPkg 2021-06-21 17:03:04 -07:00
Andrew Kelley
f203334878 stage2: wire up AstGen to the progress bar 2021-06-21 17:03:03 -07:00
Andrew Kelley
a51ff3a903 AstGen: remove unused scope parameter from rvalue 2021-06-21 17:03:03 -07:00
Andrew Kelley
b9b0e53197 AstGen: remove unused parameter 2021-06-21 17:03:03 -07:00
Andrew Kelley
7a595f2e6c remove unused parameters 2021-06-21 17:03:03 -07:00
Andrew Kelley
3d8aa97165 std.os.linux.bpf: fix incorrect usage of unexpectedErrno 2021-06-21 17:03:03 -07:00
Andrew Kelley
59d6b7bbb9 std.os.linux: fix splitValueBE64 2021-06-21 17:03:03 -07:00
Andrew Kelley
f21a3ed540 std.TrailerFlags: remove superfluous parameter 2021-06-21 17:03:03 -07:00
Andrew Kelley
98b10d94bf std.crypto.p256: fix neg function compile error
There was a typo here and the neg function referenced a non-existent
variable.
2021-06-21 17:03:03 -07:00
Andrew Kelley
2551598013 std: ArrayHashMap remove unused parameter 2021-06-21 17:03:03 -07:00
Jacob G-W
d14272ab68 std: fix code unblocked by previous commit 2021-06-21 17:03:03 -07:00
Andrew Kelley
a04a98ff3e AstGen: while loop continue expr captures in scope
Before this, the continue expression of a while loop did not have the
capture variable in it, making it incorrectly emit a compile error for
not using the capture, even if it was referenced.
2021-06-21 17:03:03 -07:00
Andrew Kelley
4f900e68d3 AstGen: fix crash in debug printing ZIR field types
The printing code did not properly set the parent Decl node field, so
the source location calculations were wrong.

closes #8825
2021-06-21 17:03:03 -07:00
Andrew Kelley
f4a9e0530a AstGen: convert a TODO comment to an issue
See #363
2021-06-21 17:03:03 -07:00
Jacob G-W
9fffffb07b fix code broken from previous commit 2021-06-21 17:03:03 -07:00
Jacob G-W
b83b3883ba stage2 AstGen: fix lots of bugs and catch more errors
Gotta catch 'em all!

also simplify identifier( logic
2021-06-21 17:03:03 -07:00
Jacob G-W
641ecc260f std, src, doc, test: remove unused variables 2021-06-21 17:03:03 -07:00
Jacob G-W
d34a1ccb0e stage2: fix TODO in @export to look for runtime-vars
Also rename LocalPtr.is_comptime to LocalPtr.maybe_comptime as
it is a better name, as it could be runtime, but is not
always runtime.
2021-06-21 17:03:03 -07:00
Jacob G-W
18c1007a34 stage2 tests: remove unused vars 2021-06-21 17:03:03 -07:00
Jacob G-W
f8b8f50b63 stage2 astgen: make asm outputs count as referencing vars
This is temporary and putting this as a seperate commit
so that it can easily be reverted as andrewrk suggested.
2021-06-21 17:03:03 -07:00
Jacob G-W
796b420092 std.enums: make code correct zig and not stage1 2021-06-21 17:03:02 -07:00
Jacob G-W
7d4c8d7054 stage2: make loop vars be comptime if they are inline
thanks @Vexu
2021-06-21 17:03:02 -07:00
Jacob G-W
2092481265 stage2 astgen: fix bug in struct init where type not refed 2021-06-21 17:03:02 -07:00
Jacob G-W
75f7a8913e stage2 astgen: find unused vars 2021-06-21 17:03:02 -07:00
Veikka Tuominen
8a6de78e07
Merge pull request #8717 from mchudleigh/dwarf-on-windows
Dwarf on windows
2021-06-21 18:48:59 +03:00
g-w1
e13a182990
stage2 Sema: implement @intToPtr (#9144)
Co-authored-by: Veikka Tuominen <git@vexu.eu>
2021-06-21 18:47:34 +03:00
Jacob G-W
a95fdb0635 stage2: simplify codegen for errorToInt and intToError
We can just use bitcast instead of error_to_int, int_to_error since
errorToInt and intToError do not actually do anything, just change types.
This allows us to remove 2 air ops that were the exact same as bitcast
2021-06-21 18:45:28 +03:00
Andrew Kelley
fc1feebdc0
Merge pull request #9168 from LemonBoy/fix-pie
std: Fix PIE startup sequence
2021-06-20 20:01:39 -04:00
Dmitry Matveyev
00982f75e9
stage2: Remove special double ampersand parsing case (#9114)
* Remove parser error on double ampersand

* Add failing test for double ampersand case

* Add error when encountering double ampersand in AstGen

"Bit and" operator should not make sense when one of its operands
is an address.

* Check that 2 ampersands are adjacent to each other in source string

* Remove cases of unused variables in tests
2021-06-20 21:04:14 +03:00
LemonBoy
e4225ca5f7 std: Make copy_file_range checks run at compile-time
* Avoid emitting the copy_file_range symbol at all to prevent link-time
  errors.
* Fix a bug in the check logic, the has_copy_file_range_syscall was
  set to the wrong value in case of ENOSYS
* If link_libc is true don't fall-back to the raw syscall approach,
  there's no policy about what to do in this case but let's follow what
  the other impls do.

Fixes #9146
2021-06-20 20:58:10 +03:00
Veikka Tuominen
6de45c826c
Merge pull request #8636 from jmc-88/issue-3779
Change builtins to return a string literal
2021-06-20 20:27:34 +03:00
Jacob G-W
1071ca6129 fmt: make --ast-check work with --stdin 2021-06-20 19:56:14 +03:00
pithlessly
8a7730672f stage2 sema: change impl of @setCold to use zirSetCold (typo?) 2021-06-20 19:50:06 +03:00
mason1920
37a1028b6e Bring your own MAX_PATH_BYTES
Previous to #7082, users could overwrite PATH_MAX in the root file to support std.os.toPosixPath, permitting the "bring your own operating system" layer to implement the POSIX API for opening files. Unfortunately that is no longer the case.

This commit intends to fix what is arguably a regression from 0.7 in a way that doesn't break any code targeting 0.8.0, making it suitable to be included in a 0.8 patch release.
However in a future release that permits breaking changes, I am of the opinion that it would be beneficial to overwrite the value, even for "supported" operating systems. Same for all the other POSIX/BYOOS functions and values. However this is beyond the scope of this commit. Further discussion of this will be made into an issue in due time.
2021-06-20 19:49:48 +03:00
LemonBoy
aa6422d792 tests: Update line numbers 2021-06-19 20:07:07 +02:00
LemonBoy
fd6d5f1609 std: Fix PIE startup sequence
* Don't skip the TLS initialization (Fixes #9083)
* Add a test case where a PIE program is built and run
* Refactor the common initialization code in the Linux startup
  sequence.
2021-06-19 18:02:51 +02:00
Matt Chudleigh
24b1a0027f Fix crash when compiling with cygwin/msys on windows 2021-06-18 16:19:20 -07:00
Matt Chudleigh
a6c2e44ae7 Add support for reading DWARF debug information from COFF files 2021-06-18 16:19:20 -07:00
Matt Chudleigh
2dcdaa7668 Support long section names in COFF files 2021-06-18 16:19:20 -07:00
Matt Chudleigh
fac0c6f25d Convert remaining addresses to u64 from usize in dwarf.zig 2021-06-18 16:19:20 -07:00
Michael Dusan
e006281d79 macho: LC_RPATH: reserve byte for null-terminator 2021-06-18 15:22:10 +02:00
hadroncfy
1f29b75f08
HashMap.getOrPutAssumeCapacityAdapted should set key to undefined (#9138)
* std.hash_map.HashMap: getOrPutAssumeCapacityAdapted should set key to undefined

* add test for std.hash_map.HashMap.getOrPutAdapted
2021-06-18 08:52:30 +03:00
Andrew Kelley
6ce8440987 AstGen: properly generate errdefer expressions when returning
`return` statements use a new function `nodeMayEvalToError` which does
some basic checks on the AST node to return never, always, or maybe.

Depending on this result, AstGen skips the errdefers, always includes
the errdefers, or emits a conditional branch to check whether the return
value is an error that Sema will have to evaluate.

Closes #8821
Unblocks #9047
2021-06-17 22:44:17 -07:00
LemonBoy
ccb6e1627e stage1: Store the specified code model in the LLVM module
This is needed for LTO builds to pick up the correct module.

Closes #9132
2021-06-18 08:29:23 +03:00
Andrew Kelley
b9e78593bb
Merge pull request #9117 from greenfork/unify-compiler-error-printing
stage2: Unify compiler error printing
2021-06-17 23:25:05 -04:00
Michael Dusan
9ff15e24f8 fix oob during riscv64 feature processing 2021-06-17 23:15:47 -04:00