From: Dag Sverre Seljebotn Date: Mon, 4 Aug 2008 08:14:26 +0000 (+0200) Subject: Removed dead transform prototype code X-Git-Tag: 0.9.8.1~49^2~25 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9f2c76647125a736cfac76c019448a91ed341050;p=cython.git Removed dead transform prototype code --- diff --git a/Cython/Compiler/CmdLine.py b/Cython/Compiler/CmdLine.py index 3275a224..fb63b8af 100644 --- a/Cython/Compiler/CmdLine.py +++ b/Cython/Compiler/CmdLine.py @@ -44,37 +44,12 @@ Options: # -+, --cplus Use C++ compiler for compiling and linking # Additional .o files to link may be supplied when using -X.""" -#The following options are very experimental and is used for plugging in code -#into different transform stages. -# -T phase:factory At the phase given, hand off the tree to the transform returned -# when calling factory without arguments. Factory should be fully -# specified (ie Module.SubModule.factory) and the containing module -# will be imported. This option can be repeated to add more transforms, -# transforms for the same phase will be used in the order they are given. - def bad_usage(): sys.stderr.write(usage) sys.exit(1) def parse_command_line(args): - def parse_add_transform(transforms, param): - from Main import PHASES - def import_symbol(fqn): - modsplitpt = fqn.rfind(".") - if modsplitpt == -1: bad_usage() - modulename = fqn[:modsplitpt] - symbolname = fqn[modsplitpt+1:] - module = __import__(modulename, globals(), locals(), [symbolname]) - return getattr(module, symbolname) - - stagename, factoryname = param.split(":") - if not stagename in PHASES: - bad_usage() - factory = import_symbol(factoryname) - transform = factory() - transforms[stagename].append(transform) - from Cython.Compiler.Main import \ CompilationOptions, default_options @@ -135,9 +110,6 @@ def parse_command_line(args): Options.annotate = True elif option == "--convert-range": Options.convert_range = True - elif option.startswith("-T"): - parse_add_transform(options.transforms, get_param(option)) - # Note: this can occur multiple times, each time appends else: bad_usage() else: diff --git a/Cython/Compiler/Main.py b/Cython/Compiler/Main.py index 2e994148..7f05fc25 100644 --- a/Cython/Compiler/Main.py +++ b/Cython/Compiler/Main.py @@ -721,7 +721,6 @@ default_options = dict( generate_pxi = 0, working_path = "", recursive = 0, - transforms = None, # deprecated timestamps = None, verbose = 0, quiet = 0) diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py index e1b638e0..2cb4d8ff 100644 --- a/Cython/Compiler/ModuleNode.py +++ b/Cython/Compiler/ModuleNode.py @@ -254,7 +254,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): code.globalstate.insert_global_var_declarations_into(code) self.generate_cached_builtins_decls(env, code) - self.body.generate_function_definitions(env, code, options.transforms) + self.body.generate_function_definitions(env, code) code.mark_pos(None) self.generate_typeobj_definitions(env, code) self.generate_method_table(env, code) diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index e895f0e0..99608afa 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -260,10 +260,10 @@ class StatListNode(Node): for stat in self.stats: stat.analyse_expressions(env) - def generate_function_definitions(self, env, code, transforms): + def generate_function_definitions(self, env, code): #print "StatListNode.generate_function_definitions" ### for stat in self.stats: - stat.generate_function_definitions(env, code, transforms) + stat.generate_function_definitions(env, code) def generate_execution_code(self, code): #print "StatListNode.generate_execution_code" ### @@ -289,7 +289,7 @@ class StatNode(Node): # Emit C code for executable statements. # - def generate_function_definitions(self, env, code, transforms): + def generate_function_definitions(self, env, code): pass def generate_execution_code(self, code): @@ -839,7 +839,7 @@ class FuncDefNode(StatNode, BlockNode): self.local_scope = lenv return lenv - def generate_function_definitions(self, env, code, transforms): + def generate_function_definitions(self, env, code): import Buffer lenv = self.local_scope @@ -985,7 +985,7 @@ class FuncDefNode(StatNode, BlockNode): # ----- Python version code.exit_cfunc_scope() if self.py_func: - self.py_func.generate_function_definitions(env, code, transforms) + self.py_func.generate_function_definitions(env, code) self.generate_optarg_wrapper_function(env, code) def put_stararg_decrefs(self, code): @@ -2015,10 +2015,9 @@ class PyClassDefNode(ClassDefNode): #self.classobj.release_temp(env) #self.target.release_target_temp(env) - def generate_function_definitions(self, env, code, transforms): + def generate_function_definitions(self, env, code): self.generate_py_string_decls(self.scope, code) - self.body.generate_function_definitions( - self.scope, code, transforms) + self.body.generate_function_definitions(self.scope, code) def generate_execution_code(self, code): self.dict.generate_evaluation_code(code) @@ -2134,11 +2133,11 @@ class CClassDefNode(ClassDefNode): scope = self.entry.type.scope self.body.analyse_expressions(scope) - def generate_function_definitions(self, env, code, transforms): + def generate_function_definitions(self, env, code): self.generate_py_string_decls(self.entry.type.scope, code) if self.body: self.body.generate_function_definitions( - self.entry.type.scope, code, transforms) + self.entry.type.scope, code) def generate_execution_code(self, code): # This is needed to generate evaluation code for @@ -2172,8 +2171,8 @@ class PropertyNode(StatNode): def analyse_expressions(self, env): self.body.analyse_expressions(env) - def generate_function_definitions(self, env, code, transforms): - self.body.generate_function_definitions(env, code, transforms) + def generate_function_definitions(self, env, code): + self.body.generate_function_definitions(env, code) def generate_execution_code(self, code): pass