aboutsummaryrefslogtreecommitdiff
path: root/test/compile_errors.zig
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-09-20 11:04:31 -0400
committerAndrew Kelley <superjoe30@gmail.com>2018-09-20 11:04:31 -0400
commitf8fe517d126d582e37ab4537fe9fd42f0531f44b (patch)
tree040baa17d21eb30b1dc7d2a4ef470fe7aea08e85 /test/compile_errors.zig
parent492821781dc34659f694577aacbc853c8839406f (diff)
downloadzig-f8fe517d126d582e37ab4537fe9fd42f0531f44b.tar.gz
zig-f8fe517d126d582e37ab4537fe9fd42f0531f44b.zip
better string literal caching implementation
We were caching the ConstExprValue of string literals, which works if you can never modify ConstExprValues. This premise is broken with `comptime var ...`. So I implemented an optimization in ConstExprValue arrays, where it stores a `Buf *` directly rather than an array of ConstExprValues for the elements, and then similar to array of undefined, it is expanded into the canonical form when necessary. However many operations can happen directly on the `Buf *`, which is faster. Furthermore, before a ConstExprValue array is expanded into canonical form, it removes itself from the string literal cache. This fixes the issue, because before an array element is modified it would have to be expanded. closes #1076
Diffstat (limited to 'test/compile_errors.zig')
0 files changed, 0 insertions, 0 deletions