mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-13 15:33: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:
@@ -31,6 +31,7 @@ type Function struct {
|
||||
fn *ssa.Function
|
||||
llvmFn llvm.Value
|
||||
blocking bool
|
||||
flag bool // used by dead code elimination
|
||||
parents []*Function // calculated by AnalyseCallgraph
|
||||
children []*Function
|
||||
}
|
||||
@@ -39,6 +40,7 @@ type Function struct {
|
||||
type Global struct {
|
||||
g *ssa.Global
|
||||
llvmGlobal llvm.Value
|
||||
flag bool // used by dead code elimination
|
||||
}
|
||||
|
||||
// Type with a name and possibly methods.
|
||||
|
||||
Reference in New Issue
Block a user