Ë
    øÇ:j+  ã                   ó  — d dl Z d dlmZmZmZmZmZmZmZm	Z	m
Z
mZmZmZ d dlmZmZmZ ej$                  j&                   dd„Zd„ Z G d„ dej,                  «      Z G d„ d	ej,                  «      Zej2                  ej4                  e ee«      gej$                  j6                  _        ej:                  ej$                  j6                  _        ej:                  ej2                   ee«      gej$                  j>                  _        eej$                  j>                  _        ej:                  ej2                  gej$                  j@                  _        ej:                  ejB                  egej$                  jD                  _        ej:                  gej$                  jF                  _        ej:                  gej$                  jH                  _        ejJ                  ej$                  jH                  _        g ej$                  jL                  _        eej$                  jL                  _        ej:                  egej$                  jN                  _        eej$                  jN                  _        ej:                  egej$                  jP                  _        eej$                  jP                  _        ej:                  ejR                  gej$                  jT                  _         G d
„ de«      Z+ e	de ee+«      «      Z, e	de ee+«      «      Z- e,ej\                  «      Z/ e-ej`                  «      Z1e,e-egej$                  jd                  _        ejf                  ej$                  jd                  _        ejf                  gej$                  jh                  _        ej:                  ejf                  gej$                  jj                  _        eej$                  jl                  _        eegej$                  jl                  _        y)é    N)ÚPOINTERÚc_char_pÚc_boolÚc_void_pÚc_intÚc_uint64Úc_size_tÚ	CFUNCTYPEÚ	string_atÚcastÚ	py_objectÚ	Structure)ÚffiÚtargetsÚobject_filec                 ó  — |€t        j                  «       dv }t        j                  «       5 }t        j                  j                  | |||«      }|st        t        |«      «      ‚	 ddd«       d|_        t        | ¬«      S # 1 sw Y   ŒxY w)a  
    Create a MCJIT ExecutionEngine from the given *module* and
    *target_machine*.

    *lmm* controls whether the llvmlite memory manager is used. If not supplied,
    the default choice for the platform will be used (``True`` on 64-bit ARM
    systems, ``False`` otherwise).
    N)Úarm64Úaarch64T)Úmodule)
ÚplatformÚmachiner   ÚOutputStringÚlibÚLLVMPY_CreateMCJITCompilerÚRuntimeErrorÚstrÚ_ownedÚExecutionEngine)r   Útarget_machineÚuse_lmmÚouterrÚengines        úu/home/mcse/projects/srt_converter/srt-converter-venv/lib/python3.12/site-packages/llvmlite/binding/executionengine.pyÚcreate_mcjit_compilerr$      s‹   € ð €Ü×"Ñ"Ó$Ð(<Ð<ˆä	×	Ñ	Ó	ð ,˜vÜ—‘×3Ñ3Ø�N G¨Vó5ˆáÜœs 6›{Ó+Ð+ð ÷,ð !€NÔÜ˜6¨&Ô1Ð1÷,ð ,ús   ­9BÂBc                  ób   — t         j                  j                  «       } | dk7  rt        | d«      ‚y)zp
    Check the system allows execution of in-memory JITted functions.
    An exception is raised otherwise.
    r   z‚cannot allocate executable memory. This may be due to security restrictions on your system, such as SELinux or similar mechanisms.N)r   r   Ú"LLVMPY_TryAllocateExecutableMemoryÚOSError)Úerrnos    r#   Úcheck_jit_executionr)   #   s7   € ô
 �G‰G×6Ñ6Ó8€EØ�‚zÜ�eðGóð 	ð ó    c                   ó†   — e Zd ZdZdZd„ Zd„ Zd„ Zd„ Zd„ Z	d„ Z
d	„ Zd
„ Zd„ Zed„ «       Zd„ Zd„ Zd„ Zdd„Zd„ Zd„ Zd„ Zy)r   z­An ExecutionEngine owns all Modules associated with it.
    Deleting the engine will remove all associated modules.
    It is an error to delete the associated modules.
    Nc                 ó‚   — t        |g«      | _        d| _        d|_        t        j
                  j                  | |«       y)z;
        Module ownership is transferred to the EE
        NT)ÚsetÚ_modulesÚ_tdr   r   Ú	ObjectRefÚ__init__)ÚselfÚptrr   s      r#   r1   zExecutionEngine.__init__8   s3   € ô ˜V˜H›ˆŒØˆŒØˆŒÜ�‰×Ñ˜t SÕ)r*   c                 ó`   — t         j                  j                  | |j                  d«      «      S )z›
        Return the address of the function named *name* as an integer.

        It's a fatal error in LLVM if the symbol of *name* doesn't exist.
        Úascii)r   r   ÚLLVMPY_GetFunctionAddressÚencode©r2   Únames     r#   Úget_function_addressz$ExecutionEngine.get_function_addressA   s$   € ô �w‰w×0Ñ0°°t·{±{À7Ó7KÓLÐLr*   c                 ó`   — t         j                  j                  | |j                  d«      «      S )zŸ
        Return the address of the global value named *name* as an integer.

        It's a fatal error in LLVM if the symbol of *name* doesn't exist.
        r5   )r   r   ÚLLVMPY_GetGlobalValueAddressr7   r8   s     r#   Úget_global_value_addressz(ExecutionEngine.get_global_value_addressI   s$   € ô �w‰w×3Ñ3°D¸$¿+¹+ÀgÓ:NÓOÐOr*   c                 óF   — t         j                  j                  | ||«       y ©N)r   r   ÚLLVMPY_AddGlobalMapping)r2   ÚgvÚaddrs      r#   Úadd_global_mappingz"ExecutionEngine.add_global_mappingQ   s   € Ü�‰×'Ñ'¨¨b°$Õ7r*   c                 óº   — || j                   v rt        d«      ‚t        j                  j	                  | |«       d|_        | j                   j                  |«       y)zL
        Ownership of module is transferred to the execution engine
        z#module already added to this engineTN)r.   ÚKeyErrorr   r   ÚLLVMPY_AddModuler   Úadd)r2   r   s     r#   Ú
add_modulezExecutionEngine.add_moduleT   sI   € ð �T—]‘]Ñ"ÜÐ@ÓAÐAÜ�‰× Ñ   vÔ.ØˆŒØ�‰×Ñ˜&Õ!r*   c                 óB   — t         j                  j                  | «       y)z}
        Make sure all modules owned by the execution engine are fully processed
        and "usable" for execution.
        N)r   r   ÚLLVMPY_FinalizeObject©r2   s    r#   Úfinalize_objectzExecutionEngine.finalize_object^   s   € ô
 	�‰×%Ñ% dÕ+r*   c                 óB   — t         j                  j                  | «       y)zW
        Run static constructors which initialize module-level static objects.
        N)r   r   ÚLLVMPY_RunStaticConstructorsrK   s    r#   Úrun_static_constructorsz'ExecutionEngine.run_static_constructorse   s   € ô 	�‰×,Ñ,¨TÕ2r*   c                 óB   — t         j                  j                  | «       y)zh
        Run static destructors which perform module-level cleanup of static
        resources.
        N)r   r   ÚLLVMPY_RunStaticDestructorsrK   s    r#   Úrun_static_destructorsz&ExecutionEngine.run_static_destructorsk   s   € ô
 	�‰×+Ñ+¨DÕ1r*   c                 ó  — t        j                  «       5 }t         j                  j                  | ||«      rt	        t        |«      «      ‚	 ddd«       | j                  j                  |«       d|_        y# 1 sw Y   Œ,xY w)z1
        Ownership of module is returned
        NF)	r   r   r   ÚLLVMPY_RemoveModuler   r   r.   Úremover   )r2   r   r!   s      r#   Úremove_modulezExecutionEngine.remove_moduler   sm   € ô ×ÑÓð 	0 6Ü�w‰w×*Ñ*¨4°¸Ô@Ü"¤3 v£;Ó/Ð/ð A÷	0ð 	�‰×Ñ˜VÔ$Øˆ�÷		0ð 	0ús   •6A7Á7B c                 óÞ   — | j                   �| j                   S t        j                  j                  | «      }t	        j
                  |«      | _         d| j                   _        | j                   S )z;
        The TargetData for this execution engine.
        T)r/   r   r   Ú#LLVMPY_GetExecutionEngineTargetDatar   Ú
TargetDatar   )r2   r3   s     r#   Útarget_datazExecutionEngine.target_data|   sQ   € ð
 �8‰8ÐØ—8‘8ˆOÜ�g‰g×9Ñ9¸$Ó?ˆÜ×%Ñ% cÓ*ˆŒØˆ�‰ŒØ�x‰xˆr*   c                 óD   — t         j                  j                  | «      }|S )z 
        Enable JIT events for profiling of generated code.
        Return value indicates whether connection to profiling tool
        was successful.
        )r   r   ÚLLVMPY_EnableJITEvents)r2   Úrets     r#   Úenable_jit_eventsz!ExecutionEngine.enable_jit_eventsˆ   s   € ô �g‰g×,Ñ,¨TÓ2ˆØˆ
r*   c                 ó°   — t        |t        «      j                  }| j                  D ]-  }t        |j                  t        «      j                  |k(  sŒ+|c S  y)zH
        Find the ModuleRef corresponding to the given pointer.
        N)r   r   Úvaluer.   Ú_ptr)r2   Ú
module_ptrr3   r   s       r#   Ú_find_module_ptrz ExecutionEngine._find_module_ptr‘   sL   € ô �:œxÓ(×.Ñ.ˆØ—m‘mò 	ˆFÜ�F—K‘K¤Ó*×0Ñ0°CÓ7Ø’ð	ð r*   c                 ó¢   — t        |t        «      rt        j                  j	                  |«      }t
        j                  j                  | |«       y)z�
        Add object file to the jit. object_file can be instance of
        :class:ObjectFile or a string representing file system path
        N)Ú
isinstancer   r   ÚObjectFileRefÚ	from_pathr   r   ÚLLVMPY_MCJITAddObjectFile)r2   Úobj_files     r#   Úadd_object_filezExecutionEngine.add_object_file›   s8   € ô
 �h¤Ô$Ü"×0Ñ0×:Ñ:¸8ÓDˆHä�‰×)Ñ)¨$°Õ9r*   c                 ó”   — || _         || _        t        | «      | _        t        j
                  j                  | | j                  «       y)z~
        Set the object cache "notifyObjectCompiled" and "getBuffer"
        callbacks to the given Python functions.
        N)Ú_object_cache_notifyÚ_object_cache_getbufferÚ_ObjectCacheRefÚ_object_cacher   r   ÚLLVMPY_SetObjectCache)r2   Únotify_funcÚgetbuffer_funcs      r#   Úset_object_cachez ExecutionEngine.set_object_cache¥   s=   € ð
 %0ˆÔ!Ø'5ˆÔ$ä,¨TÓ2ˆÔô 	�‰×%Ñ% d¨D×,>Ñ,>Õ?r*   c                 ó   — | j                   €y|j                  j                  }|j                  j                  }|j                  j                  }t        ||«      }| j                  |«      }|€t        d|›�«      ‚| j                  ||«       y)z(
        Low-level notify hook.
        Nú3object compilation notification for unknown module )rl   Úcontentsrb   Úbuf_ptrÚbuf_lenr   rc   r   )r2   Údatarb   rw   rx   Úbufr   s          r#   Ú_raw_object_cache_notifyz(ExecutionEngine._raw_object_cache_notify²   s‹   € ð ×$Ñ$Ð,ØØ—]‘]×-Ñ-ˆ
Ø—-‘-×'Ñ'ˆØ—-‘-×'Ñ'ˆÜ˜ Ó)ˆØ×&Ñ& zÓ2ˆØˆ>õ Ù:Dð Gó Hð Hà×!Ñ! &¨#Õ.r*   c                 ó<  — | j                   €y|j                  j                  }| j                  |«      }|€t	        d|›�«      ‚| j                  |«      }|�Et
        j                  j                  |t        |«      «      |d   _	        t        |«      |d   _
        yy)z+
        Low-level getbuffer hook.
        Nru   r   )rm   rv   rb   rc   r   r   r   ÚLLVMPY_CreateByteStringÚlenrw   rx   )r2   ry   rb   r   rz   s        r#   Ú_raw_object_cache_getbufferz+ExecutionEngine._raw_object_cache_getbufferÄ   sœ   € ð ×'Ñ'Ð/ØØ—]‘]×-Ñ-ˆ
Ø×&Ñ& zÓ2ˆØˆ>õ Ù:Dð Gó Hð Hð ×*Ñ*¨6Ó2ˆØˆ?ä!Ÿg™g×=Ñ=¸cÄ3ÀsÃ8ÓLˆD�‰GŒOÜ! #›hˆD�‰G�Oð r*   c                 ó
  — | j                   D ]  }|j                  «        Œ | j                  �| j                  j                  «        | j                   j                  «        d | _        | j
                  j                  | «       y r?   )r.   Údetachr/   Úclearro   Ú_capiÚLLVMPY_DisposeExecutionEngine)r2   Úmods     r#   Ú_disposezExecutionEngine._disposeØ   s`   € à—=‘=ò 	ˆCØ�J‰J�Lð	à�8‰8ÐØ�H‰H�O‰OÔØ�‰×ÑÔØ!ˆÔØ�
‰
×0Ñ0°Õ6r*   )NN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ro   r1   r:   r=   rC   rH   rL   rO   rR   rV   ÚpropertyrZ   r^   rc   rj   rs   r{   r   r†   © r*   r#   r   r   1   su   „ ñð €Mò*òMòPò8ò"ò,ò3ò2òð ñ	ó ð	òòò:ó@ò/ò$'ó(7r*   r   c                   ó   — e Zd ZdZd„ Zd„ Zy)rn   zN
    Internal: an ObjectCache instance for use within an ExecutionEngine.
    c                 ó–   — t         j                  j                  t        t        |«      }t         j
                  j                  | |«       y r?   )r   r   ÚLLVMPY_CreateObjectCacheÚ_notify_c_hookÚ_getbuffer_c_hookr0   r1   )r2   Úobjr3   s      r#   r1   z_ObjectCacheRef.__init__è   s4   € Ü�g‰g×.Ñ.¬~Ü/@Ø/2ó4ˆô 	�‰×Ñ˜t SÕ)r*   c                 ó:   — | j                   j                  | «       y r?   )rƒ   ÚLLVMPY_DisposeObjectCacherK   s    r#   r†   z_ObjectCacheRef._disposeî   s   € Ø�
‰
×,Ñ,¨TÕ2r*   N)r‡   rˆ   r‰   rŠ   r1   r†   rŒ   r*   r#   rn   rn   ã   s   „ ñò*ó3r*   rn   c                   ó6   — e Zd Zdej                  fdefdefgZy)Ú_ObjectCacheDatarb   rw   rx   N)r‡   rˆ   r‰   r   ÚLLVMModuleRefr   r	   Ú_fields_rŒ   r*   r#   r–   r–   *  s'   „ à	�s×(Ñ(Ð)Ø	�HÐØ	�HÐð�Hr*   r–   r?   )7r   Úctypesr   r   r   r   r   r   r	   r
   r   r   r   r   Úllvmlite.bindingr   r   r   r   ÚLLVMPY_LinkInMCJITr$   r)   r0   r   rn   r—   ÚLLVMTargetMachineRefr   ÚargtypesÚLLVMExecutionEngineRefÚrestyperT   rF   ÚLLVMValueRefr@   rJ   rX   ÚLLVMTargetDataRefr&   r6   r<   ÚLLVMObjectFileRefrh   r–   Ú_ObjectCacheNotifyFuncÚ_ObjectCacheGetBufferFuncr{   r�   r   r‘   r�   ÚLLVMObjectCacheRefr”   rp   r}   rŒ   r*   r#   ú<module>r¦      sa  ðÛ ÷*÷ *÷ *ó *÷ 7Ñ 6ð ‡�× Ò ó2ò,ôo7�c—m‘mô o7ôd3�c—m‘mô 3ð( ×ÑØ×ÑØ
ÙˆHÓð	/€‡�× "Ñ "Ô +ð .1×-GÑ-G€‡�× "Ñ "Ô *ð ×ÑØ×ÑÙˆHÓð(€‡�× Ñ Ô $ð
 '-€‡�× Ñ Ô #ð ×ÑØ×Ñð%€‡�× Ñ Ô !ð
 -0×,FÑ,FØ,/×,<Ñ,<Ø,4ð,6€‡�× Ñ Ô (ð +.×*DÑ*DÐ)E€‡�× Ñ Ô &ð ×Ñð8€‡�× +Ñ +Ô 4ð 7:×6KÑ6K€‡�× +Ñ +Ô 3à68€‡�× *Ñ *Ô 3Ø5:€‡�× *Ñ *Ô 2ð ×ÑØð.€‡�× !Ñ !Ô *ð -5€‡�× !Ñ !Ô )ð ×ÑØð1€‡�× $Ñ $Ô -ð 08€‡�× $Ñ $Ô ,ð ×ÑØ×Ñð.€‡�× !Ñ !Ô *ô�yô ñ # 4¨Ù#*Ð+;Ó#<ó>Ð á% d¨IÙ&-Ð.>Ó&?óAÐ ñ (Ø×,Ñ,ó.€á-Ø×/Ñ/ó1Ð ð .DØ-FØ-6ð-8€‡�×  Ñ  Ô )ð ,/×+AÑ+A€‡�×  Ñ  Ô (à.1×.DÑ.DÐ-E€‡�× !Ñ !Ô *à*-×*DÑ*DØ*-×*@Ñ*@ð*B€‡�× Ñ Ô &ð +3€‡�× Ñ Ô 'Ø,4°hÐ+?€‡�× Ñ Õ (r*   