Wondering through the LLVM source code i stumbled upon this line of code
MachineInstr *MI = &*I;
I am kinda newb in c++ and the difference between references and pointers is quite obscure to me, and I think that it has something to do about this difference, but this operation makes no sense to me. Does anybody have an explanation for doing that?
The type of
Iis probably some sort of iterator or smart pointer which has the unaryoperator*()overloaded to yield aMachineInstr&. If you want to get a built-in pointer to the object referenced byIyou get a reference to the object using*Iand then you take the address of this reference, using&*I.