Get rid of __Pyx_Name unused warning.
authorRobert Bradshaw <robertwb@math.washington.edu>
Wed, 10 Feb 2010 23:32:17 +0000 (15:32 -0800)
committerRobert Bradshaw <robertwb@math.washington.edu>
Wed, 10 Feb 2010 23:32:17 +0000 (15:32 -0800)
Cython/Compiler/Code.py
Cython/Compiler/ExprNodes.py
Cython/Compiler/Nodes.py

index d84c4223bb2d04215005895cf6d95d3eb561d91e..1e46d2c7359588b4b3ece2a2be2871df76e6f9fb 100644 (file)
@@ -637,6 +637,8 @@ class GlobalState(object):
     def put_cached_builtin_init(self, pos, name, cname):
         w = self.parts['cached_builtins']
         interned_cname = self.get_interned_identifier(name).cname
+        from ExprNodes import get_name_interned_utility_code
+        self.use_utility_code(get_name_interned_utility_code)
         w.putln('%s = __Pyx_GetName(%s, %s); if (!%s) %s' % (
             cname,
             Naming.builtins_cname,
index b7023ab8b1141d8c14890c08d65193208b9e86c2..378d2dc3b00916ad8183f3364016db60f94ffd15 100755 (executable)
@@ -1248,8 +1248,8 @@ class NameNode(AtomicExprNode):
                 self.is_temp = 0
             else:
                 self.is_temp = 1
+                env.use_utility_code(get_name_interned_utility_code)
             self.is_used_as_rvalue = 1
-            env.use_utility_code(get_name_interned_utility_code)
 
     def nogil_check(self, env):
         if self.is_used_as_rvalue:
@@ -1336,6 +1336,7 @@ class NameNode(AtomicExprNode):
                 namespace = Naming.builtins_cname
             else: # entry.is_pyglobal
                 namespace = entry.scope.namespace_cname
+            code.globalstate.use_utility_code(get_name_interned_utility_code)
             code.putln(
                 '%s = __Pyx_GetName(%s, %s); %s' % (
                 self.result(),
index 9474ee66d8a5d7e2d4a0becbd26c8480bf962d0b..8e271c284823324bbb888d752588e36513e9a26f 100644 (file)
@@ -4166,7 +4166,7 @@ class ForFromStatNode(LoopNode, StatNode):
                 target_node = ExprNodes.PyTempNode(self.target.pos, None)
                 target_node.allocate(code)
                 interned_cname = code.intern_identifier(self.target.entry.name)
-                code.putln("/*here*/")
+                code.globalstate.use_utility_code(ExprNodes.get_name_interned_utility_code)
                 code.putln("%s = __Pyx_GetName(%s, %s); %s" % (
                                 target_node.result(),
                                 Naming.module_cname,