                 body_bb = new llvm.BasicBlock "body", ir_func
                 llvm.IRBuilder.setInsertPoint body_bb
 
-                @pushScope new_scope
-
-                @visit n.body
-
-                @popScope()
+                @visitWithScope new_scope, [n.body]
 
                 # XXX more needed here - this lacks all sorts of control flow stuff.
                 # Finish off the function.

        popScope: ->
                @current_scope = @current_scope[PARENT_SCOPE_KEY]

        createAlloca: (func, type, name) ->
                saved_insert_point = llvm.IRBuilder.getInsertBlock()
                llvm.IRBuilder.setInsertPoint func.entry_bb

            allocas

        visitProgram: (n) ->
                # by the time we make it here the program has been
                # transformed so that there is nothing at the toplevel
                # but function declarations.
                @visit func for func in n.body

        visitBlock: (n) ->
                new_scope = {}
                @visitWithScope new_scope, n.body
                n

        visitIf: (n) ->
