And I have an Instruction *inst that is the instruction on line 22.
then have the code:
Use *operand1 = &(inst->getOperandUse(0));
I expect that operand1->getNext() will return the the Use* for %tmp in the instruction on line 24. However, what I get is a null pointer. Why is this exactly? I feel I'm not understanding the point of the Use if I can't even see the very next usage only 2 instructions away.
And I have an Instruction *inst that is the instruction on line 22.
then have the code:
Use *operand1 =&(inst->getOperandUse(0));
I expect that operand1->getNext() will return the the Use* for %tmp in
the instruction on line 24.
aren't you assuming that the Use list is ordered in the same order as the
instructions in the basic block? What if line 24 is the first use, and
line 22 is the second use?