I'm trying to write a pass that will check the control flow of a code. Given a br instruction, I need to access the basic blocks referred to in the label fields.
For example, for the code:
for(i = 0; i < count; i++){
sum = add(sum, array[i]);
}
I get the IR representation
br i1 %cmp, label %for.body, label %for.end
Now when I come across this instruction in the pass, I need to know exactly where these labels are pointing to. Can anybody please tell me how I can do that?