Skip to content

Commit

Permalink
compiler: deadcode optimization for channels
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcandav committed Jan 3, 2025
1 parent ea57477 commit 426083c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/julec/opt/deadcode/define.jule
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl ObjectDeadCode {
continue
}

// Push all methods as live if s is built-in map type.
// Push all methods as live if s is requires all methods should be alive.
if allLive {
self.pushLive[&sema::FuncIns](ins)
self.setReferencesAsLive(ins.Refers)
Expand Down Expand Up @@ -388,5 +388,6 @@ fn EliminateDefines(mut &ir: &obj::IR) {
// Reports whether all methods live of structure.
fn isAllMethodsLive(s: &sema::Struct): bool {
ret s == meta::Program.Runtime.Map ||
s == meta::Program.Runtime.MapIterator
s == meta::Program.Runtime.MapIterator ||
s == meta::Program.Runtime.Pchan
}

0 comments on commit 426083c

Please sign in to comment.