← Back
Editing: argument_read_once.cpython-311.pyc
� cR�a# � �v � d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl m Z ddlZddl mZ G d� d e� � ZdS ) zG ArgumentReadOnce counts the usages of each argument of each function. � )�Aliases)�GlobalDeclarations)�ModuleAnalysis)�MODULESN)�reducec �� � � e Zd ZdZ G d� de� � Z G d� de� � Z G d� de� � Z� fd�Z� fd �Z � fd �Z d� Zd� Zd � Z d� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Z� xZS )�ArgumentReadOncea Counts the usages of each argument of each function. Attributes ---------- result : {FunctionEffects} Number of use for each argument of each function. node_to_functioneffect : {???: ???} FunctionDef ast node to function effect binding. c � � e Zd Zd� ZdS )� ArgumentReadOnce.FunctionEffectsc �T � || _ d� | _ t |t j � � r$dgt |j j � � z | _ d S t |t j � � rd� |j D � � | _ d S t |t j � � r g | _ d S t �)Nc � � dS �Nr � ��ctxs �E/usr/lib/python3/dist-packages/pythran/analyses/argument_read_once.py�<lambda>z;ArgumentReadOnce.FunctionEffects.__init__.<locals>.<lambda> � � �A� � ���c �J � g | ] }t |t j � � rd nd��!S )� � )� isinstance� intrinsic�ReadOnceEffect)�.0�xs r � <listcomp>z=ArgumentReadOnce.FunctionEffects.__init__.<locals>.<listcomp>! sA � � %;� %;� %;� � $�A�y�'?�@�@� �A�A��%;� %;� %;r ) �func�dependenciesr �ast�FunctionDef�len�args�read_effectsr � Intrinsic�argument_effects�alias�NotImplementedError��self�nodes r �__init__z)ArgumentReadOnce.FunctionEffects.__init__ s� � ��D�I� -� �D���$���0�0� *�%'�D�3�t�y�~�+>�+>�$>��!�!�!��D�)�"5�6�6� *�%;� %;�$(�$9�%;� %;� %;��!�!�!� �D�#�)�,�,� *�$&��!�!�!�)�)r N��__name__� __module__�__qualname__r. r r r �FunctionEffectsr s# � � � � � � *� *� *� *� *r r3 c � � e Zd Zd� ZdS )�#ArgumentReadOnce.ConstructorEffectsc �4 � || _ d� | _ dg| _ d S )Nc � � dS r r r s r r z>ArgumentReadOnce.ConstructorEffects.__init__.<locals>.<lambda>, r r r )r r! r&