Commit 8706c94b
8706c94b4d9cMerged
Richard Ramsden <[email protected]> · 6 months ago · 1 file · ~1 modified
Description
Remove writes to dead @needs_* flags
@needs_ptr_array and @needs_string_helpers were only ever assigned, never read. Drop the 17 dead write-sites.
Co-Authored-By: Claude Opus 4.7 (1M context) [email protected]
Details
- Commit
- 8706c94b4d9c
- Parent
- 1df1a441d577
spinel_codegen.rbmodifiedView file
@@ -2666,7 +2666,6 @@
26662666
return "poly_array"26672667
end26682668
if type_is_pointer(vt) == 12669-
@needs_ptr_array = 126702669
@needs_gc = 126712670
return vt + "_ptr_array"26722671
end@@ -4598,7 +4597,6 @@
45984597
return "poly_array"45994598
end46004599
if type_is_pointer(vt) == 14601-
@needs_ptr_array = 146024600
@needs_gc = 146034601
return vt + "_ptr_array"46044602
end@@ -14064,7 +14062,6 @@
1406414062
# so the GC scans the elements. Without this they'd be pushed1406514063
# into an int_array and silently swept.1406614064
if type_is_pointer(vt) == 114067-
@needs_ptr_array = 11406814065
@needs_gc = 11406914066
tmp = new_temp1407014067
emit(" sp_PtrArray *" + tmp + " = sp_PtrArray_new();")@@ -14722,7 +14719,6 @@
1472214719
return "sp_int_to_s(" + rc + ")"1472314720
end1472414721
if mname == "inspect"14725-
@needs_string_helpers = 11472614722
return "sp_int_to_s(" + rc + ")"1472714723
end1472814724
if mname == "digits"@@ -14809,7 +14805,6 @@
1480914805
return "sp_float_to_s(" + rc + ")"1481014806
end1481114807
if mname == "inspect"14812-
@needs_string_helpers = 11481314808
return "sp_float_inspect(" + rc + ")"1481414809
end1481514810
if mname == "to_i"@@ -20616,7 +20611,6 @@
2061620611
if op == "+"2061720612
tt = new_temp2061820613
ti = new_temp20619-
@needs_string_helpers = 12062020614
emit(" { sp_IntStrHash *" + tt + " = " + rc + "; mrb_int " + ti + " = " + idx +2062120615
"; sp_IntStrHash_set(" + tt + ", " + ti +2062220616
", sp_str_concat(sp_IntStrHash_get(" + tt + ", " + ti + "), " + val + ")); }")@@ -20639,23 +20633,18 @@
2063920633
# callers can fall back to their previous behaviour.2064020634
def compile_inspect_for(at, val)2064120635
if at == "int"20642-
@needs_string_helpers = 12064320636
return "sp_int_to_s(" + val + ")"2064420637
end2064520638
if at == "float"20646-
@needs_string_helpers = 12064720639
return "sp_float_inspect(" + val + ")"2064820640
end2064920641
if at == "string" || at == "string?"20650-
@needs_string_helpers = 12065120642
return "sp_str_inspect(" + val + ")"2065220643
end2065320644
if at == "mutable_str"20654-
@needs_string_helpers = 12065520645
return "sp_str_inspect(" + val + "->data)"2065620646
end2065720647
if at == "symbol"20658-
@needs_string_helpers = 12065920648
return "sp_str_concat(\":\", sp_sym_to_s(" + val + "))"2066020649
end2066120650
if at == "bool"@@ -20666,32 +20655,26 @@
2066620655
end2066720656
if at == "int_array"2066820657
@needs_int_array = 120669-
@needs_string_helpers = 12067020658
return "sp_IntArray_inspect(" + val + ")"2067120659
end2067220660
if at == "float_array"2067320661
@needs_float_array = 120674-
@needs_string_helpers = 12067520662
return "sp_FloatArray_inspect(" + val + ")"2067620663
end2067720664
if at == "str_array"2067820665
@needs_str_array = 120679-
@needs_string_helpers = 12068020666
return "sp_StrArray_inspect(" + val + ")"2068120667
end2068220668
if at == "sym_array"2068320669
@needs_int_array = 120684-
@needs_string_helpers = 12068520670
return "sp_SymArray_inspect(" + val + ")"2068620671
end2068720672
if at == "poly_array"2068820673
@needs_rb_value = 120689-
@needs_string_helpers = 12069020674
return "sp_PolyArray_inspect(" + val + ")"2069120675
end2069220676
if at == "poly"2069320677
@needs_rb_value = 120694-
@needs_string_helpers = 12069520678
return "sp_poly_inspect(" + val + ")"2069620679
end2069720680
""