Closed RenaudFondeur closed 1 month ago
Hi @RenaudFondeur !
I cannot review this PR because all the files were changed by Tonel :(
I was checking the new tests, they looks ok.
suppress unused expression including some more complex than just variables and constants.
Which ones? Those tests show that after inlining there are still some unused local assignments and unnecessary ifs.
hello @PalumboN !
The tests missing are the cases where the variable need to be retained because the method to be inlined is either in a return, an assignment or the receiver/argument of a send.
Sometimes inlining doesn't put a goTo node in the conditional send meaning it can become empty during the check, in this case the check either suppress it or reduce it (for example ifTrue:ifFalse: -> ifFalse: if the ifTrue: is empty).
The unused variable can also arrive in the check after getting some transformation like a cast or becoming a function call if it is an instance variable.
add a visitor in Slang to suppress unused expressions after inlining occurs