mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-11 22:43:40 +00:00
Add dead code elimination (DCE) pass
This should make it much easier (in the future) to use the standard library when unused functions contain unimplemented features. But more importantly, it makes later passes better and makes compiling faster by not having to scan dead code.
This commit is contained in:
@@ -205,6 +205,7 @@ func (c *Compiler) Parse(mainPath string, buildTags []string) error {
|
||||
for _, pkg := range packageList {
|
||||
c.ir.AddPackage(pkg)
|
||||
}
|
||||
c.ir.SimpleDCE() // remove most dead code
|
||||
c.ir.AnalyseCallgraph() // set up callgraph
|
||||
c.ir.AnalyseInterfaceConversions() // determine which types are converted to an interface
|
||||
c.ir.AnalyseBlockingRecursive() // make all parents of blocking calls blocking (transitively)
|
||||
|
||||
Reference in New Issue
Block a user