← Back
Editing: scope.cpython-311.pyc
� cR�a` � �^ � d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl Z G d� de� � ZdS ) z" Scope computes scope information � )�AncestorsWithBody)�DefUseChains)�FunctionAnalysis)�defaultdictNc �. � � e Zd ZdZ� fd�Zd� Zd� Z� xZS )�ScopeaN Associate each variable declaration with the node that defines it Whenever possible, associate the variable declaration to an assignment, otherwise to a node that defines a bloc (e.g. a For) This takes OpenMP information into accounts! The result is a dictionary with nodes as key and set of names as values c �( �� t t � � | _ t j t j t j t j t j t f| _ t t | � � � t t � � d S �N)r �set�result�ast�FunctionDef�For� excepthandler�While�If�tuple�decl_holders�superr �__init__r r )�self� __class__s ��8/usr/lib/python3/dist-packages/pythran/analyses/scope.pyr zScope.__init__ s_ �� �!�#�&�&��� �_�c�g� �.� �Y����7��� �e�T���#�#�$5�|�D�D�D�D�D� c �� � |j D ]Y}||j v r�t |t j � � r3| j � |j g � � � |� � �Zd S r ) �deps�private_deps� isinstancer �Name�openmp_deps� setdefault�id�append)r �node�deps r �visit_OMPDirectivezScope.visit_OMPDirective sq � ��9� D� D�C��d�'�'�'���#�s�x�(�(� D�� �+�+�C�F�B�7�7�>�>�s�C�C�C�� D� Dr c � � � � j � _ t � � � _ � � |� � t � � }� j j | D ]=}|� |� � � g � � � |� � �>|� � � D �]�\ }}d� |D � � d� |D � � z }|� � fd�� j � |g � � D � � � � � fd�|D � � }d� t |� D � � }|d d } t | � j � � r�d� |D � � }|� � j � |g � � � � t! � � } |D ]V}|}� j | d | ur(� j | d }� j | d | u�(| � |� � �W| | vrEt | t$ � � r| n| j } | D ]$}|| v rt |t( j � � r|} n�%� j | � |� � ���d S ) Nc � � g | ] }|j �� S � �r$ ��.0�ds r � <listcomp>z+Scope.visit_FunctionDef.<locals>.<listcomp>4 s � �)�)�)�q�A�F�)�)�)r c �J � g | ] }|� � � D ] }|j �� �!S r) )�usersr$ )r, r- �us r r. z+Scope.visit_FunctionDef.<locals>.<listcomp>4 sO � � -O� -O� -O�12�A�G�G�I�I�-O� -O�?@� ./�V� -O� -O� -O� -Or c 3 �>