U
    ,dpw                     @   s   d dl Z d dlZd dlZd dlmZ d dlmZ d dlmZ e	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)utils)Loc)UnsupportedErrorZ
SETUP_LOOPFOR_ITER
SETUP_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   :/tmp/pip-unpacked-wheel-eu7e0c37/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__2   s    zLoop.__eq__c                 C   s
   t | jS r   )hashr   r   r   r   r   __hash__5   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__G   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>O   s      z6_DictOfContainers._non_empty_items.<locals>.<listcomp>)r   itemsr   r   r   r   r(   N   s    z"_DictOfContainers._non_empty_itemsN)r   r   r   r#   r    r+   r(   r   r   r   r   r'   9   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   W   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)r3   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)r3   
ValueError	_add_edge)r   srcdestdatar   r   r   add_edgee   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)r5   r6   )r   r>   r?   r   r   r   
successorst   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)r4   r6   )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)r3   AssertionErrorr7   r9   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!)r7   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   rI      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   rK      s    zCFGraph._post_domsc                 C   s   |   S r   )_find_immediate_dominatorsr   r   r   r   rM      s    zCFGraph._idomc                 C   s   |   S r   )_find_dominance_frontierr   r   r   r   rO      s    zCFGraph._dfc                 C   s   |   S r   )_find_dominator_treer   r   r   r   rQ      s    zCFGraph._domtreec                 C   s
   | j | S )zx
        Return the set of descendents of the given *node*, in topological
        order (ignoring back edges).
        )r[   r9   r   r   r   descendents   s    zCFGraph.descendentsc                 C   s   | j dk	st| j S )z.
        Return the entry point node.
        N)r7   rD   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).
        )rT   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.
        )rK   r7   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   rh   )r,   xr   r   r   r/     s     z$CFGraph.in_loops.<locals>.<listcomp>r   )r_   getr9   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.
        )r3   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).
        )rY   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)r2   rY   reversed)r   ro   reverseitnr   r   r   	topo_sort/  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_listsrI   rK   r   rW   r]   r_   rg   )r   rw   rz   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)ZgraphvizImportErrorZDigraphr3   r:   strr5   edge)r   r   gvgrt   r   r   r   r   
render_dotQ  s    



zCFGraph.render_dotc                 C   s2   | j | | | j| | || j||f< d S r   )r4   r8   r5   r6   )r   from_tor@   r   r   r   r=   n  s    zCFGraph._add_edgec                 C   sd   | j |dD ] }| j| | | j||f= q| j|dD ] }| j | | | j||f= q>d S )Nr   )r5   popr4   remover6   )r   r:   succpredr   r   r   _remove_node_edgesu  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   )r7   r2   listr   r8   r5   append)r   r%   seenstackr:   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)r2   r   r8   r3   rm   r   )r   Zliver:   Zdeadr   r   r   rG     s    
zCFGraph._eliminate_dead_blocksc                 C   s,   t  }| jD ]}| j|s|| q|S )z2
        Compute the graph's exit points.
        )r2   r3   r5   rk   r8   )r   rf   rt   r   r   r   rS     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   r8   r   r:   r?   
back_edgesdfs_rec
post_orderr   r   succsr   r   r     s    
z(CFGraph._find_postorder.<locals>.dfs_rec)r5   rW   r2   r7   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>)r7   r4   r   	enumerater   rr   	functoolsreduce)r   r   entrypreds_tableorderchangedr   Znew_idomr   r   r   ra     s&    
z"CFGraph._find_immediate_dominatorsc                 C   sL   | j }tt}| D ]0\}}||kr0t ||< ||kr|| | q|S r   )rM   r'   r2   r0   r8   )r   r   Zdomtreer   r   r   r   r   rc     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   )r2   )r,   r   r   r   r   r     s      z4CFGraph._find_dominance_frontier.<locals>.<dictcomp>   )rM   r4   lenr8   )r   r   r   Zdfr   r   r   r   r   rb     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>)r2   rT   r5   r4   r7   rF   r3   r   r   r   r   intersectionr   rD   extend)
r   postr%   r   Zsuccs_tabler   todort   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   rU   )  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   )objectrT   r8   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/   Z  s     z@CFGraph._find_back_edges.<locals>.push_state.<locals>.<listcomp>)r   r5   )r:   r   r   Zsuccs_stater   r   
push_stateX  s    
z,CFGraph._find_back_edges.<locals>.push_state   )	r   dict	TypeErrortype
setdefaultr2   re   r   r8   )
r   statsr   re   checkedr   Ziter_ctZtosZ	tos_succsZcur_noder   r   r   rV   A  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)r5   rW   r2   r7   rr   r   r   r   r   rX   x  s    
zCFGraph._find_topo_orderc                 C   s\   i }t | jD ]H}t  ||< }| j| D ]*}||f| jkr*|| |||  q*q|S r   )rq   rY   r2   r5   rW   r8   update)r   Zdescsr:   Z
node_descsr   r   r   r   rZ     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&   )
rW   r2   r   r8   r   r4   r   r0   r5   r   )r   Zbodiesr>   r?   r   r	   queuert   ri   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,   rt   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   r3   r   r   r	   r   r   )r   ri   rl   r   rt   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   rx   )r   r5   r0   rz   )r   rw   Z	adj_listsrz   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)r3   r6   r7   r4   r5   FT)r   r1   NotImplementedErrorgetattr)r   r   rj   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;   rA   rB   rC   rE   rH   rJ   rL   rN   rP   rR   r   cached_propertyrT   rI   rW   rY   r[   r]   r_   rK   rM   rO   rQ   rd   re   rf   rg   ri   rl   rn   ro   rp   ru   r   r   r=   r   r   rG   rS   r   ra   rc   rb   r   rU   r`   rV   rX   rZ   r\   r^   r~   r    r+   r   r   r   r   r1   R   s   

	
		










	





(
+
7
$r1   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d$d% ZeZeZd&d' Zd(d) 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   rg   _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   r0   r   r   )r   blockr   popsr   r   r   incoming_blocks  s    
z#ControlFlowAnalysis.incoming_blocksNc                 C   s   | j jd d d S )Nrv   )graphr   )r   rw   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_FINALLYSETUP_EXCEPTz2'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   9  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   r1   r;   r   r0   rA   r   rE   minrH   r   r   r   ro   r   rq   rD   rg   r2   keysrl   r8   )r   instfnamefnlmsgcurZnxtZblkr   r   outr   Zlastblkrg   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   jumpO  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   V  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   i  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   n  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_LOOPz  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_TRUEr  Zop_JUMP_IF_FALSE_OR_POPZop_JUMP_IF_TRUE_OR_POPr  r  r  r  r  r   r   r   r   r     s:   
>


r   )collectionsr   r{   Z
numba.corer   Znumba.core.irr   Znumba.core.errorsr   	frozensetr   r   r   
namedtupler   defaultdictr'   r1   r   r   r   r   r   <module>   s$        