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 :  /lib/python3/dist-packages/pythran/optimizations/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

cR�ad��x�dZddlmZmZddlmZddlZddlZGd�de��Z	Gd�dej
��ZdS)	z! Inlining inline functions body. �)�	Inlinable�Aliases)�TransformationNc�V��eZdZdZ�fd�Zd�ZeZeZeZeZ	eZ
eZeZeZ
eZeZd�Z�xZS)�Inlininga
    Inline one line functions.

    >>> import gast as ast
    >>> from pythran import passmanager, backend
    >>> pm = passmanager.PassManager("test")
    >>> node = ast.parse('''
    ... def foo(a, b):
    ...     return b + b * a
    ... def bar(b):
    ...     return foo(2 * b, b) * foo(b, b)''')
    >>> _, node = pm.apply(Inlining, node)
    >>> print(pm.dump(backend.Python, node))
    def foo(a, b):
        return (b + (b * a))
    def bar(b):
        __pythran_inlinefooa0 = (2 * b)
        __pythran_inlinefoob0 = b
        __pythran_inlinefooa1 = b
        __pythran_inlinefoob1 = b
        return ((__pythran_inlinefoob0 + (__pythran_inlinefoob0 * __pythran_inlinefooa0)) * (__pythran_inlinefoob1 + (__pythran_inlinefoob1 * __pythran_inlinefooa1)))
    c���d|_t��|_d|_t	t
|���tt��dS)z6 fun : Function {name :body} for inlinable functions. FrN)	�update�list�defs�
call_count�superr�__init__rr)�self�	__class__s ��@/usr/lib/python3/dist-packages/pythran/optimizations/inlining.pyrzInlining.__init__%sB�������F�F��	����
�h����&�&�y�'�:�:�:�:�:�c��|jp
t��t��c}|_|�|��|j|c}|_||gzS)z3 Add new variable definition before the Statement. )rr
�
generic_visit)r�node�	save_defs�new_defss    r�
visit_StmtzInlining.visit_Stmt,sP��#�y�2�D�F�F�D�F�F��	�4�9����4� � � �"�i����$�)��4�&� � rc��|j|j}t|��dk�r�tt	|����}t|tj���r�|j|j	v�r�d|_
tj|j	|j��}t��}|j}||jjt|j��t|jj��z
d�z
}t!|jj|��D]�\}}d�|j|j|j��}	t
j|	t
j��dd���}
|j�t
j|
g|d�����t
j|	t
j��dd���||j<��|xjdz
c_t5|���|jd��S|S)z~
        Replace function call by inlined function's body.

        We can inline if it aliases on only one function.
        �TNz__pythran_inline{}{}{})�id�ctx�
annotation�type_comment)�targets�valuerr)�aliases�func�len�next�iter�
isinstance�ast�FunctionDef�name�	inlinabler	�copy�deepcopy�dict�args�defaults�zip�formatrr�Name�Storer�append�Assign�Load�Inliner�visit�body)rr�func_aliases�function_def�	to_inline�arg_to_value�values�arg_fun�arg_call�v_name�new_vars           r�
visit_CallzInlining.visit_Call>s����|�D�I�.���|����!�!���\� 2� 2�3�3�L��<���9�9�
F� �%���7�7�"��� �M�$�.��9J�*K�L�L�	�#�v�v������)�.�1�#�d�i�.�.�25�i�n�6I�2J�2J�3K�3L�3L�M�M��),�Y�^�-@�&�)I�)I�
K�
K�%�G�X�5�<�<�\�=N�=D�Z�=A�_�N�N�F�"�h�&�+.�9�;�;�26�T�K�K�K�G��I�$�$�S�Z��	�6>�<@�&B�&B�&B�C�C�C�03�x�6�<?�H�J�J�CG�EI�0K�0K�0K�L���,�,����1�$����|�,�,�2�2�9�>�!�3D�E�E�E��r)�__name__�
__module__�__qualname__�__doc__rr�visit_Return�visit_Assign�visit_AugAssign�visit_Print�	visit_For�visit_While�visit_If�
visit_With�visit_Assert�
visit_ExprrC�
__classcell__�rs@rrr
s����������2;�;�;�;�;�!�!�!��L��L� �O��K��I��K��H��J��L��J�!�!�!�!�!�!�!rrc�.��eZdZdZ�fd�Zd�Zd�Z�xZS)r7z> Helper transform that performed inlined body transformation. c�d��||_tt|�����dS)z; match : {original_variable_name : Arguments use on call}. N)�matchr
r7r)rrVrs  �rrzInliner.__init__fs,�����
�
�g�t���%�%�'�'�'�'�'rc�B�|j�|j|��S)z0 Transform name from match values if available. )rV�getr�rrs  r�
visit_NamezInliner.visit_Nameks���z�~�~�d�g�t�,�,�,rc�6�|�|j��S)z% Remove return keyword after inline. )r8r rYs  rrHzInliner.visit_Returnos���z�z�$�*�%�%�%r)rDrErFrGrrZrHrRrSs@rr7r7bs\�������H�H�(�(�(�(�(�
-�-�-�&�&�&�&�&�&�&rr7)rG�pythran.analysesrr�pythran.passmanagerr�gastr'r+r�NodeTransformerr7�rr�<module>ras���'�'�/�/�/�/�/�/�/�/�.�.�.�.�.�.���������U�U�U�U�U�~�U�U�U�p&�&�&�&�&�c�!�&�&�&�&�&r

Youez - 2016 - github.com/yon3zu
LinuXploit