[LLVMdev] Changing pointer addresses in Transform pass

Prem Anand prem.iamme at gmail.com
Fri Jul 31 01:29:20 PDT 2015


Hi,

I have the following code and I want to update the pointers via LLVM
during the transformation pass. Assume I work on FunctionPass level
and need to append logic on runOnFunction(). Assume I also know the
pointers that needs to be changed, before hand (in this example namely
A and B)

Can anyone give me pointers on how to go about achieving this ?


Original code logic:

char A[100];
char B[100];

..
..
func () {

A[1] = 1;
A[99] = 99;
}

A needs to be updated to B after transformation pass.

Modified Code logic:

func () {
B[1] = 1;
B[99] 99;
}


Thanks,
Prem



More information about the llvm-dev mailing list