Why would *& by used in the parameters?
In a function parameter list, this parameter
IntrinsicInst *&Log2
is a reference to pointer to Value
. It means the function can modify the pointer itself, and this is seen at the caller side. In this case, that happens here:
Log2 = II;
If Log2
was not passed by reference, the above line would only have an effect in the scope of the function.
... would Op be equivalent to *&Op?
Not in this context. In a different one, yes. For example, when *
is the de-reference operator and &
is the address-of operator, then *&x
would mean "de-reference the result of applying the address-of operator to x
", that is, de-reference a pointer to x
. C++ confusingly re-uses symbols depending on context. Most of this is inherited from C. On top of that, changes to C++ should not break existing code. The easiest way to do this is to re-use symbols.