Displaying 3 results from an estimated 3 matches for "replaceusesofwithafter".
2013 Nov 05
0
[LLVMdev] Identifying the instructions that uses a pointer used as a function argument
...t it, try understanding it, and see if it helps you out.
You might have to change it a bit since you're replacing uses after an
instruction and not a basic block.
Replace the "auto"s with the iterator types if you're not using C++0x.
Also, sorry for the lack of comments. : )
void replaceUsesOfWithAfter(Value *V, Value *R, BasicBlock *BB) {
set<Instruction*> Replace;
for (auto UI = V->use_begin(), UE = V->use_end(); UI != UE; ++UI)
if (Instruction *I = dyn_cast<Instruction>(*UI)) {
if (I != R && DT_->dominates(BB, I->getParent()))
Replace.inser...
2013 Nov 05
2
[LLVMdev] Identifying the instructions that uses a pointer used as a function argument
Hello all;
So here is my goal:
*** If there is a Call instruction to myFunction(int * val), I need to
identify all the instructions that uses val in the IR and replace the
uses with a newly created pointer. I will also be changing the
argument of myFunction to the new pointer.
int * val = malloc/calloc;
...
myFunction(val);
....
*val = 45;
becomes==
int * val = malloc/calloc;
int * val1 =
2013 Nov 05
1
[LLVMdev] Identifying the instructions that uses a pointer used as a function argument
...nd see if it helps you out.
> You might have to change it a bit since you're replacing uses after an
> instruction and not a basic block.
> Replace the "auto"s with the iterator types if you're not using C++0x.
> Also, sorry for the lack of comments. : )
>
> void replaceUsesOfWithAfter(Value *V, Value *R, BasicBlock *BB) {
> set<Instruction*> Replace;
> for (auto UI = V->use_begin(), UE = V->use_end(); UI != UE; ++UI)
> if (Instruction *I = dyn_cast<Instruction>(*UI)) {
> if (I != R && DT_->dominates(BB, I->getParent()))
&...