diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-11-11 19:00:39 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-11-11 19:00:39 -0500 |
| commit | b9482fc32d13886626692484e5a778355fa7934c (patch) | |
| tree | 6e8f2a55bfb47910e50b39db4e41b3039a78767d /src/analyze.cpp | |
| parent | a33b9aec724dfce68889f6255a2c78572b47c92f (diff) | |
| download | zig-b9482fc32d13886626692484e5a778355fa7934c.tar.gz zig-b9482fc32d13886626692484e5a778355fa7934c.zip | |
implement fully anonymous list literals
Diffstat (limited to 'src/analyze.cpp')
| -rw-r--r-- | src/analyze.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp index d8ff4f2848..316fa52ac5 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -5857,15 +5857,9 @@ ConstExprValue *create_const_arg_tuple(CodeGen *g, size_t arg_index_start, size_ ConstExprValue *create_const_vals(size_t count) { - return realloc_const_vals(nullptr, 0, count); -} - -ConstExprValue *realloc_const_vals(ConstExprValue *base, size_t old_count, size_t new_count) { - ConstGlobalRefs *old_global_refs = (base == nullptr) ? nullptr : base->global_refs; - ConstGlobalRefs *global_refs = reallocate<ConstGlobalRefs>(old_global_refs, old_count, - new_count, "ConstGlobalRefs"); - ConstExprValue *vals = reallocate<ConstExprValue>(base, old_count, new_count, "ConstExprValue"); - for (size_t i = old_count; i < new_count; i += 1) { + ConstGlobalRefs *global_refs = allocate<ConstGlobalRefs>(count, "ConstGlobalRefs"); + ConstExprValue *vals = allocate<ConstExprValue>(count, "ConstExprValue"); + for (size_t i = 0; i < count; i += 1) { vals[i].global_refs = &global_refs[i]; } return vals; |
