<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hi, just a remark in your code below<br>
    </p>
    <blockquote
cite="mid:CAH=eYDCn=FjJ4tjLYeJ+HgvDzDV+V5khUSPo=pptLYSxYCDGwg@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div class="gmail_extra">
            <div class="gmail_quote">
              <blockquote class="gmail_quote" style="margin:0 0 0
                .8ex;border-left:1px #ccc solid;padding-left:1ex">
                <div dir="ltr">
                  <div class="gmail_extra">
                    <div class="gmail_quote">
                      <blockquote class="gmail_quote" style="margin:0px
                        0px 0px
0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid">
                        <div>
                          <div class="h5">
                            <div dir="ltr">How to check in the
                              instruction, whether the operand is a
                              structure or not <br>
                              <br>
                              <pre style="color:rgb(0,0,0);font-family:"DejaVu Sans Mono";font-size:9pt;background-color:rgb(255,255,255)"><span style="color:rgb(0,0,128);font-weight:bold">if</span>(isa<<span style="color:rgb(0,128,128)">GetElementPtrInst</span>>(inst<wbr>ruction))
{
<span style="color:rgb(0,128,128)">GetElementPtrInst </span>*getElementPtrInst=dyn_cast<<span style="color:rgb(0,128,128)">Ge<wbr>tElementPtrInst</span>>(&instruction)<wbr>;
</pre><pre style="color:rgb(0,0,0);font-family:"DejaVu Sans Mono";font-size:9pt;background-color:rgb(255,255,255)">//check if getElemetPtrInst operands structure or array.

}
</pre></div></div></div></blockquote></div></div></div></blockquote></div></div></div></div></blockquote>dyn_cast does the job of isa already (and the job of cast if isa is true), here you better do this directly:

<pre style="color:rgb(0,0,0);font-family:"DejaVu Sans Mono";font-size:9pt;background-color:rgb(255,255,255)"><span style="color:rgb(0,0,128);font-weight:bold">if</span>( <span style="color:rgb(0,128,128)">GetElementPtrInst </span>*GEP = dyn_cast<<span style="color:rgb(0,128,128)">Ge<wbr>tElementPtrInst</span>>(&instruction) ) {
        // processing on GEP
}
</pre>And beware of your isa: it should operate on a pointer to an instruction, not the instruction instance itself (just like for dyn_cast).

Hope that helps,
Pierre
</body></html>