Skip to content
  • Alyssa Rosenzweig's avatar
    nir: Use getters for nir_src::parent_* · c39896b1
    Alyssa Rosenzweig authored
    
    
    First, we need to give the parent_instr field a unique name to be able to
    replace with a helper.  We have parent_instr fields for both nir_src and
    nir_def, so let's rename nir_src::parent_instr in preparation for rework.
    
    This was done with a combination of sed and manual fix-ups.
    
    Then we use semantic patches plus manual fixups:
    
        @@
        expression s;
        @@
    
        -s->renamed_parent_instr
        +nir_src_parent_instr(s)
    
        @@
        expression s;
        @@
    
        -s.renamed_parent_instr
        +nir_src_parent_instr(&s)
    
        @@
        expression s;
        @@
    
        -s->parent_if
        +nir_src_parent_if(s)
    
        @@
        expression s;
        @@
    
        -s.renamed_parent_if
        +nir_src_parent_if(&s)
    
        @@
        expression s;
        @@
    
        -s->is_if
        +nir_src_is_if(s)
    
        @@
        expression s;
        @@
    
        -s.is_if
        +nir_src_is_if(&s)
    
    Signed-off-by: default avatarAlyssa Rosenzweig <alyssa@rosenzweig.io>
    Reviewed-by: default avatarRhys Perry <pendingchaos02@gmail.com>
    Acked-by: default avatarFaith Ekstrand <faith.ekstrand@collabora.co...>
    c39896b1