Merge 0.12 release.
authorRobert Bradshaw <robertwb@math.washington.edu>
Wed, 6 Jan 2010 18:45:13 +0000 (10:45 -0800)
committerRobert Bradshaw <robertwb@math.washington.edu>
Wed, 6 Jan 2010 18:45:13 +0000 (10:45 -0800)
1  2 
Cython/Compiler/ExprNodes.py
Cython/Compiler/Main.py
Cython/Compiler/ModuleNode.py
Cython/Compiler/Nodes.py
Cython/Compiler/Optimize.py
Cython/Compiler/ParseTreeTransforms.py

Simple merge
Simple merge
Simple merge
index ce81e0ec56085da4f3f67cab06f9f7a89c881911,1f9f3aba381ad17da628ec973174776b1642c03a..644ab12d45fb4c0fbdf9f91304513c03ac726b23
@@@ -1104,32 -1087,12 +1104,32 @@@ class FuncDefNode(StatNode, BlockNode)
              env.use_utility_code(force_init_threads_utility_code)
              code.putln("PyGILState_STATE _save = PyGILState_Ensure();")
          # ----- Automatic lead-ins for certain special functions
-         if profile:
-             code.put_trace_call(self.entry.name, self.pos)
          if not lenv.nogil:
              code.put_setup_refcount_context(self.entry.name)
+         if profile:
+             code.put_trace_call(self.entry.name, self.pos)
          if is_getbuffer_slot:
              self.getbuffer_init(code)
 +        # ----- Create closure scope object
 +        if self.needs_closure:
 +            code.putln("%s = (%s)%s->tp_new(%s, %s, NULL);" % (
 +                            Naming.cur_scope_cname,
 +                            lenv.scope_class.type.declaration_code(''),
 +                            lenv.scope_class.type.typeptr_cname, 
 +                            lenv.scope_class.type.typeptr_cname,
 +                            Naming.empty_tuple))
 +            # TODO: error handling
 +            code.put_gotref(Naming.cur_scope_cname)
 +            # Note that it is unsafe to decref the scope at this point.
 +        if env.is_closure_scope:
 +            code.putln("%s = (%s)%s;" % (
 +                            outer_scope_cname,
 +                            env.scope_class.type.declaration_code(''),
 +                            Naming.self_cname))
 +            if self.needs_closure:
 +                # inner closures own a reference to their outer parent
 +                code.put_incref(outer_scope_cname, env.scope_class.type)
 +                code.put_giveref(outer_scope_cname)
          # ----- Fetch arguments
          self.generate_argument_parsing_code(env, code)
          # If an argument is assigned to in the body, we must 
@@@ -1750,12 -1704,10 +1752,13 @@@ class DefNode(FuncDefNode)
              if arg.not_none and not arg.type.is_extension_type:
                  error(self.pos,
                      "Only extension type arguments can have 'not None'")
 -        self.declare_pyfunction(env)
 +        if self.name == '<lambda>':
 +            self.declare_lambda_function(env)
 +        else:
 +            self.declare_pyfunction(env)
          self.analyse_signature(env)
          self.return_type = self.entry.signature.return_type()
+         self.create_local_scope(env)
  
      def analyse_signature(self, env):
          any_type_tests_needed = 0
Simple merge