zig/lib
mlugg 4976b58ab1
Prevent analysis of functions only referenced at comptime
The idea here is that there are two ways we can reference a function at runtime:

* Through a direct call, i.e. where the function is comptime-known
* Through a function pointer

This means we can easily perform a form of rudimentary escape analysis
on functions. If we ever see a `decl_ref` or `ref` of a function, we
have a function pointer, which could "leak" into runtime code, so we
emit the function; but for a plain `decl_val`, there's no need to.

This change means that `comptime { _ = f; }` no longer forces a function
to be emitted, which was used for some things (mainly tests). These use
sites have been replaced with `_ = &f;`, which still triggers analysis
of the function body, since you're taking a pointer to the function.

Resolves: #6256
Resolves: #15353
2023-05-29 23:06:08 +01:00
..
compiler_rt Prevent analysis of functions only referenced at comptime 2023-05-29 23:06:08 +01:00
docs autodoc: Links to private decls now lead to source files 2023-05-22 00:55:51 +02:00
include update C headers to LLVM 16.0.0 2023-03-18 16:01:09 -07:00
init-exe std.Build: use Step.* instead of *Step 2023-05-03 20:55:29 -07:00
init-lib init-exe/init-lib template: fix use of install() and run() 2023-04-10 18:35:14 -07:00
libc Update wasi-libc to 3189cd1ceec8771e8f27faab58ad05d4d6c369ef (#15817) 2023-05-23 22:12:53 +02:00
libcxx update libcxx to LLVM 16.0.1 2023-04-05 23:22:29 -07:00
libcxxabi update libcxxabi to llvm 16 2023-01-26 16:36:13 -07:00
libunwind update libunwind to llvm 16 2023-01-26 16:36:14 -07:00
std Prevent analysis of functions only referenced at comptime 2023-05-29 23:06:08 +01:00
tsan update libcxx, libcxxabi, libunwind, and tsan to llvm 13 rc1 2021-08-16 23:32:13 -07:00
build_runner.zig std: Move std.debug.{TTY.Config,detectTTYConfig} to std.io.tty 2023-05-24 10:15:02 +01:00
c.zig Add support for mips64/mips64el 2023-02-04 15:19:53 -05:00
compiler_rt.zig compiler_rt: declutter int.zig, add mulXi3 tests (#14623) 2023-02-24 13:27:02 -05:00
ssp.zig all: rename i386 to x86 2022-11-04 00:09:27 +03:30
test_runner.zig wasm: fix return ret_load with zero-size type 2023-05-19 20:19:00 +02:00
zig.h llvm/cbe: fix signed @mod/@divFloor computations 2023-05-10 15:11:52 -04:00