aboutsummaryrefslogtreecommitdiff
path: root/lib/std/fmt/parse_float.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-08-21 20:42:45 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-08-21 20:47:42 -0700
commitf378b0adce80aa6f85d9bf6bf97172426de2c719 (patch)
tree68a460620cb480de283afe9e64d4ea8b9a0fbd7d /lib/std/fmt/parse_float.zig
parent2b40815a220bbbd657bfa441e304090f11f1eb4c (diff)
downloadzig-f378b0adce80aa6f85d9bf6bf97172426de2c719.tar.gz
zig-f378b0adce80aa6f85d9bf6bf97172426de2c719.zip
stage2: comptime function with the same args is memoized
* Introduce `memoized_calls` to `Module` which stores all the comptime function calls that are cached. It is keyed on the `*Fn` and the comptime arguments, but it does not yet properly detect comptime function pointers and avoid memoizing in this case. So it will have false positives for when a comptime function call mutates data through a pointer parameter. * Sema: Add a new helper function: `resolveConstMaybeUndefVal` * Value: add `enumToInt` method and use it in `zirEnumToInt`. It is also used by the hashing function. * Value: fix representation of optionals to match error unions. Previously it would not handle nested optionals correctly. Now it matches the memory layout of error unions and supports nested optionals properly. This required changes in all the backends for generating optional constants. * TypedValue gains `eql` and `hash` methods. * Value: Implement hashing for floats, optionals, and enums. Additionally, the zig type tag is added to the hash, where it was not previously, so that values of differing types will get different hashes.
Diffstat (limited to 'lib/std/fmt/parse_float.zig')
0 files changed, 0 insertions, 0 deletions