x/tools/internal/refactor/inline: good starter projects #63352
Labels
help wanted
NeedsFix
The path to resolution is known, but the work has not been done.
Refactoring
Issues related to refactoring tools
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
Below is a list of starter projects for anyone who wants to get their hands dirty in the inliner logic. Before starting work on any item, please fork it off into a separate issue, briefly stating the approach you plan to take.
param := arg
when it's not necessary to state the type....and instead of preventing elimination, blank out the var decl.
avoid unnecessarily renaming imports (may need additional inputs?)(x/tools/internal/refactor/inline: analyzer generates unnecessary import renames #67281)func() { var param=arg; ... } ()
thanfunc(param) { ... } (arg)
. (Beware: binding decls cover params and named result vars; they may need to be teased apart.)See also:
More challenging projects:
if f(); cond { ... }
to{ fbody; if cond { ... } }
when the inlining of f() is not a simple expression.- [ ] Add a control flow analysis that is more precise than the current "single assignment" predicate. Currently, a binding declaration is required if an argument is a variable that is not "single assignment". But if all the assignments can be proved to occur before or after the call (but not during it using lambdas) then a binding declaration may not be needed.f(g())
where g returns >1 result).The text was updated successfully, but these errors were encountered: