diff options
author | Austin Clements <aclements@csail.mit.edu> | 2009-07-30 14:39:27 -0700 |
---|---|---|
committer | Austin Clements <aclements@csail.mit.edu> | 2009-07-30 14:39:27 -0700 |
commit | 96e1969da9cb424435bd31f2c912b15ce6e89fa1 (patch) | |
tree | 2fe900def247d1d92afe550b73763aeacf10a07f /usr/austin/eval/scope.go | |
parent | 6a40b7b0896e5de398a9e1af52d244621a1a56e4 (diff) | |
download | golang-96e1969da9cb424435bd31f2c912b15ce6e89fa1.tar.gz |
Implement labels, goto, labeled break, and labeled continue.
Return checking is now done as a general flow check at the end
of function compilation, since break and goto complicated the
way I was doing return checking before. Goto-over-declaration
checking is also done as a final flow check.
Temporary variables used for effect extraction are now
actually temporary. Otherwise "op=", "++", and "--" appear as
declarations that cannot be jumped over.
R=rsc
APPROVED=rsc
DELTA=421 (344 added, 38 deleted, 39 changed)
OCL=32527
CL=32535
Diffstat (limited to 'usr/austin/eval/scope.go')
-rw-r--r-- | usr/austin/eval/scope.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr/austin/eval/scope.go b/usr/austin/eval/scope.go index 6d89d00d7..aed896f95 100644 --- a/usr/austin/eval/scope.go +++ b/usr/austin/eval/scope.go @@ -51,14 +51,14 @@ func (b *block) DefineVar(name string, t Type) *Variable { if _, ok := b.defs[name]; ok { return nil; } - v := b.DefineTemp(t); + v := b.DefineSlot(t); if v != nil { b.defs[name] = v; } return v; } -func (b *block) DefineTemp(t Type) *Variable { +func (b *block) DefineSlot(t Type) *Variable { if b.inner != nil { log.Crash("Failed to exit child block before defining variable"); } |