Commit Graph

14761 Commits

Author SHA1 Message Date
Andrew Kelley 5bdfe22092 CLI: actually fix translate-c creating root progress node twice
7281cc1d839da6e84bb76fadb2c1eafc22a82df7 did not solve the problem
because even when Node.index is none, it still counts as initializing
the global Progress object. Just use a normal zig optional, and all is
good.
2024-05-27 20:56:49 -07:00
Andrew Kelley b7889f262a zig build: respect --color argument
`--color off` now disables the CLI progress bar both in the parent
process and the build runner process.
2024-05-27 20:56:49 -07:00
Andrew Kelley 44389253c2 fix zig translate-c creating root progress node twice 2024-05-27 20:56:49 -07:00
Andrew Kelley c9587d3e40 CLI: add missing call to root progress node end()
cleans up unwanted "LLVM Emit Object" being left on the screen
2024-05-27 20:56:49 -07:00
Andrew Kelley 849693f07c zig build: give a root progress name
Now it's more clear when zig is building the build script vs building
the actual project.
2024-05-27 20:56:48 -07:00
Andrew Kelley d3b03ed64b frontend: fix use of undefined progress node
This was causing a crash when running `zig test`.
2024-05-27 20:56:48 -07:00
Andrew Kelley e820173467 Compilation: fix sub-compilations given wrong progress node 2024-05-27 20:56:48 -07:00
Jacob Young d77f5e7aaa Progress: fix compile errors on windows
Works for `zig build-exe`, IPC still not implemented yet.
2024-05-27 20:56:48 -07:00
mlugg d403d8cb7a Module: fix and improve progress reporting
* correctly report time spent analyzing function bodies
* print fully qualified decl names
* also have a progress node for codegen

The downside of these changes is that it's a bit flickerey, but the
upside is that it's accurate; you can see what the compiler's doing!
2024-05-27 20:56:48 -07:00
Andrew Kelley 2759173452 zig build: lock stderr while executing the build runner 2024-05-27 20:56:48 -07:00
Andrew Kelley 352dc2c06a compiler: show decl name in progress node 2024-05-27 20:56:48 -07:00
Andrew Kelley 2233d95b0f main: avoid creating multiple std.Progress instances 2024-05-27 20:56:48 -07:00
Andrew Kelley b27fdf92fb Compilation: only create progress nodes for work actually being done 2024-05-27 20:56:48 -07:00
Andrew Kelley f97c2f28fd update the codebase for the new std.Progress API 2024-05-27 20:56:48 -07:00
Andrew Kelley 591bbafee3 Merge pull request #20049 from ziglang/std.process.Child
std: restructure child process namespace
2024-05-26 16:20:07 -04:00
Jacob Young 6e5e7e7b19 Compilation: fix regressed assembly diagnostics
Regressed by #17947
2024-05-26 12:38:31 -04:00
Andrew Kelley f47824f24d std: restructure child process namespace 2024-05-26 09:31:55 -07:00
Jakub Konka 42c058575e link/macho: fix 32bit build 2024-05-24 23:06:27 +02:00
Jakub Konka ed7073c630 link/macho: fix perf bug in DWARF parsing 2024-05-24 15:34:48 +02:00
Jakub Konka d31eb744ce link/macho: fix 32bit build 2024-05-23 12:04:17 +02:00
Jakub Konka f3a503eca2 link/macho: ensure we set alignment of literals to max alignment 2024-05-23 12:04:17 +02:00
Jakub Konka 71bbc5efc9 link/macho: print error message when hitting unexpected remainder error 2024-05-23 12:04:17 +02:00
Jakub Konka 8fc0c7dce1 link/macho: apply fixes to deduping logic
* test non-ObjC literal deduping logic
2024-05-23 12:04:17 +02:00
Jakub Konka 434e69482e link/macho: dedup literals in objects and internal object file 2024-05-23 12:04:17 +02:00
Andrew Kelley 9be8a9000f Revert "implement @expect builtin (#19658)"
This reverts commit a7de02e052.

This did not implement the accepted proposal, and I did not sign off
on the changes. I would like a chance to review this, please.
2024-05-22 09:57:43 -07:00
David Rubin a7de02e052 implement @expect builtin (#19658)
* implement `@expect`

* add docs

* add a second arg for expected bool

* fix typo

* move `expect` to use BinOp

* update to newer langref format
2024-05-22 10:51:16 -05:00
Jacob Young ed75f62568 Compilation: better cleanup of temporary files
The diag file did not get deleted on the success path and the dep file
did not get deleted on the failure path.
2024-05-22 10:42:01 -04:00
Veikka Tuominen 0fb2015fd3 llvm: fix @wasmMemory{Size,Grow} for wasm64
Closes #19942
2024-05-22 09:48:52 -04:00
Veikka Tuominen 5fe9f88b13 Merge pull request #20023 from Vexu/fixes
Minor LLVM backend fixes
2024-05-22 11:54:38 +03:00
Veikka Tuominen eb0f871cb9 Merge pull request #19961 from wooster0/errorstuff
Sema: improvements to error messages related to the handling of (error) values
2024-05-21 22:37:00 +03:00
wooster0 ac55685a94 Sema: add missing declared here note 2024-05-22 02:16:56 +09:00
Veikka Tuominen f776e70c39 llvm: fix lowering of packed structs with optional pointers
Closes #20022
2024-05-21 19:52:25 +03:00
Veikka Tuominen 167854c19c llvm: lower ptr to int constants with correct address spaces
Closes #19915
2024-05-21 19:52:00 +03:00
Veikka Tuominen 8aae0d87b5 Target: add OpenHarmonyOS ABI
Closes #20009
2024-05-20 09:25:52 -04:00
Wooster f14cf13ff8 Sema: suggest using try/catch/if on method call on error union 2024-05-14 01:13:49 +09:00
r00ster91 9ae43567a3 Sema: improve error set/union discard/ignore errors
Previously the error had a note suggesting to use `try`, `catch`, or
`if`, even for error sets where none of those work.
Instead, in case of an error set the way you can handle the error
depends very much on the specific case. For example you might be in a
`catch` where you are discarding or ignoring the error set capture
value, in which case one way to handle the error might be to `return`
the error.
So, in that case, we do not attach that error note.

Additionally, this makes the error tell you what kind of an error it is:
is it an error set or an error union? This distinction is very relevant
in how to handle the error.
2024-05-14 01:13:49 +09:00
r00ster91 8579904ddd Sema: add error note for !?Type types when optional type is expected 2024-05-14 01:13:49 +09:00
r00ster91 31689d0dd9 Sema: remove periods from the few error messages that have them
For consistency.
2024-05-14 01:13:49 +09:00
r00ster91 60830e36e3 Sema error: talk about discarding instead of suppressing
Maybe I'm just being pedantic here (most likely) but I don't like how we're
just telling the user here how to "suppress this error" by "assigning the value to '_'".
I think it's better if we use the word "discard" here which I think is
the official terminology and also tells the user what it actually means
to "assign the value to '_'".

Also, using the value would also be a way to "suppress the error".
It is just one of the two options: discard or use.
2024-05-14 01:13:48 +09:00
Christofer Nolander 8f6b1f2c38 zig fetch: resolve branch/tag names to commit SHA (#19941)
* Revert "Revert "Merge pull request #19349 from nolanderc/save-commit""

This reverts commit 6ca4ed5948.

* update to new URI changes, rework `--save` type

* initialize `latest_commit` to null everywhere
2024-05-11 14:19:35 -07:00
David Rubin 1dfdc21c31 riscv: intcast got_addr
the recent merge strings PR made `got_addr` `i64` and now requires an `@intCast`.
2024-05-11 02:17:24 -07:00
David Rubin ffb63a05a3 riscv: finally fix bug + airAggregateInit
i just hadn't realized that I placed the `riscv_start` branch in the non-simplified
starts
2024-05-11 02:17:24 -07:00
David Rubin 2fd83d8c0a riscv: by-value structs + @min 2024-05-11 02:17:24 -07:00
David Rubin a30af172e8 riscv: math progress 2024-05-11 02:17:24 -07:00
David Rubin a615fbc1f8 riscv: mutable globals 2024-05-11 02:17:24 -07:00
David Rubin d9e0cafe64 riscv: add stage2_riscv to test matrix and bypass failing tests 2024-05-11 02:17:24 -07:00
David Rubin e622485df8 riscv: actually working test runner 2024-05-11 02:17:11 -07:00
David Rubin d19b77d63f riscv: back to hello world panics 2024-05-11 02:17:11 -07:00
David Rubin cc204e2365 riscv: spill args immediately to prevent clobbers 2024-05-11 02:17:11 -07:00
David Rubin 6740c1f084 riscv: big rewrite to use latest liveness
this one is even harder to document then the last large overhaul.

TLDR;
- split apart Emit.zig into an Emit.zig and a Lower.zig
- created seperate files for the encoding, and now adding a new instruction
is as simple as just adding it to a couple of switch statements and providing the encoding.
- relocs are handled in a more sane maner, and we have a clear defining boundary between
lea_symbol and load_symbol now.
- a lot of different abstractions for things like the stack, memory, registers, and others.
- we're using x86_64's FrameIndex now, which simplifies a lot of the tougher design process.
- a lot more that I don't have the energy to document. at this point, just read the commit itself :p
2024-05-11 02:17:11 -07:00