From e090be97c32345bfba236a2dbd2d96c4350f852e Mon Sep 17 00:00:00 2001 From: Vitja Makarov <vitja.makarov@gmail.com> Date: Tue, 8 May 2012 00:32:08 +0400 Subject: [PATCH] Rename MarkAssignments to MarkParallelAssignments --- Cython/Compiler/Pipeline.py | 6 +++--- Cython/Compiler/TypeInference.py | 8 ++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Cython/Compiler/Pipeline.py b/Cython/Compiler/Pipeline.py index e40ed3eda..797501fe0 100644 --- a/Cython/Compiler/Pipeline.py +++ b/Cython/Compiler/Pipeline.py @@ -129,7 +129,7 @@ def create_pipeline(context, mode, exclude_classes=()): from ParseTreeTransforms import CreateClosureClasses, MarkClosureVisitor, DecoratorTransform from ParseTreeTransforms import InterpretCompilerDirectives, TransformBuiltinMethods from ParseTreeTransforms import ExpandInplaceOperators, ParallelRangeTransform - from TypeInference import MarkAssignments, MarkOverflowingArithmetic + from TypeInference import MarkParallelAssignments, MarkOverflowingArithmetic from ParseTreeTransforms import AdjustDefByDirectives, AlignFunctionDefinitions from ParseTreeTransforms import RemoveUnreachableCode, GilCheck from FlowControl import ControlFlowAnalysis @@ -179,10 +179,10 @@ def create_pipeline(context, mode, exclude_classes=()): EmbedSignature(context), EarlyReplaceBuiltinCalls(context), ## Necessary? TransformBuiltinMethods(context), ## Necessary? - MarkAssignments(context), + MarkParallelAssignments(context), ControlFlowAnalysis(context), RemoveUnreachableCode(context), - # MarkAssignments(context), + # MarkParallelAssignments(context), MarkOverflowingArithmetic(context), IntroduceBufferAuxiliaryVars(context), _check_c_declarations, diff --git a/Cython/Compiler/TypeInference.py b/Cython/Compiler/TypeInference.py index 715995d3b..78982293d 100644 --- a/Cython/Compiler/TypeInference.py +++ b/Cython/Compiler/TypeInference.py @@ -15,7 +15,11 @@ class TypedExprNode(ExprNodes.ExprNode): object_expr = TypedExprNode(py_object_type) -class MarkAssignments(EnvTransform): + +class MarkParallelAssignments(EnvTransform): + # Collects assignments inside parallel blocks prange, with parallel. + # Perhaps it's better to move it to ControlFlowAnalysis. + # tells us whether we're in a normal loop in_loop = False @@ -24,7 +28,7 @@ class MarkAssignments(EnvTransform): def __init__(self, context): # Track the parallel block scopes (with parallel, for i in prange()) self.parallel_block_stack = [] - return super(MarkAssignments, self).__init__(context) + return super(MarkParallelAssignments, self).__init__(context) def mark_assignment(self, lhs, rhs, inplace_op=None): if isinstance(lhs, (ExprNodes.NameNode, Nodes.PyArgDeclNode)): -- 2.30.9