From ae87629a406959facf9466851db98c66c30359a8 Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Wed, 24 Oct 2007 01:41:16 -0700 Subject: [PATCH] Fix builtins caching --- Cython/Compiler/ExprNodes.py | 2 +- Cython/Compiler/ModuleNode.py | 6 +++--- Cython/Compiler/Options.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 066cc61b..cd9b71ff 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -815,7 +815,7 @@ class NameNode(AtomicExprNode): if entry.is_pyglobal or entry.is_builtin: assert type.is_pyobject, "Python global or builtin not a Python object" if Options.intern_names: - self.interned_cname = env.intern(self.entry.name) + self.interned_cname = self.entry.interned_cname = env.intern(self.entry.name) def check_identifier_kind(self): #print "NameNode.check_identifier_kind:", self.entry.name ### diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py index 28aad9a2..f27e37ba 100644 --- a/Cython/Compiler/ModuleNode.py +++ b/Cython/Compiler/ModuleNode.py @@ -1239,9 +1239,9 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): code.putln("/*--- String init code ---*/") self.generate_string_init_code(env, code) - code.putln("/*--- Builtin init code ---*/") - # TODO: FIXME !! - #self.generate_builtin_init_code(env, code) + if Options.cache_builtins: + code.putln("/*--- Builtin init code ---*/") + self.generate_builtin_init_code(env, code) code.putln("/*--- Global init code ---*/") self.generate_global_init_code(env, code) diff --git a/Cython/Compiler/Options.py b/Cython/Compiler/Options.py index ccb5f216..3b426f24 100644 --- a/Cython/Compiler/Options.py +++ b/Cython/Compiler/Options.py @@ -3,7 +3,7 @@ # intern_names = 1 # Intern global variable and attribute names -cache_builtins = 0 # Perform lookups on builtin names only once +cache_builtins = 1 # Perform lookups on builtin names only once embed_pos_in_docstring = 0 gcc_branch_hints = 1 -- 2.26.2