Displaying 2 results from an estimated 2 matches for "getinstridvalue".
2009 Jun 18
2
[LLVMdev] Referring to an argument in another function
...to pass it to foo...
if (isCallToFree(&I)) {
Value* P;
if (Function *F = I.getCalledFunction()) {
Function::arg_iterator ait = F->arg_begin();
if (ait) {
P = &(*ait);
}
createCallInst(mem_fcall, &I, 3, getOpcodeValue(I),
getInstrIDValue(), P);
}
}
createCallInst is my own wrapper. The error thrown during the pass is:
"Referring to an argument in another function!"
Any suggestions?
Thanks,
Scott
2009 Jun 18
0
[LLVMdev] Referring to an argument in another function
...CallSite CS(&I);
CallSite::arg_iterator ait = CS.arg_begin(), aend = CS.arg_end();
> if (ait) {
You want
if (ait != aend) {
here.
> P = &(*ait);
> }
> createCallInst(mem_fcall, &I, 3, getOpcodeValue(I),
> getInstrIDValue(), P);
> }
> }
>
> createCallInst is my own wrapper. The error thrown during the pass is:
>
> "Referring to an argument in another function!"
>
> Any suggestions?