This commit is contained in:
parent
c9c6b94c18
commit
3301cf5542
49 changed files with 690 additions and 262 deletions
|
@ -7,7 +7,7 @@ import (
|
|||
// CheckDeadCode checks for dead values.
|
||||
func (f *Function) CheckDeadCode() error {
|
||||
for instr := range f.Values {
|
||||
if instr.IsConst() && instr.Alive() == 0 {
|
||||
if instr.IsConst() && instr.CountUsers() == 0 {
|
||||
return errors.New(&UnusedValue{Value: instr.String()}, f.File, instr.Start())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue