Skip to content

Commit 7491947

Browse files
committed
Change function name and remove test case
1 parent de31f6b commit 7491947

File tree

2 files changed

+8
-47
lines changed

2 files changed

+8
-47
lines changed

src/parser.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,7 +1374,7 @@ void parse_array_compound_literal(var_t *var,
13741374
* Parsing assigns these temporaries synthetic names via gen_name_to (".tN")
13751375
* and they keep array metadata without pointer indirection.
13761376
*/
1377-
bool is_compound_literal_array_temp(var_t *var)
1377+
bool is_array_literal_placeholder(var_t *var)
13781378
{
13791379
return var && var->array_size > 0 && !var->ptr_level &&
13801380
var->var_name[0] == '.';
@@ -1385,7 +1385,7 @@ var_t *scalarize_array_literal(block_t *parent,
13851385
var_t *array_var,
13861386
type_t *hint_type)
13871387
{
1388-
if (!is_compound_literal_array_temp(array_var))
1388+
if (!is_array_literal_placeholder(array_var))
13891389
return array_var;
13901390

13911391
type_t *elem_type = hint_type ? hint_type : array_var->type;
@@ -2951,11 +2951,11 @@ void read_expr(block_t *parent, basic_block_t **bb)
29512951
bool rs1_is_ptr_like = rs1 && (rs1->ptr_level || rs1->array_size);
29522952
bool rs2_is_ptr_like = rs2 && (rs2->ptr_level || rs2->array_size);
29532953

2954-
if (is_compound_literal_array_temp(rs1) && !rs2_is_ptr_like)
2954+
if (is_array_literal_placeholder(rs1) && !rs2_is_ptr_like)
29552955
rs1 = scalarize_array_literal(parent, bb, rs1,
29562956
rs2 && rs2->type ? rs2->type : NULL);
29572957

2958-
if (is_compound_literal_array_temp(rs2) && !rs1_is_ptr_like)
2958+
if (is_array_literal_placeholder(rs2) && !rs1_is_ptr_like)
29592959
rs2 = scalarize_array_literal(parent, bb, rs2,
29602960
rs1 && rs1->type ? rs1->type : NULL);
29612961
/* Constant folding for binary operations */
@@ -3609,8 +3609,8 @@ void read_ternary_operation(block_t *parent, basic_block_t **bb)
36093609
read_expr(parent, &else_);
36103610
bb_connect(*bb, else_, ELSE);
36113611
var_t *false_val = opstack_pop();
3612-
bool true_array = is_compound_literal_array_temp(true_val);
3613-
bool false_array = is_compound_literal_array_temp(false_val);
3612+
bool true_array = is_array_literal_placeholder(true_val);
3613+
bool false_array = is_array_literal_placeholder(false_val);
36143614

36153615
if (true_array && !false_array)
36163616
true_val = scalarize_array_literal(parent, &then_, true_val,
@@ -3626,9 +3626,9 @@ void read_ternary_operation(block_t *parent, basic_block_t **bb)
36263626
add_insn(parent, else_, OP_assign, vd, false_val, NULL, 0, NULL);
36273627

36283628
var_t *array_ref = NULL;
3629-
if (is_compound_literal_array_temp(true_val))
3629+
if (is_array_literal_placeholder(true_val))
36303630
array_ref = true_val;
3631-
else if (is_compound_literal_array_temp(false_val))
3631+
else if (is_array_literal_placeholder(false_val))
36323632
array_ref = false_val;
36333633

36343634
if (array_ref) {

tests/array_ptr.c

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)