Improved variable lifetime comments

This commit is contained in:
Eduard Urbach 2024-07-18 11:40:07 +02:00
parent 61dc691c65
commit 3e5adff5e5
Signed by: eduard
GPG key ID: 49226B848C78F6C8

View file

@ -63,10 +63,6 @@ func (f *Function) useVariable(variable *Variable) {
continue
}
if config.Comments {
f.Comment("%s (%s) used in scope %d", local.Name, local.Register, i)
}
local.Alive--
if local.Alive < 0 {
@ -79,6 +75,8 @@ func (f *Function) useVariable(variable *Variable) {
}
scope.Free(local.Register)
} else if config.Comments {
f.Comment("%s (%s) used in scope %d", local.Name, local.Register, i)
}
}
}