LLVM getBasicBlockIndex() or equivalent

Hello everyone !

I have some problems of getting the index of a basic block.

for (Function::iterator II = F.begin(), EE = F.end(); II != EE; ++II, ++ii) 
{  BasicBlock* BB=II;

I have segfaults or cannot use complex structures of several methods that I found in LLVM. Do you know how to use as simply as possible the methods found at :



Or something equivalent? I just want to get an ID of the basic blocks.

Thank you !