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 end
26682668 if type_is_pointer(vt) == 1
2669- @needs_ptr_array = 1
26702669 @needs_gc = 1
26712670 return vt + "_ptr_array"
26722671 end
@@ -4598,7 +4597,6 @@
45984597 return "poly_array"
45994598 end
46004599 if type_is_pointer(vt) == 1
4601- @needs_ptr_array = 1
46024600 @needs_gc = 1
46034601 return vt + "_ptr_array"
46044602 end
@@ -14064,7 +14062,6 @@
1406414062 # so the GC scans the elements. Without this they'd be pushed
1406514063 # into an int_array and silently swept.
1406614064 if type_is_pointer(vt) == 1
14067- @needs_ptr_array = 1
1406814065 @needs_gc = 1
1406914066 tmp = new_temp
1407014067 emit(" sp_PtrArray *" + tmp + " = sp_PtrArray_new();")
@@ -14722,7 +14719,6 @@
1472214719 return "sp_int_to_s(" + rc + ")"
1472314720 end
1472414721 if mname == "inspect"
14725- @needs_string_helpers = 1
1472614722 return "sp_int_to_s(" + rc + ")"
1472714723 end
1472814724 if mname == "digits"
@@ -14809,7 +14805,6 @@
1480914805 return "sp_float_to_s(" + rc + ")"
1481014806 end
1481114807 if mname == "inspect"
14812- @needs_string_helpers = 1
1481314808 return "sp_float_inspect(" + rc + ")"
1481414809 end
1481514810 if mname == "to_i"
@@ -20616,7 +20611,6 @@
2061620611 if op == "+"
2061720612 tt = new_temp
2061820613 ti = new_temp
20619- @needs_string_helpers = 1
2062020614 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 = 1
2064320636 return "sp_int_to_s(" + val + ")"
2064420637 end
2064520638 if at == "float"
20646- @needs_string_helpers = 1
2064720639 return "sp_float_inspect(" + val + ")"
2064820640 end
2064920641 if at == "string" || at == "string?"
20650- @needs_string_helpers = 1
2065120642 return "sp_str_inspect(" + val + ")"
2065220643 end
2065320644 if at == "mutable_str"
20654- @needs_string_helpers = 1
2065520645 return "sp_str_inspect(" + val + "->data)"
2065620646 end
2065720647 if at == "symbol"
20658- @needs_string_helpers = 1
2065920648 return "sp_str_concat(\":\", sp_sym_to_s(" + val + "))"
2066020649 end
2066120650 if at == "bool"
@@ -20666,32 +20655,26 @@
2066620655 end
2066720656 if at == "int_array"
2066820657 @needs_int_array = 1
20669- @needs_string_helpers = 1
2067020658 return "sp_IntArray_inspect(" + val + ")"
2067120659 end
2067220660 if at == "float_array"
2067320661 @needs_float_array = 1
20674- @needs_string_helpers = 1
2067520662 return "sp_FloatArray_inspect(" + val + ")"
2067620663 end
2067720664 if at == "str_array"
2067820665 @needs_str_array = 1
20679- @needs_string_helpers = 1
2068020666 return "sp_StrArray_inspect(" + val + ")"
2068120667 end
2068220668 if at == "sym_array"
2068320669 @needs_int_array = 1
20684- @needs_string_helpers = 1
2068520670 return "sp_SymArray_inspect(" + val + ")"
2068620671 end
2068720672 if at == "poly_array"
2068820673 @needs_rb_value = 1
20689- @needs_string_helpers = 1
2069020674 return "sp_PolyArray_inspect(" + val + ")"
2069120675 end
2069220676 if at == "poly"
2069320677 @needs_rb_value = 1
20694- @needs_string_helpers = 1
2069520678 return "sp_poly_inspect(" + val + ")"
2069620679 end
2069720680 ""