search for: calloinst

Displaying 7 results from an estimated 7 matches for "calloinst".

Did you mean: callinst
2018 Sep 02
2
Replacing a function from one module into another one
...unc) *(the parameters of) 6. For testing purposes, both foo2 and foo3 and defined identical, same returning type, parameter's type and even the same variable's name in the IR. So after calling the *llvm::LinkerlinkModules* function, I did: 1. First attempt: 1. llvm::CallInst *callOInst = static_cast<llvm::CallInst*>(oInst); // I cast the* oInst* to a llvm::CallInst 2. callOInst->setCalledFunction(nFunc); // now *oInst* should call nFunc Error: Call parameter type does not match function signature! %0 = load i32, i32* %a, align 4 i32 %call1 = call i32 @foo3(i32 %0...
2018 Sep 03
2
Replacing a function from one module into another one
Thank you Ahmad, I figured out that, although the type of both p(oInst) and p(nInst) were the same, I had to: for (unsigned int i = 0; i < callOInst->getNumArgOperands(); i++) { callOInst->getArgOperand(i)->mutateType(callNInst->getArgOperand(i)->getType()); } that solves the issue at the calling instruction in the main function, but now I see that *linkModules* does not work for me (it's a mess to bring all the other unnece...
2018 Sep 02
2
Replacing a function from one module into another one
...oo3 and defined identical, >> same returning type, parameter's type and even the same variable's name in >> the IR. >> >> So after calling the *llvm::LinkerlinkModules* function, I did: >> >> 1. First attempt: >> >> 1. llvm::CallInst *callOInst = static_cast<llvm::CallInst*>(oInst); >> // I cast the* oInst* to a llvm::CallInst >> 2. callOInst->setCalledFunction(nFunc); // now *oInst* should call >> nFunc >> >> Error: >> Call parameter type does not match function signature! >> %0...
2018 Sep 04
2
Replacing a function from one module into another one
...n, Sep 3, 2018 at 6:31 PM Daniel Moya via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > >> Thank you Ahmad, >> >> I figured out that, although the type of both p(oInst) and p(nInst) were >> the same, I had to: >> >> for (unsigned int i = 0; i < callOInst->getNumArgOperands(); i++) { >> callOInst->getArgOperand(i)->mutateType(callNInst->getArgOperand(i)->getType()); >> } >> >> that solves the issue at the calling instruction in the main function, >> but now I see that *linkModules* does not work for me (i...
2018 Sep 06
2
Replacing a function from one module into another one
...> llvm-dev at lists.llvm.org> wrote: >>> >>>> Thank you Ahmad, >>>> >>>> I figured out that, although the type of both p(oInst) and p(nInst) >>>> were the same, I had to: >>>> >>>> for (unsigned int i = 0; i < callOInst->getNumArgOperands(); i++) { >>>> callOInst->getArgOperand(i)->mutateType(callNInst->getArgOperand(i)->getType()); >>>> } >>>> >>>> that solves the issue at the calling instruction in the main function, >>>> but now I see th...
2018 Sep 06
2
Replacing a function from one module into another one
...gt;> >>>>>> Thank you Ahmad, >>>>>> >>>>>> I figured out that, although the type of both p(oInst) and p(nInst) >>>>>> were the same, I had to: >>>>>> >>>>>> for (unsigned int i = 0; i < callOInst->getNumArgOperands(); i++) { >>>>>> callOInst->getArgOperand(i)->mutateType(callNInst->getArgOperand(i)->getType()); >>>>>> } >>>>>> >>>>>> that solves the issue at the calling instruction in the main >>&gt...
2018 Aug 27
3
Replacing a function from one module into another one
Hello LLVM Developers, I'm trying to replace a function defined in one module into another module (different files). The first issue I ran into was that llvm::Function does not have a method "moveBefore" or "moveAfter" as the llvm::BasicBlock or llvm::Instruction do, so I figured I would just move the BasicBlocks of the replacing function into the function that was being