Commit Graph

100 Commits

Author SHA1 Message Date
Barinzaya
9284ebb5e8 Add missing cast to global/static var alignments. 2025-04-24 14:35:00 -04:00
Barinzaya
b41a776027 Correctly align global and static variables.
This can be important if matrices or SIMD vectors are being used in
global or static variables, as otherwise it may result in crashes due to
aligned instructions accessing misaligned variables.
2025-04-24 14:21:21 -04:00
gingerBill
fe040d1bbd Propagate @(link_section=<string>) to nested declarations 2025-04-08 11:36:53 +01:00
gingerBill
168a41ba2c Fix #4803 2025-03-07 10:33:41 +00:00
Barinzaya
ef83f2115a Implemented #reverse for for in bit_set. 2025-03-02 16:24:18 -05:00
Barinzaya
36d5e09419 Re-implemented for on bit_sets to use CTZ.
This solution is both faster at run-time and a simpler implementation
than the original solution, which required separate cases for enums and
ranges.
2025-02-28 06:51:14 -05:00
gingerBill
46a8991d0f Canonicalize generated procedures 2025-02-24 14:19:02 +00:00
gingerBill
99d91ccd31 Work on making name mangling deterministic 2025-02-17 11:32:49 +00:00
gingerBill
328d893cb5 #unroll(N) for 2025-01-10 12:22:18 +00:00
gingerBill
7b334d2bd9 Add #branch_location 2025-01-01 17:26:15 +00:00
Laytan Laats
fa39d87f88 properly keep track of current scope for debugging
Fixes #4519
2024-11-27 20:55:48 +01:00
bobsayshilol
e67692b066 Avoid member access through nullptr in debug
If |result_count| is 0 then |results| will be a nullptr and hence the
access |results->Tuple| is undefined behaviour. There's already an
early return in the 0 branch so move that to be the first thing so that
we can guarantee that it's not a nullptr.

Note that technically we take the address of the result so it's not
actually dereferencing it, however UBSan doesn't care about that.
2024-10-27 22:02:34 +00:00
Laytan Laats
da1e09c95d check packed load and set alignment on all loads, not just lb_emit_load 2024-10-25 15:23:15 +02:00
Laytan
722b638e2c "fix" #4169, looks like llvm 14 bug 2024-08-31 19:40:05 +02:00
gingerBill
476030dd28 Fix #4156 2024-08-31 13:51:35 +01:00
gingerBill
2a0785037b Fix switch val in ptr 2024-08-19 12:19:45 +01:00
gingerBill
95c3b8a8de Move assert to else branch 2024-08-18 22:45:26 +01:00
Laytan Laats
99aa0d3a35 fix type switching over internal pointer union
Fixes #3947
2024-08-12 00:02:05 +02:00
gingerBill
5cefab8229 Fix case: in type switch issue 2024-07-15 13:22:50 +01:00
gingerBill
d78ff0be52 Fix lb_store_type_case_implicit 2024-07-04 13:20:36 +01:00
gingerBill
bea47db495 Allow @(rodata) on @(static) variables 2024-06-06 15:20:47 +01:00
gingerBill
e05315831f Fix #3586 2024-05-14 00:18:38 +01:00
gingerBill
393e4a9db6 Generalize Odin call-based "iterators" to work with more than 2-values: for x, y, z, w in iterate(&it)
It has an artificial limitation of 100 values because if you need for than that, you're doing something wrong.
2024-04-27 09:53:02 +01:00
gingerBill
b862691d75 Support for in with bit_set 2024-04-01 13:08:07 +01:00
gingerBill
effc71ca43 Fix case: bug with by-ref unions 2024-03-18 12:20:53 +00:00
gingerBill
5107bdc06b Make lb_type_info use a procedure to load the global value 2024-02-27 15:45:53 +00:00
Laytan Laats
1fc256dd90 Fix divergent proc call in defer
Fixes #3216
Fixes #2985
2024-02-21 19:43:34 +01:00
gingerBill
c12eb3ec93 Improve returning a struct directly for certain ABIs; reuse the temp callee return struct memory when needed 2023-11-24 11:44:20 +00:00
gingerBill
65206fe33e Go through loads of TODOs 2023-08-01 11:39:04 +01:00
gingerBill
62031c24a2 Add extra mutex guards around module value access 2023-07-07 23:35:16 +01:00
gingerBill
ea00619c3b for &e, i in array and for k, &v in map (alternative to passing the iterable by pointer) 2023-06-26 15:20:40 +01:00
gingerBill
4c17e2e97e Merge pull request #2552 from jcmoyer/fix-2466
Use compound literal storage for ValueDecl lvals
2023-06-08 12:34:40 +01:00
gingerBill
2bc5e0ebd7 Fix non-constant compound literals of slices 2023-06-07 00:10:39 +01:00
gingerBill
4a75a1e839 Merge branch 'master' into separate-int-word-sizes 2023-06-06 22:42:04 +01:00
gingerBill
837ba6c33b Minor change to #reverse for logic; add comments explaining it 2023-05-30 00:21:40 +01:00
gingerBill
e0530df98a Support #reverse for strings 2023-05-29 23:45:21 +01:00
gingerBill
f07453d0ae Support #reverse on #soa arrays 2023-05-29 23:24:03 +01:00
gingerBill
97490c6445 Basic support for #reverse for in on normal arrays 2023-05-29 23:17:06 +01:00
J.C. Moyer
4d5a442d1f Use compound literal storage for ValueDecl lvals
Prior to this commit, if a variable was initialized using a compound
literal, its associated storage would not be set. This commit makes the
variable always take on the storage of the compound literal.

Fixes #2466
2023-05-21 16:43:34 -04:00
gingerBill
685f7d0fea Rename word_size to ptr_size internally to make it clearer 2023-04-20 12:18:13 +01:00
gingerBill
bfb231fb8a Simplify copy elision on variable declarations 2023-03-16 17:24:29 +00:00
gingerBill
93f7d3bfb9 Allow case nil within a type switch statement (experimental idea) 2023-03-12 16:33:21 +00:00
gingerBill
c39bd7e089 Fix range loop & vals debug info 2023-03-09 15:57:29 +00:00
gingerBill
3470d986f0 Fix debug symbols for range loops 2023-03-09 15:48:02 +00:00
gingerBill
7c0257fcda Fix value elision on declaration 2023-03-09 15:39:41 +00:00
gingerBill
7d4e9497eb Reduce stack usage of some type switch cases 2023-02-17 16:51:57 +00:00
gingerBill
99460c9e32 Minimize stack wastage with compound literals defining variables 2023-02-17 14:26:22 +00:00
gingerBill
ccf4b48865 Add extra checks for multiple assignments when emitting stores 2023-01-27 11:47:00 +00:00
gingerBill
8f4ffbe1da Fix #2299 by handling very large value cases correctly 2023-01-20 11:23:15 +00:00
gingerBill
213a0499a1 Begin multithreading the llvm backend when -use-separate-modules is enabled 2023-01-05 12:29:16 +00:00