| Age | Commit message (Collapse) | Author |
|
translate-c is moving towards a package provided by the build system
(#20630).
The repository https://github.com/ziglang/translate-c/ implements C
translation using Aro. This commit deletes the Aro implementation of C
translation from the Zig repository, leaving only the Clang
implementation.
The other dependency on Aro is for the preprocessor. This must move to
`std.zig.Preprocessor`, be untangled from Aro, and independently
maintained.
There must also be added a Preprocessor Build Step, which this commit
does not do.
Furthermore, the preprocessor must be exposed as a zig compiler JIT
command rather than always being compiled into the compiler. This will
reduce binary size and time spent waiting for zig to build.
|
|
lldb: add more stage2 pretty printers
|
|
Attach minimum Linux versions to provided libcs + incorporate ABI in `VersionRange.default()`
|
|
|
|
|
|
|
|
|
|
On x86 and x86_64 keeping the frame pointer usually reduces binary size, even for simple programs:
```
~$ cat x.zig
pub fn main() void {
@import("std").debug.print("hello", .{});
}
~$ zig build-exe x.zig -target x86_64-linux -OReleaseSmall -fno-omit-frame-pointer && wc -c x
5168 x
~$ zig build-exe x.zig -target x86_64-linux -OReleaseSmall -fomit-frame-pointer && wc -c x
5216 x
```
```
~$ cat x.zig
pub fn main() void {
@import("std").debug.print("hello", .{});
}
~$ zig build-exe x.zig -target x86-linux -OReleaseSmall -fno-omit-frame-pointer && wc -c x
3400 x
~$ zig build-exe x.zig -target x86-linux -OReleaseSmall -fomit-frame-pointer && wc -c x
3556 x
```
A bigger benchmark is the Zig compiler:
With no changes to anything on master branch:
```
$ zig build -Dno-lib -Dno-langref --zig-lib-dir lib -Doptimize=ReleaseSmall
$ wc -c zig-out/bin/zig
10698792 zig-out/bin/zig
```
Adding `.omit_frame_pointer = false` in `addCompilerStep` in `build.zig`:
```
$ zig build -Dno-lib -Dno-langref --zig-lib-dir lib -Doptimize=ReleaseSmall
$ wc -c zig-out/bin/zig
10155744 zig-out/bin/zig
```
|
|
|
|
This includes function aliases, but not function declarations.
Also, re-introduce a target check for function alignment which was
inadvertently removed in the prior commit.
|
|
Resolves: #22261
|
|
Just a small refactor.
|
|
Resolves: #21227
|
|
|
|
|
|
|
|
Dwarf: preserve deduped struct navs
|
|
`zig cc`: Remove broken CUDA C/C++ support.
|
|
compiler: introduce ZonGen and make `ast-check` run it for ZON inputs
|
|
|
|
|
|
Previously, if multiple navs owned the same type due to being the same
zir node and having the same captures, they would overwrite each other.
Now, the navs codegenned later emit a decl alias to the first one.
|
|
Currently, `zig ast-check` fails on ZON files, because it tries to
interpret the file as Zig source code. This commit introduces a new
verification pass, `std.zig.ZonGen`, which applies to an AST in ZON
mode.
Like `AstGen`, this pass also converts the AST into a more helpful
format. Rather than a sequence of instructions like `Zir`, the output
format of `ZonGen` is a new datastructure called `Zoir`. This type is
essentially a simpler form of AST, containing only the information
required for consumers of ZON. It is also far more compact than
`std.zig.Ast`, with the size generally being comparable to the size of
the well-formatted source file.
The emitted `Zoir` is currently not used aside from the `-t` option to
`ast-check` which causes it to be dumped to stdout. However, in future,
it can be used for comptime `@import` of ZON files, as well as for
simpler handling of files like `build.zig.zon`, and even by other parts
of the Zig Standard Library.
Resolves: #22078
|
|
And change corresponding signature in `DarwinPosixSpawn`.
|
|
The previous commit exposed some missing `const` qualifiers in a few
places. These mutable slices could have been used to store invalid
values into memory!
|
|
The error messages here aren't amazing yet, but this is an improvement
on status quo, because the current behavior allows false negative
compile errors, so effectively miscompiles.
Resolves: #15874
|
|
compiler: remove doc comments from Zir
|
|
It should not use the CRT ones, and it also needs a few flags of its own that I
forgot to add in #22156.
Follow-up fix for #10989.
|
|
Elf.Atom: fix truncated dyn abs relocs
|
|
This code was left over from the legacy Autodoc implementation. No
component of the compiler pipeline actually requires doc comments, so it
is a waste of time and space to store them in ZIR.
|
|
|
|
|
|
|
|
|
|
|
|
`Compilation`: Clean up `addCCArgs()` + some minor improvements
|
|
|
|
zig fetch: add support for SHA-256 Git repositories
|
|
|
|
The goal of this commit is to get rid of some "unused command line argument"
warnings that Clang would give for various file types previously. This cleanup
also has the side effect of making the order of flags more understandable,
especially as it pertains to include paths.
Since a lot of code was shuffled around in this commit, I recommend reviewing
the old and new versions of the function side-by-side rather than trying to make
sense of the diff.
|
|
Closes #21888
|
|
It was added to the standard library in #18733.
|
|
|
|
There are several test decls inside `/src` that are not currently being
tested and have bitrotted as a result. This commit revives those tests
and adds the `test-compiler-internals` set of tests which tests
everything reachable from `/src/main.zig`.
|
|
|
|
|
|
Clang seems to treat them as linker input without this.
|
|
|
|
Better unwind table support + unwind protection in `_start()` and `clone()`
|
|
The previous commit cast doubt upon the initial report about macOS
kernel behavior, identifying another reason that ENOENT could be
returned from file creation.
However, it is demonstrable that ENOENT can be returned for both cases:
1. create file race
2. handle refers to deleted directory
This commit re-introduces the workaround for the file creation race on
macOS however it does not unconditionally retry - it first tries again
with O_EXCL to disambiguate the error condition that has occurred.
|