search for: callninst

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

Did you mean: callinst
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 unnecessary functions from the reference module) so what I need is to directly move one functi...
2018 Sep 02
2
Replacing a function from one module into another one
...nstructions in oldModule, which in my case are actually defined the same (but apparently the references don't change based on the name being the same in both modules). 3. Third attempt: 1. The same 1-4 steps as before, from cloning instruction to replaceAllUsesWith 2. llvm::CallInst *callNInst = static_cast<llvm::CallInst*>(nCloneInst); 3. llvm::CallInst *callOInst = static_cast<llvm::CallInst*>(oInst); // cast both *oInst* and *nInst* 4. for (unsigned int i = 0; i < callOInst->getNumArgOperands(); i++) { callNInst->setArgOperand(i,callOInst->getArgOpe...
2018 Sep 02
2
Replacing a function from one module into another one
...me (but >> apparently the references don't change based on the name being the same in >> both modules). >> >> 3. Third attempt: >> >> 1. The same 1-4 steps as before, from cloning instruction to >> replaceAllUsesWith >> 2. llvm::CallInst *callNInst = >> static_cast<llvm::CallInst*>(nCloneInst); >> 3. llvm::CallInst *callOInst = static_cast<llvm::CallInst*>(oInst); >> // cast both *oInst* and *nInst* >> 4. for (unsigned int i = 0; i < callOInst->getNumArgOperands(); i++) >> { callN...
2018 Sep 04
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 unnecessary functions from the reference module) s...
2018 Sep 06
2
Replacing a function from one module into another one
...; >>>> 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 unnecessar...
2018 Sep 06
2
Replacing a function from one module into another one
...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...
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