Hello,<br><br>I've been hung up on some issues for several weeks now, and some of them seem to stem from GetElementPtr instructions.  <br><br>Say we have a Definition: <b>%29 = getelementptr inbounds [10 x i32]* @c, i32 0, i32 %28</b><br>
<br>Now, I'd like to see the uses of that definition.  In my code, I do this twice, in slightly different ways.  This first method works and shows instructions that use %29:<br><br><b>for(Value::use_iterator useIt = defInsn->use_begin(), useIt_e = defInsn->use_end();<br>
          useIt != useIt_e; useIt++){<br>        Instruction *pUseInstr = dyn_cast<Instruction>(*useIt);  //This is the current use of the defInsn<br>}</b><br><br>However, this code later on does not work and shows the def of %29 to have no uses [not the case] (pIRI here is a data structure we've created which keeps track of defs and useBBs.  The defs part works fine.): <br>
<br><b>for (std::map<BasicBlock*, InstrRelInfo::UseInfo*>::iterator useBB_iter = pIRI->useBBs.begin();<br>           useBB_iter != pIRI->useBBs.end(); ++useBB_iter) {<br>        for (InstrRelInfo::UseInfo::iterator use_iter = (*useBB_iter).second->begin();<br>
             use_iter != (*useBB_iter).second->end(); ++use_iter) {<br>          DEBUG(dbgs() << *((*use_iter).first));<br>        }<br> }</b><br><br>As far as I can tell, this is only an issue for getelementptr instructions, so I was wondering if there's some special thing I need to do here to handle that or what.  getelementptr instructions do successfully show up in the second technique when it is the getelementptr instruction itself that has a use of some def.<br>
<br>Thanks,<br>Griffin<br>