Here I am trying to replace function A with function B. The difference between them is like below:
void A(self-type a) void B(self-type &a)
But in LLVM IR, I can see the signatures of them are like
void A(i8 * ) void B(i8 **)
So, if I want to replace function A with B, I need to get the argument of callInst about A and turn it into the type of
i8 **, what should I do to get the right argument of function B(value and type)?
Because I am a little confused that why a reference will work like a nested pointer? This is supposed to be done by compiler in a way that programmer cannot see and modify. If I insert a instruction to get the address of run-time argument in A, and set it as the value of run-time argument of function B, it may not work like a reference but like a truly pointer.
Any answer or discussion will be highly appreciated, thank you!