0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
zig/lib
Frank Denis c49e4d534f
Improve and remove duplicate doNotOptimizeAway() implementations (#13790)
* Improve and remove duplicate doNotOptimizeAway() implementations

We currently have two doNotOptimizeAway() implementations, one in
std.math and the other one in std.mem.

Maybe we should deprecate one. In the meantime, the std.math one
now just calls the std.mem one.

In a comptime environment, just ignore the value. Previously,
std.mem.doNotOptimizeAway() did not work at comptime.

If the value fits in a CPU register, just tell the compiler we
need that value to be computed, without clobbering anything else.

Only clobber all possibly escaped memory on pointers or large arrays.

Add tests by the way since we didn't had any (we had, but only
indirect ones).
History 2022-12-09 18:22:50 +01:00
..
compiler_rt compiler-rt: do not export complex arithmetic on ofmt=c 2022-12-07 14:54:29 +02:00
docs Merge pull request #13300 from jcalabro/master 2022-10-30 17:20:57 +01:00
include C backend: improve ergonomics of zig.h a little bit 2022-11-13 16:50:16 -07:00
init-exe init-exe template: add flushing to the buffered writer 2022-08-04 21:12:42 +02:00
init-lib flatten lib/std/special and improve "pkg inside another" logic 2022-05-06 22:41:00 -07:00
libc Update wasi-libc to 8b7148f69ae241a2749b3defe4606da8143b72e0 (#13793) 2022-12-06 22:48:35 +00:00
libcxx update libcxx to LLVM 15.0.3 2022-10-18 10:18:09 -07:00
libcxxabi update libcxxabi to LLVM 15 2022-08-04 18:02:01 -07:00
libunwind update libunwind to LLVM 15 2022-08-04 18:09:10 -07:00
std Improve and remove duplicate doNotOptimizeAway() implementations (#13790) 2022-12-09 18:22:50 +01:00
tsan update libcxx, libcxxabi, libunwind, and tsan to llvm 13 rc1 2021-08-16 23:32:13 -07:00
build_runner.zig remove -fstage1 option 2022-12-06 12:15:04 -07:00
c.zig all: rename i386 to x86 2022-11-04 00:09:27 +03:30
compiler_rt.zig compiler_rt: remove stack probe functions from c builds 2022-12-06 12:27:28 -07:00
ssp.zig all: rename i386 to x86 2022-11-04 00:09:27 +03:30
test_runner.zig stage2 AArch64: misc fixes, enable printing in test runner 2022-11-01 20:44:18 +01:00
zig.h zig.h: fix f16 has builtin check 2022-12-06 12:27:28 -07:00