Commit d9b3c477 authored by Alok Singhal's avatar Alok Singhal

rename "switchcase_transform" to "use_switch"

parent 48559415
...@@ -917,7 +917,7 @@ class SwitchTransform(Visitor.CythonTransform): ...@@ -917,7 +917,7 @@ class SwitchTransform(Visitor.CythonTransform):
return False return False
def visit_IfStatNode(self, node): def visit_IfStatNode(self, node):
if not self.current_directives.get('optimize.switchcase_transform'): if not self.current_directives.get('optimize.use_switch'):
self.visitchildren(node) self.visitchildren(node)
return node return node
...@@ -950,7 +950,7 @@ class SwitchTransform(Visitor.CythonTransform): ...@@ -950,7 +950,7 @@ class SwitchTransform(Visitor.CythonTransform):
return switch_node return switch_node
def visit_CondExprNode(self, node): def visit_CondExprNode(self, node):
if not self.current_directives.get('optimize.switchcase_transform'): if not self.current_directives.get('optimize.use_switch'):
self.visitchildren(node) self.visitchildren(node)
return node return node
...@@ -966,7 +966,7 @@ class SwitchTransform(Visitor.CythonTransform): ...@@ -966,7 +966,7 @@ class SwitchTransform(Visitor.CythonTransform):
node.true_val, node.false_val) node.true_val, node.false_val)
def visit_BoolBinopNode(self, node): def visit_BoolBinopNode(self, node):
if not self.current_directives.get('optimize.switchcase_transform'): if not self.current_directives.get('optimize.use_switch'):
self.visitchildren(node) self.visitchildren(node)
return node return node
...@@ -984,7 +984,7 @@ class SwitchTransform(Visitor.CythonTransform): ...@@ -984,7 +984,7 @@ class SwitchTransform(Visitor.CythonTransform):
ExprNodes.BoolNode(node.pos, value=False, constant_result=False)) ExprNodes.BoolNode(node.pos, value=False, constant_result=False))
def visit_PrimaryCmpNode(self, node): def visit_PrimaryCmpNode(self, node):
if not self.current_directives.get('optimize.switchcase_transform'): if not self.current_directives.get('optimize.use_switch'):
self.visitchildren(node) self.visitchildren(node)
return node return node
...@@ -1031,7 +1031,7 @@ class SwitchTransform(Visitor.CythonTransform): ...@@ -1031,7 +1031,7 @@ class SwitchTransform(Visitor.CythonTransform):
return replacement return replacement
def visit_EvalWithTempExprNode(self, node): def visit_EvalWithTempExprNode(self, node):
if not self.current_directives.get('optimize.switchcase_transform'): if not self.current_directives.get('optimize.use_switch'):
self.visitchildren(node) self.visitchildren(node)
return node return node
......
...@@ -129,7 +129,7 @@ directive_defaults = { ...@@ -129,7 +129,7 @@ directive_defaults = {
# optimizations # optimizations
'optimize.inline_defnode_calls': True, 'optimize.inline_defnode_calls': True,
'optimize.switchcase_transform': True, 'optimize.use_switch': True,
# remove unreachable code # remove unreachable code
'remove_unreachable': True, 'remove_unreachable': True,
......
# cython: optimize.switchcase_transform=True # cython: optimize.use_switch=True
# mode: error # mode: error
import cython import cython
cdef extern from "includes/e_switch_transform_support.h": cdef extern from "../run/includes/switch_transform_support.h":
enum: enum:
ONE ONE
ONE_AGAIN ONE_AGAIN
......
#ifndef E_SWITCH_TRANSFORM_SUPPORT_H_
#define E_SWITCH_TRANSFORM_SUPPORT_H_ 1
enum {
ONE=1,
ONE_AGAIN=1
};
#endif /* E_SWITCH_TRANSFORM_SUPPORT_H_ */
# cython: optimize.switchcase_transform=False # cython: optimize.use_switch=False
cdef extern from "includes/switch_transform_support.h": cdef extern from "includes/switch_transform_support.h":
enum: enum:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment