delete unused LongNode class
authorStefan Behnel <stefan_ml@behnel.de>
Sat, 23 Feb 2013 10:39:14 +0000 (11:39 +0100)
committerStefan Behnel <stefan_ml@behnel.de>
Sat, 23 Feb 2013 10:39:14 +0000 (11:39 +0100)
Cython/Compiler/ExprNodes.py
Cython/Compiler/Optimize.py

index a2eb14c..e7d9ed4 100755 (executable)
@@ -1248,37 +1248,6 @@ class IdentifierStringNode(StringNode):
     is_identifier = True
 
 
-class LongNode(AtomicExprNode):
-    #  Python long integer literal
-    #
-    #  value   string
-
-    type = py_object_type
-
-    def calculate_constant_result(self):
-        self.constant_result = Utils.str_to_number(self.value)
-
-    def compile_time_value(self, denv):
-        return Utils.str_to_number(self.value)
-
-    def analyse_types(self, env):
-        self.is_temp = 1
-        return self
-
-    def may_be_none(self):
-        return False
-
-    gil_message = "Constructing Python long int"
-
-    def generate_result_code(self, code):
-        code.putln(
-            '%s = PyLong_FromString((char *)"%s", 0, 0); %s' % (
-                self.result(),
-                self.value,
-                code.error_goto_if_null(self.result(), self.pos)))
-        code.put_gotref(self.py_result())
-
-
 class ImagNode(AtomicExprNode):
     #  Imaginary number literal
     #
@@ -2597,7 +2566,7 @@ class IndexNode(ExprNode):
                 return py_object_type
 
         index_type = self.index.infer_type(env)
-        if index_type and index_type.is_int or isinstance(self.index, (IntNode, LongNode)):
+        if index_type and index_type.is_int or isinstance(self.index, IntNode):
             # indexing!
             if base_type is unicode_type:
                 # Py_UCS4 will automatically coerce to a unicode string
index f1391ca..c6a9d19 100644 (file)
@@ -2992,7 +2992,7 @@ class ConstantFolding(Visitor.VisitorTransform, SkipDeclarations):
             traceback.print_exc(file=sys.stdout)
 
     NODE_TYPE_ORDER = [ExprNodes.CharNode, ExprNodes.IntNode,
-                       ExprNodes.LongNode, ExprNodes.FloatNode]
+                       ExprNodes.FloatNode]
 
     def _widest_node_class(self, *nodes):
         try:
@@ -3032,9 +3032,6 @@ class ConstantFolding(Visitor.VisitorTransform, SkipDeclarations):
                 value = '-' + value
             return value
 
-        if isinstance(node.operand, ExprNodes.LongNode):
-            return ExprNodes.LongNode(node.pos, value=_negate(node.operand.value),
-                                      constant_result=node.constant_result)
         if isinstance(node.operand, ExprNodes.FloatNode):
             # this is a safe operation
             return ExprNodes.FloatNode(node.pos, value=_negate(node.operand.value),