aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/llvm.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-08-05 16:37:21 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-08-05 16:37:21 -0700
commite9e3a2994696a3131125ebc4b1f0eec7ca5306d9 (patch)
treede6bf27daddd48b9ab15144312f558d3cd0c53c2 /src/codegen/llvm.zig
parentf58cbef1659742e57377d3f8c92a0b9b97af91ad (diff)
downloadzig-e9e3a2994696a3131125ebc4b1f0eec7ca5306d9.tar.gz
zig-e9e3a2994696a3131125ebc4b1f0eec7ca5306d9.zip
stage2: implement generic function memoization
Module has a new field `monomorphed_funcs` which stores the set of `*Module.Fn` objects which are generic function instantiations. The hash is based on hashes of comptime values of parameters known to be comptime based on an explicit comptime keyword or must-be-comptime type expressions that can be evaluated without performing monomorphization. This allows function calls to be semantically analyzed cheaply for generic functions which are already instantiated. The table is updated with a single `getOrPutAdapted` in the semantic analysis of `call` instructions, by pre-allocating the `Fn` object and passing it to the child `Sema`.
Diffstat (limited to 'src/codegen/llvm.zig')
0 files changed, 0 insertions, 0 deletions