From b9482fc32d13886626692484e5a778355fa7934c Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 11 Nov 2019 19:00:39 -0500 Subject: implement fully anonymous list literals --- src/analyze.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/analyze.cpp') 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(old_global_refs, old_count, - new_count, "ConstGlobalRefs"); - ConstExprValue *vals = reallocate(base, old_count, new_count, "ConstExprValue"); - for (size_t i = old_count; i < new_count; i += 1) { + ConstGlobalRefs *global_refs = allocate(count, "ConstGlobalRefs"); + ConstExprValue *vals = allocate(count, "ConstExprValue"); + for (size_t i = 0; i < count; i += 1) { vals[i].global_refs = &global_refs[i]; } return vals; -- cgit v1.2.3