Jakub Konka
12e34e7037
dwarf: pull out debug line program internals into DeclState helpers
2022-12-05 22:35:07 +01:00
Jason Phan
97827d6d38
std.fmt.formatInt: Use an optimized path for decimals
...
It enables faster decimal-to-string conversions for values in the range
[0, 100).
2022-12-05 22:58:45 +02:00
Pyrolistical
9e74e4c1f8
std: added pure functions to StaticBitSet
...
The following functions were added to both IntegerBitSet and ArrayBitSet:
fn eql(self: Self, other: Self) bool
fn subsetOf(self: Self, other: Self) bool
fn supersetOf(self: Self, other: Self) bool
fn complement(self: Self) Self
fn unionWith(self: Self, other: Self) Self
fn intersectWith(self: Self, other: Self) Self
fn xorWith(self: Self, other: Self) Self
fn differenceWith(self: Self, other: Self) Self
2022-12-05 21:06:10 +02:00
nc
a7cb5027ae
std.atomic.Queue: fix unget implementation and add doc
2022-12-05 17:01:56 +02:00
Jakub Konka
8796da0283
dwarf: reuse getDbgInfoAtom helper in all of Dwarf.zig
...
We need to access it outside of `DeclState` too so why not reuse
the helper anyway.
2022-12-05 14:19:22 +01:00
Jakub Konka
3575048c0a
Merge pull request #13763 from ziglang/macho-dsym-incr
...
macho+dsym: refactor and reorganize file layout to support incremental DWARF updates
2022-12-05 13:48:12 +01:00
Martin Wickham
b1c4227763
Allow const ArrayLists to be cloned
2022-12-05 04:36:10 -05:00
Frank Denis
4be1bb4aac
std.crypto benchmark: don't use a relative path to import std ( #13772 )
2022-12-05 04:44:14 +00:00
Jacob Young
4ee79aa33c
CBE: revert broken change that got missed
2022-12-04 22:37:48 -05:00
Andrew Kelley
70ad5bc363
Merge pull request #13768 from ziglang/cbe-reuse-locals-2
...
C backend: reuse locals but respect loops to pass behavior tests
2022-12-04 21:59:01 -05:00
Jacob Young
7d3cc3bc8d
CBE: defer invariant local reuse in loops
...
When a local defined outside a loop dies inside the loop, it can still
be needed on subsequent loop iterations, so reuse of the local must be
deferred until after the loop ends. This causes behavior tests to pass.
2022-12-04 15:57:40 -07:00
Andrew Kelley
518392d6fe
disable CBE behavior tests that are not passing in release modes
2022-12-04 15:57:40 -07:00
Andrew Kelley
cc8bcae8c0
CBE: fix liveness issue with wrapping optionals
2022-12-04 15:57:40 -07:00
Andrew Kelley
4a6deaff5f
CBE: remove stray comment
2022-12-04 15:57:40 -07:00
Andrew Kelley
701cebeb30
CBE: fix union init wrong field name
2022-12-04 15:57:40 -07:00
Andrew Kelley
aa98517b3e
CBE: aggregate_init: resolve all operands before processing Liveness
2022-12-04 15:57:40 -07:00
Andrew Kelley
4aae0b09cf
CBE and LLVM: handle unused try instructions
...
In both backends they did not observe the Liveness information for try
instructions. Now they do. For the C backend this is necessary for
correctness; for the LLVM backend, it improves code generation.
2022-12-04 15:57:40 -07:00
Andrew Kelley
f2e59e41c1
CBE: fix various regressions caught by behavior tests
2022-12-04 15:57:40 -07:00
Andrew Kelley
6c0a1417c6
CBE: fix static allocs being double allocated
2022-12-04 15:57:40 -07:00
Andrew Kelley
da73410e7f
CBE: avoid curly inits because they don't work in assignments
2022-12-04 15:57:40 -07:00
Andrew Kelley
db1819e8ed
CBE: fix use-after-free of Type keys in free_locals map
2022-12-04 15:57:40 -07:00
Andrew Kelley
7bd63a602a
CBE: fix assignment expr and switch free tracking
2022-12-04 15:57:40 -07:00
Andrew Kelley
8bfbfa589c
CBE: fix clone of freed locals not being deep clone
2022-12-04 15:57:40 -07:00
Andrew Kelley
73a76b45c5
CBE: take advantage of switch_br and cond_br liveness
2022-12-04 15:57:40 -07:00
Andrew Kelley
8d8b2c834d
CBE: exploit Liveness analysis to reuse locals
2022-12-04 15:57:40 -07:00
Andrew Kelley
3a9375cae9
wasm codegen: fix some missing Liveness reaps
...
I did not do a full audit, but I did notice a few issues which are
resolved in this commit. Probably it would be worth adding debug
infrastructure to assert that the number of reaps equals the number of
calls to resolveInst() per air lowering function.
2022-12-04 15:57:40 -07:00
Andrew Kelley
954019983d
std: add move() functions to hash maps
2022-12-04 15:57:40 -07:00
Andrew Kelley
2a0efbee56
Revert "cbe: reduce amount of temporary locals"
...
This reverts commit 15cc83e27ae8a1740d9b7e2ec14044903979a832.
2022-12-04 15:57:40 -07:00
Andrew Kelley
46f4a97d05
Revert "cbe: write more instructions inline"
...
This reverts commit f8b779c114a5fcb82f08168912f2300d7027a2fd.
2022-12-04 15:57:39 -07:00
Andrew Kelley
bdb6fb5763
CI: use cache directories local to the CI run
...
Override the cache directories because they won't actually help other CI
runs which will be testing alternate versions of zig, and ultimately
would just fill up space on the hard drive for no reason.
In practice we did see one of the CI servers fill up too many files
inside ~/.cache/zig, which caused certain file system operations to
start returning ENOSPC, despite the hard drive having plenty of space
left.
2022-12-04 15:45:15 -07:00
Jakub Konka
899d7a771e
dsym: dummy repush to check the linux CI
2022-12-04 18:15:14 +01:00
Jakub Konka
a84b67468c
dsym: recalculate DWARF segment size when finalizing
2022-12-04 16:58:45 +01:00
Jakub Konka
280dad0283
dsym+dwarf: remove copyRangeAllOverlappingAlloc
2022-12-04 16:58:45 +01:00
Jakub Konka
aa8b26cf25
dsym: refactor API - do not store ptr to MachO
2022-12-04 16:58:45 +01:00
Jakub Konka
d67de87baa
dsym: add helper for accessing dwarf seg pointer
2022-12-04 16:58:45 +01:00
Jakub Konka
73d76b26a2
dsym: rename updateLinkeditSegment to finalizeDwarfSegment
...
This is the checkpoint where we finalize the VM of the primary binary.
2022-12-04 16:58:45 +01:00
Jakub Konka
278426b851
dsym: make sure DWARF segment comes before LINKEDIT
...
This will greatly simplify incremental updates to DWARF sections
within the bundle.
2022-12-04 16:58:45 +01:00
Veikka Tuominen
e361740669
Merge pull request #13142 from mllken/gzip-safety
...
gzip: add missing header fields and bounds for header parsing
2022-12-04 14:32:25 +02:00
Gregory Oakes
8d17e90fcd
std: add a special case for empty structs in meta.FieldEnum.
...
Empty structs would previously result in a compilation error.
2022-12-04 14:22:16 +02:00
r00ster91
f094c4bce5
Sema: detect duplicate enum tag values
2022-12-04 14:12:24 +02:00
Andrew Kelley
19dd6de180
Merge pull request #13756 from jacobly0/cbe-behavior
...
cbe: pass more behavior tests
2022-12-04 01:52:04 -05:00
Jacob Young
e3b8658e65
cbe: add forward declarations for optionals and error unions
...
Arrays will have to wait for type rewrite.
2022-12-03 21:58:18 -05:00
Jacob Young
6d1292552e
cbe: implement function alignment
2022-12-03 08:40:08 -05:00
Jacob Young
ec3116f573
cbe: fix zero-bit struct field pointer
2022-12-03 08:40:08 -05:00
Jacob Young
7fb6eb3d14
cbe: implement multiple exports of a symbols
2022-12-03 08:21:03 -05:00
Jacob Young
81c271cc62
cbe: don't emit extern decls that are already exported
2022-12-03 08:21:03 -05:00
Jacob Young
2cfc08ba0d
cbe: fix named constraints without modifiers
2022-12-03 08:21:03 -05:00
Andrew Kelley
f68bfe2eb7
CBE: no braces when lowering block instruction
...
This change alone solves the bracket-depth issue when compiling zig1.c
with Clang.
2022-12-03 05:22:50 -05:00
Andrew Kelley
610d604f5b
Merge pull request #13748 from jacobly0/c-unaligned
...
cbe: use memcpy for underaligned loads and stores
2022-12-03 02:18:07 -05:00
Andrew Kelley
53dcf78a25
print_air: print Liveness info for switch_br
2022-12-02 23:46:42 -07:00