U
    9%ex                     @   s   d dl Z d dlZd dlZd dlmZ d dlmZ eddddgZG dd	 d	e	Z
G d
d de ddZG dd de jZG dd de	ZG dd de	ZdS )    N)Loc)UnsupportedErrorZ
SETUP_LOOPFOR_ITER
SETUP_WITHZBEFORE_WITHc                   @   s$   e Zd Zdd Zdd Zdd ZdS )CFBlockc                 C   s"   || _ g | _i | _i | _d| _d S )NF)offsetbodyoutgoing_jumpsincoming_jumpsterminating)selfr    r   U/var/www/html/Darija-Ai-API/env/lib/python3.8/site-packages/numba/core/controlflow.py__init__   s
    zCFBlock.__init__c                 C   s    | j t| jt| jf}d| S )Nz,block(offset:%d, outgoing: %s, incoming: %s))r   sortedr	   r
   )r   argsr   r   r   __repr__   s
    zCFBlock.__repr__c                 C   s
   t | jS N)iterr   r   r   r   r   __iter__"   s    zCFBlock.__iter__N)__name__
__module____qualname__r   r   r   r   r   r   r   r      s   r   c                   @   s$   e Zd ZdZdZdd Zdd ZdS )Loopz?
    A control flow loop, as detected by a CFGraph object.
    r   c                 C   s   t |to|j| jkS r   )
isinstancer   headerr   otherr   r   r   __eq__3   s    zLoop.__eq__c                 C   s
   t | jS r   )hashr   r   r   r   r   __hash__6   s    zLoop.__hash__N)r   r   r   __doc__	__slots__r   r!   r   r   r   r   r   &   s   r   )entriesexitsr   r   c                   @   s(   e Zd ZdZdd Zdd Zdd ZdS )	_DictOfContainerszA defaultdict with customized equality checks that ignore empty values.

    Non-empty value is checked by: `bool(value_item) == True`.
    c                 C   s&   t |tr"|  }| }||kS tS r   )r   r&   _non_empty_itemsNotImplemented)r   r   ZmineZtheirsr   r   r   r   @   s
    
z_DictOfContainers.__eq__c                 C   s    |  |}|tkr|S | S d S r   )r   r(   )r   r   retr   r   r   __ne__H   s    
z_DictOfContainers.__ne__c                 C   s   dd t |  D S )Nc                 S   s   g | ]\}}|r||fqS r   r   ).0kvsr   r   r   
<listcomp>P   s      z6_DictOfContainers._non_empty_items.<locals>.<listcomp>)r   itemsr   r   r   r   r'   O   s    z"_DictOfContainers._non_empty_itemsN)r   r   r   r"   r   r*   r'   r   r   r   r   r&   :   s   r&   c                   @   s  e Zd ZdZdd Zdd ZdsddZd	d
 Zdd Zdd Z	dd Z
dd Zdd Zdd Zdd Zdd Zejdd Zejdd Zejdd  Zejd!d" Zejd#d$ Zejd%d& Zejd'd( Zejd)d* Zejd+d, Zejd-d. Zejd/d0 Zd1d2 Zd3d4 Zd5d6 Zd7d8 Z d9d: Z!d;d< Z"d=d> Z#d?d@ Z$dAdB Z%dtdDdEZ&dudFdGZ'dvdIdJZ(dwdKdLZ)dMdN Z*dxdOdPZ+dQdR Z,dSdT Z-dUdV Z.dWdX Z/dYdZ Z0d[d\ Z1dyd]d^Z2d_d` Z3dadb Z4dzdcddZ5dedf Z6dgdh Z7didj Z8dkdl Z9dmdn Z:dodp Z;dqdr Z<dS ){CFGraphzB
    Generic (almost) implementation of a Control Flow Graph.
    c                 C   s,   t  | _tt | _tt | _i | _d | _d S r   )set_nodesr&   _preds_succs
_edge_data_entry_pointr   r   r   r   r   X   s
    

zCFGraph.__init__c                 C   s   | j | dS )z
        Add *node* to the graph.  This is necessary before adding any
        edges from/to the node.  *node* can be any hashable object.
        N)r2   addr   noder   r   r   add_node_   s    zCFGraph.add_nodeNc                 C   sJ   || j krtd|| j f || j kr8td|| j f | ||| dS )z
        Add an edge from node *src* to node *dest*, with optional
        per-edge *data*.
        If such an edge already exists, it is replaced (duplicate edges
        are not possible).
        z.Cannot add edge as src node %s not in nodes %sz/Cannot add edge as dest node %s not in nodes %sN)r2   
ValueError	_add_edge)r   srcdestdatar   r   r   add_edgef   s    

zCFGraph.add_edgec                 c   s(   | j | D ]}|| j||f fV  q
dS )z
        Yield (node, data) pairs representing the successors of node *src*.
        (*data* will be None if no data was specified when adding the edge)
        N)r4   r5   )r   r=   r>   r   r   r   
successorsu   s    zCFGraph.successorsc                 c   s(   | j | D ]}|| j||f fV  q
dS )z
        Yield (node, data) pairs representing the predecessors of node *dest*.
        (*data* will be None if no data was specified when adding the edge)
        N)r3   r5   )r   r>   r=   r   r   r   predecessors}   s    zCFGraph.predecessorsc                 C   s   || j kst|| _dS )z=
        Set the entry point of the graph to *node*.
        N)r2   AssertionErrorr6   r8   r   r   r   set_entry_point   s    zCFGraph.set_entry_pointc                 C   s   | j dkrtd|   dS )z
        Compute essential properties of the control flow graph.  The graph
        must have been fully populated, and its entry point specified. Other
        graph properties are computed on-demand.
        Nzno entry point defined!)r6   RuntimeError_eliminate_dead_blocksr   r   r   r   process   s    
zCFGraph.processc                 C   s   | j S )z
        Return a dictionary of {node -> set(nodes)} mapping each node to
        the nodes dominating it.

        A node D dominates a node N when any path leading to N must go through D
        )_domsr   r   r   r   
dominators   s    zCFGraph.dominatorsc                 C   s   | j S )z
        Return a dictionary of {node -> set(nodes)} mapping each node to
        the nodes post-dominating it.

        A node P post-dominates a node N when any path starting from N must go
        through P.
        )
_post_domsr   r   r   r   post_dominators   s    zCFGraph.post_dominatorsc                 C   s   | j S )z
        Return a dictionary of {node -> node} mapping each node to its
        immediate dominator (idom).

        The idom(B) is the closest strict dominator of V
        )_idomr   r   r   r   immediate_dominators   s    zCFGraph.immediate_dominatorsc                 C   s   | j S )a.  
        Return a dictionary of {node -> set(nodes)} mapping each node to
        the nodes in its dominance frontier.

        The dominance frontier _df(N) is the set of all nodes that are
        immediate successors to blocks dominated by N but which aren't
        strictly dominated by N
        )_dfr   r   r   r   dominance_frontier   s    	zCFGraph.dominance_frontierc                 C   s   | j S )z
        return a dictionary of {node -> set(nodes)} mapping each node to
        the set of nodes it immediately dominates

        The domtree(B) is the closest strict set of nodes that B dominates
        )_domtreer   r   r   r   dominator_tree   s    zCFGraph.dominator_treec                 C   s   |   S r   )_find_exit_pointsr   r   r   r   _exit_points   s    zCFGraph._exit_pointsc                 C   s   |   S r   )_find_dominatorsr   r   r   r   rH      s    zCFGraph._domsc                 C   s   |   S r   )_find_back_edgesr   r   r   r   _back_edges   s    zCFGraph._back_edgesc                 C   s   |   S r   )_find_topo_orderr   r   r   r   _topo_order   s    zCFGraph._topo_orderc                 C   s   |   S r   )_find_descendentsr   r   r   r   _descs   s    zCFGraph._descsc                 C   s   |   S r   )_find_loopsr   r   r   r   _loops   s    zCFGraph._loopsc                 C   s   |   S r   )_find_in_loopsr   r   r   r   	_in_loops   s    zCFGraph._in_loopsc                 C   s   |   S r   )_find_post_dominatorsr   r   r   r   rJ      s    zCFGraph._post_domsc                 C   s   |   S r   )_find_immediate_dominatorsr   r   r   r   rL      s    zCFGraph._idomc                 C   s   |   S r   )_find_dominance_frontierr   r   r   r   rN      s    zCFGraph._dfc                 C   s   |   S r   )_find_dominator_treer   r   r   r   rP      s    zCFGraph._domtreec                 C   s
   | j | S )zx
        Return the set of descendents of the given *node*, in topological
        order (ignoring back edges).
        )rZ   r8   r   r   r   descendents   s    zCFGraph.descendentsc                 C   s   | j dk	st| j S )z.
        Return the entry point node.
        N)r6   rC   r   r   r   r   entry_point   s    zCFGraph.entry_pointc                 C   s   | j S )zG
        Return the computed set of exit nodes (may be empty).
        )rS   r   r   r   r   exit_points   s    zCFGraph.exit_pointsc                 C   s   | j | j S )z
        Return the set of nodes constituting the graph's backbone.
        (i.e. the nodes that every path starting from the entry point
         must go through).  By construction, it is non-empty: it contains
         at least the entry point.
        )rJ   r6   r   r   r   r   backbone  s    zCFGraph.backbonec                 C   s   | j S )z
        Return a dictionary of {node -> loop} mapping each loop header
        to the loop (a Loop instance) starting with it.
        r\   r   r   r   r   loops  s    zCFGraph.loopsc                    s    fdd j |dD S )zm
        Return the list of Loop objects the *node* belongs to,
        from innermost to outermost.
        c                    s   g | ]} j | qS r   rg   )r+   xr   r   r   r.     s     z$CFGraph.in_loops.<locals>.<listcomp>r   )r^   getr8   r   r   r   in_loops  s    zCFGraph.in_loopsc                 C   s   | j S )zK
        Return the set of dead nodes (eliminated from the graph).
        )_dead_nodesr   r   r   r   
dead_nodes  s    zCFGraph.dead_nodesc                 C   s   | j S )z/
        Return the set of live nodes.
        )r2   r   r   r   r   nodes#  s    zCFGraph.nodesc                 C   s   | j S )zb
        Return the sequence of nodes in topological order (ignoring back
        edges).
        )rX   r   r   r   r   
topo_order)  s    zCFGraph.topo_orderFc                 c   s6   t |}| j}|rt|}|D ]}||kr|V  qdS )z
        Iterate over the *nodes* in topological order (ignoring back edges).
        The sort isn't guaranteed to be stable.
        N)r1   rX   reversed)r   rn   reverseitnr   r   r   	topo_sort0  s    zCFGraph.topo_sortc                 C   s   ddl }|ptj}td|d | | td|d |j | j|d td|d |j | j|d tdt| j|d td	|d |j | j	|d td
|d |j | j
|d td|d |j |  |d dS )z3
        Dump extensive debug information.
        r   NzCFG adjacency lists:filezCFG dominators:streamzCFG post-dominators:zCFG back edges:z
CFG loops:zCFG node-to-loops:zCFG backbone:)pprintsysstdoutprint_dump_adj_listsrH   rJ   r   rV   r\   r^   rf   )r   rv   ry   r   r   r   dump=  s    

zCFGraph.dumpnumba_cfg.dotc                 C   s   zddl }W n tk
r(   tdY nX |j|d}| jD ]}|t| q<| jD ](}| j| D ]}|t|t| qdqV|S )zRender the controlflow graph with GraphViz DOT via the
        ``graphviz`` python binding.

        Returns
        -------
        g : graphviz.Digraph
            Use `g.view()` to open the graph in the default PDF application.
        r   NzcThe feature requires `graphviz` but it is not available. Please install with `pip install graphviz`)filename)graphvizImportErrorZDigraphr2   r9   strr4   edge)r   r   gvgrs   r   r   r   r   
render_dotR  s    



zCFGraph.render_dotc                 C   s2   | j | | | j| | || j||f< d S r   )r3   r7   r4   r5   )r   Zfrom_tor?   r   r   r   r<   o  s    zCFGraph._add_edgec                 C   sd   | j |dD ] }| j| | | j||f= q| j|dD ] }| j | | | j||f= q>d S )Nr   )r4   popr3   remover5   )r   r9   succpredr   r   r   _remove_node_edgesv  s    zCFGraph._remove_node_edgesc                 c   sb   |d kr| j f}t }t|}|r^| }||kr|V  || | j| D ]}|| qLqd S r   )r6   r1   listr   r7   r4   append)r   r$   seenstackr9   r   r   r   r   _dfs~  s    
zCFGraph._dfsc                 C   sJ   t  }|  D ]}|| q| j| | _|| _| jD ]}| | q6dS )zx
        Eliminate all blocks not reachable from the entry point, and
        stash them into self._dead_nodes.
        N)r1   r   r7   r2   rl   r   )r   liver9   Zdeadr   r   r   rF     s    
zCFGraph._eliminate_dead_blocksc                 C   s,   t  }| jD ]}| j|s|| q|S )z2
        Compute the graph's exit points.
        )r1   r2   r4   rj   r7   )r   re   rs   r   r   r   rR     s
    
zCFGraph._find_exit_pointsc                    sZ   | j | j g t g  fdd| jfgrV \}}|| q<S )Nc                    sN   | krJ |  j| f |  D ]}| |f kr*|f q*d S r   r7   r   r9   r>   
back_edgesdfs_rec
post_orderr   r   succsr   r   r     s    
z(CFGraph._find_postorder.<locals>.dfs_rec)r4   rV   r1   r6   r   )r   cbr?   r   r   r   _find_postorder  s    
zCFGraph._find_postorderc                    s    fdd}| j }| j}|  }dd t|D ||i |  |  d}|rd}|D ]B}t| fdd|| D }| ks | |kr\| |< d}q\qP S )	Nc                    sB   | |kr>|  | k r" |  } q|  | kr  | }q"q | S r   r   )uvidomidxr   r   	intersect  s    
z5CFGraph._find_immediate_dominators.<locals>.intersectc                 S   s   i | ]\}}||qS r   r   )r+   ier   r   r   
<dictcomp>  s      z6CFGraph._find_immediate_dominators.<locals>.<dictcomp>TFc                 3   s   | ]}| kr|V  qd S r   r   )r+   r   )r   r   r   	<genexpr>  s    z5CFGraph._find_immediate_dominators.<locals>.<genexpr>)r6   r3   r   	enumerater   rq   	functoolsreduce)r   r   entrypreds_tableorderchangedr   Znew_idomr   r   r   r`     s&    
z"CFGraph._find_immediate_dominatorsc                 C   sL   | j }tt}| D ]0\}}||kr0t ||< ||kr|| | q|S r   )rL   r&   r1   r/   r7   )r   r   Zdomtreer   r   r   r   r   rb     s    
zCFGraph._find_dominator_treec                 C   sl   | j }| j}dd |D }|D ]H}t|| dk r4q|| D ](}||| kr<|| | || }q@q<q|S )Nc                 S   s   i | ]}|t  qS r   )r1   )r+   r   r   r   r   r     s      z4CFGraph._find_dominance_frontier.<locals>.<dictcomp>   )rL   r3   lenr7   )r   r   r   Zdfr   r   r   r   r   ra     s    z CFGraph._find_dominance_frontierc           
         s  |rt | j}| j}| j}nt | jg}| j}| j}|s@tdi  |D ]}t |g |< qHg }| jD ]$}||krft | j |< || qf|r| }||krqt |g}|| }	|	r|t	
t j fdd|	D O }| | krt|t | k s t| |< |||  q S )Nz5no entry points: dominator algorithm cannot be seededc                    s   g | ]} | qS r   r   )r+   pdomsr   r   r.   #  s     z5CFGraph._find_dominators_internal.<locals>.<listcomp>)r1   rS   r4   r3   r6   rE   r2   r   r   r   r   intersectionr   rC   extend)
r   postr$   r   Zsuccs_tabler   todors   Znew_domspredsr   r   r   _find_dominators_internal  s@    



z!CFGraph._find_dominators_internalc                 C   s   | j ddS )NFr   )r   r   r   r   r   rT   *  s    zCFGraph._find_dominatorsc                 C   s   t  }| j| | j D ]"}|js|jD ]}| || q,q| jdd}||= | D ]}|	| qZ| 
| | j| |S )NTr   )objectrS   r7   r\   valuesr%   r   r<   r   discardr   r   )r   Z
dummy_exitloopbZpdomsr   r   r   r   r_   -  s    

zCFGraph._find_post_dominatorsc           
         s   |dk	r0t |ts$tdt| |dd t }g i   }t } fdd}|| d}r|d7 }d }| }|r| }	|	kr|||	f q|	|kr||	 qh  || qh|dk	r|d  |7  < |S )	zu
        Find back edges.  An edge (src, dest) is a back edge if and
        only if *dest* dominates *src*.
        Nz*stats* must be a dict; got Ziteration_countr   c                    s&    |  dd  j|  D | < d S )Nc                 S   s   g | ]}|qS r   r   )r+   r>   r   r   r   r.   [  s     z@CFGraph._find_back_edges.<locals>.push_state.<locals>.<listcomp>)r   r4   )r9   r   r   Zsuccs_stater   r   
push_stateY  s    
z,CFGraph._find_back_edges.<locals>.push_state   )	r   dict	TypeErrortype
setdefaultr1   rd   r   r7   )
r   statsr   rd   checkedr   Ziter_ctZtosZ	tos_succsZcur_noder   r   r   rU   B  s6    

zCFGraph._find_back_edgesc                    s@   | j | jg t  fdd  | j   S )Nc                    sB   | kr> |  |  D ]}| |fkr | q|  d S r   r   r   _dfs_recr   r   r   r   r   r   r     s    

z*CFGraph._find_topo_order.<locals>._dfs_rec)r4   rV   r1   r6   rq   r   r   r   r   rW   y  s    
zCFGraph._find_topo_orderc                 C   s\   i }t | jD ]H}t  ||< }| j| D ]*}||f| jkr*|| |||  q*q|S r   )rp   rX   r1   r4   rV   r7   update)r   Zdescsr9   Z
node_descsr   r   r   r   rY     s    
zCFGraph._find_descendentsc                 C   s   i }| j D ]l\}}|}t|g}|g}|rV| }||kr&|| || j|  q&||krn|| | q
|||< q
i }| D ]^\}}t }	t }
|D ],}|	| j| |  |
| j| |  qt	|||	|
d}|||< q|S )zC
        Find the loops defined by the graph's back edges.
        )r   r   r$   r%   )
rV   r1   r   r7   r   r3   r   r/   r4   r   )r   Zbodiesr=   r>   r   r   queuers   rh   r$   r%   r   r   r   r   r[     s.    



zCFGraph._find_loopsc                 C   sT   | j }tdd | jD }t| dd dD ] }|jD ]}|| |j q8q.|S )Nc                 s   s   | ]}|g fV  qd S r   r   )r+   rs   r   r   r   r     s     z)CFGraph._find_in_loops.<locals>.<genexpr>c                 S   s
   t | jS r   )r   r   )r   r   r   r   <lambda>      z(CFGraph._find_in_loops.<locals>.<lambda>)key)r\   r   r2   r   r   r   r   r   )r   rh   rk   r   rs   r   r   r   r]     s    
zCFGraph._find_in_loopsc                 C   s2   t dd | j D }dd l}|j||d d S )Nc                 s   s"   | ]\}}|t t|fV  qd S r   )r   r   )r+   r=   Zdestsr   r   r   r     s   z*CFGraph._dump_adj_lists.<locals>.<genexpr>r   rw   )r   r4   r/   ry   )r   rv   Z	adj_listsry   r   r   r   r}     s
    zCFGraph._dump_adj_listsc                 C   sB   t |tstdD ]*}t| |d }t||d }||kr dS qdS )N)r2   r5   r6   r3   r4   FT)r   r0   NotImplementedErrorgetattr)r   r   ri   thisthatr   r   r   r     s    
zCFGraph.__eq__c                 C   s   |  | S r   )r   r   r   r   r   r*     s    zCFGraph.__ne__)N)F)N)r   )N)N)F)N)=r   r   r   r"   r   r:   r@   rA   rB   rD   rG   rI   rK   rM   rO   rQ   r   cached_propertyrS   rH   rV   rX   rZ   r\   r^   rJ   rL   rN   rP   rc   rd   re   rf   rh   rk   rm   rn   ro   rt   r~   r   r<   r   r   rF   rR   r   r`   rb   ra   r   rT   r_   rU   rW   rY   r[   r]   r}   r   r*   r   r   r   r   r0   S   s   

	
		










	





(
+
7
$r0   c                   @   s   e Zd ZdZdd Zdd Zdd Zdd	 Zd0ddZdd Z	d1ddZ
dd Zdd Zdd Zdd Zdd Zdd Zdd Zd d! Zd"d# ZeZeZeZeZeZeZeZeZd$d% ZeZeZd&d' Zd(d) Z e Z!d*d+ Z"d,d- Z#d.d/ Z$d
S )2ControlFlowAnalysisz
    Attributes
    ----------
    - bytecode

    - blocks

    - blockseq

    - doms: dict of set
        Dominators

    - backbone: set of block offsets
        The set of block that is common to all possible code path.

    c                 C   sF   || _ i | _i | _g | _d | _d | _d| _d | _g | _g | _	g | _
d S NT)bytecodeblocks
liveblocksblockseqr   rf   _force_new_block	_curblock_blockstackr\   _withs)r   r   r   r   r   r     s    zControlFlowAnalysis.__init__c                 c   s   | j D ]}| j| V  qdS )z=
        Return all blocks in sequence of occurrence
        N)r   r   r   r   r   r   r   
iterblocks  s    
zControlFlowAnalysis.iterblocksc                 c   s&   | j D ]}|| jkr| j| V  qdS )zB
        Return all live blocks in sequence of occurrence
        N)r   r   r   r   r   r   r   iterliveblocks  s    

z"ControlFlowAnalysis.iterliveblocksc                 c   s2   |j  D ]"\}}|| jkr
| j| |fV  q
dS )zQ
        Yield (incoming block, number of stack pops) pairs for *block*.
        N)r
   r/   r   r   )r   blockr   popsr   r   r   incoming_blocks  s    
z#ControlFlowAnalysis.incoming_blocksNc                 C   s   | j jd d d S )Nru   )graphr~   )r   rv   r   r   r   r~     s    zControlFlowAnalysis.dumpc                    s     D ]l}d|j }t |d }|d k	r4|| q|jrt jjj|j}|jdkr\d}n
d|j }t	||dqqt
 j jdd  D ](\}} j| }|js|jsd|j|< qt }	 jD ]}
|	|
 q j D ](}
|
j D ]\}}|	|
j|| qq|	t j |	  |	 _ j D ].}
|
j D ]\}}| j| j|
j< q<q.t fdd	 j D  _t jD ]}| jkr qqtd
 j }t  } j! D ]}
 j"|
r|#|
 q||  _d S )Nzop_%s>   SETUP_FINALLYz2'try' block not supported until python3.7 or laterz$Use of unsupported opcode (%s) found)locr   r   c                 3   s   | ]}| j | fV  qd S r   )r   )r+   r   r   r   r   r   :  s   z*ControlFlowAnalysis.run.<locals>.<genexpr>zNo live block that exits!?)$
_iter_instopnamer   Zis_jumpr   r   Zfunc_idr   linenor   zipr   r   r	   r   r0   r:   r   r/   r@   r   rD   minrG   r   r
   r   rn   r   rp   rC   rf   r1   keysrk   r7   )r   instfnamefnlmsgcurZnxtZblkr   r   outr   Zlastblkrf   Zinloopblocksr   r   r   run  sR    








zControlFlowAnalysis.runr   c                 C   s   || j j|< dS )z
        Register a jump (conditional or not) to *target* offset.
        *pops* is the number of stack pops implied by the jump (default 0).
        N)r   r	   )r   targetr   r   r   r   jumpP  s    zControlFlowAnalysis.jumpc                 c   sD   | j D ]8}| |r(| | | | | jj|j |V  qd S r   )r   _use_new_block_guard_with_as_start_new_blockr   r   r   r   r   r   r   r   r   r   W  s    



zControlFlowAnalysis._iter_instc                 C   s4   |j | jjkrd}n|jtkr$d}n| j}d| _|S )NTF)r   r   labelsr   NEW_BLOCKERSr   )r   r   resr   r   r   r   _  s    
z"ControlFlowAnalysis._use_new_blockc                 C   s,   t |j| _| j| j|j< | j|j d S r   )r   r   r   r   r   r   r   r   r   r   r   j  s    z$ControlFlowAnalysis._start_new_blockc                 C   s0   |j dkr,| j|j j }|dkr,d}t|dS )zChecks if the next instruction after a SETUP_WITH is something other
        than a POP_TOP, if it is something else it'll be some sort of store
        which is not supported (this corresponds to `with CTXMGR as VAR(S)`).r   POP_TOPzGThe 'with (context manager) as (variable):' construct is not supported.N)r   r   nextr   )r   Zcurrent_instZnext_opr   r   r   r   r   o  s
    
z"ControlFlowAnalysis._guard_with_asc                 C   s<   |  }| j| | j|j|f | |j d| _d S r   )get_jump_targetr   r   r\   r   r   r   r   r   r   endr   r   r   op_SETUP_LOOP{  s
    z!ControlFlowAnalysis.op_SETUP_LOOPc                 C   s<   |  }| j| | j|j|f | |j d| _d S r   )r  r   r   r   r   r   r   r   r  r   r   r   op_SETUP_WITH  s
    z!ControlFlowAnalysis.op_SETUP_WITHc                 C   s   | j   d S r   )r   r   r   r   r   r   op_POP_BLOCK  s    z ControlFlowAnalysis.op_POP_BLOCKc                 C   s$   |  |  |  |j d| _d S r   r   r  r   r   r   r   r   r   op_FOR_ITER  s    zControlFlowAnalysis.op_FOR_ITERc                 C   s$   |  |  |  |j d| _d S r   r  r   r   r   r   _op_ABSOLUTE_JUMP_IF  s    z(ControlFlowAnalysis._op_ABSOLUTE_JUMP_IFc                 C   s(   |  |  | j |jdd d| _d S )Nr   )r   Tr  r   r   r   r   _op_ABSOLUTE_JUMP_OR_POP  s    z,ControlFlowAnalysis._op_ABSOLUTE_JUMP_OR_POPc                 C   s   |  |  d| _d S r   r   r  r   r   r   r   r   op_JUMP_ABSOLUTE  s    z$ControlFlowAnalysis.op_JUMP_ABSOLUTEc                 C   s   |  |  d| _d S r   r  r   r   r   r   op_JUMP_FORWARD  s    z#ControlFlowAnalysis.op_JUMP_FORWARDc                 C   s   d| j _d| _d S r   r   r   r   r   r   r   r   op_RETURN_VALUE  s    z#ControlFlowAnalysis.op_RETURN_VALUEc                 C   s   d| j _d| _d S r   r  r   r   r   r   op_RAISE_VARARGS  s    z$ControlFlowAnalysis.op_RAISE_VARARGSc                 C   s   |  | jd  d| _d S )Nr   T)r   r   r   r   r   r   r   op_BREAK_LOOP  s    z!ControlFlowAnalysis.op_BREAK_LOOP)N)r   )%r   r   r   r"   r   r   r   r   r~   r   r   r   r   r   r   r  r  r  r  r	  Zop_POP_JUMP_IF_FALSEZop_POP_JUMP_IF_TRUEZop_JUMP_IF_FALSEZop_JUMP_IF_TRUEZop_POP_JUMP_FORWARD_IF_FALSEZop_POP_JUMP_BACKWARD_IF_FALSEZop_POP_JUMP_FORWARD_IF_TRUEZop_POP_JUMP_BACKWARD_IF_TRUEr
  Zop_JUMP_IF_FALSE_OR_POPZop_JUMP_IF_TRUE_OR_POPr  r  Zop_JUMP_BACKWARDr  r  r  r   r   r   r   r     sD   
>


r   )collectionsr   rz   Znumba.core.irr   Znumba.core.errorsr   	frozensetr   r   r   
namedtupler   defaultdictr&   r0   r   r   r   r   r   <module>   s,           