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):
return False
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)
return node
......@@ -950,7 +950,7 @@ class SwitchTransform(Visitor.CythonTransform):
return switch_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)
return node
......@@ -966,7 +966,7 @@ class SwitchTransform(Visitor.CythonTransform):
node.true_val, node.false_val)
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)
return node
......@@ -984,7 +984,7 @@ class SwitchTransform(Visitor.CythonTransform):
ExprNodes.BoolNode(node.pos, value=False, constant_result=False))
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)
return node
......@@ -1031,7 +1031,7 @@ class SwitchTransform(Visitor.CythonTransform):
return replacement
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)
return node
......
......@@ -129,7 +129,7 @@ directive_defaults = {
# optimizations
'optimize.inline_defnode_calls': True,
'optimize.switchcase_transform': True,
'optimize.use_switch': True,
# remove unreachable code
'remove_unreachable': True,
......
# cython: optimize.switchcase_transform=True
# cython: optimize.use_switch=True
# mode: error
import cython
cdef extern from "includes/e_switch_transform_support.h":
cdef extern from "../run/includes/switch_transform_support.h":
enum:
ONE
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":
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