search for: setargoperand

Displaying 8 results from an estimated 8 matches for "setargoperand".

Did you mean: getargoperand
2020 Jan 23
2
Replacing operands in a call instruction
Hello, I am trying to replace a pointer argument of a call instruction with another pointer argument( new argument value for the call instruction). What is the best way to do it? I could not find any hint/guidance on the web or LLVM manual. Thanks, -- Abid M. Malik ****************************************************** "I have learned silence from the talkative, toleration from the
2018 Aug 27
3
Replacing a function from one module into another one
...ibute (or the Attribute::AttrKind <http://llvm.org/doxygen/classllvm_1_1Attribute.html#aab7ee4b8fd1d3e7e4cea87868855e60e> ) if the function already requires the argument position. When I did a similar process to change the calling instruction in the main function, I used the functions "setArgOperand" and "getArgOperand" which worked just fine, and also the "replaceAllUsesWith", I'm looking for something similar in the case of the function's arguments and their use in the function's body. So the question is: How can I properly replace a function (in my case...
2018 Sep 02
2
Replacing a function from one module into another one
...sesWith 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->getArgOperand(i)); } //replace *p(nInst)* with *p(oInst)* 5. The same 5-6 steps as before, drop and erase Error: Call parameter type does not match function signature! %0 = load i32, i32* %a, align 4 i32 %2 = call i32 @foo3(i32 %0, i32 %1) So back to the first problem, the...
2018 Sep 02
2
Replacing a function from one module into another one
...t; 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->getArgOperand(i)); } //replace >> *p(nInst)* with *p(oInst)* >> 5. The same 5-6 steps as before, drop and erase >> >> Error: >> Call parameter type does not match function signature! >> %0 = load i32, i32* %a, align 4 >> i32 %2 = call...
2018 Sep 03
2
Replacing a function from one module into another one
...nst*>(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->getArgOperand(i)); } //replace >>>> *p(nInst)* with *p(oInst)* >>>> 5. The same 5-6 steps as before, drop and erase >>>> >>>> Error: >>>> Call parameter type does not match function signature! >>>> %0 = lo...
2018 Sep 04
2
Replacing a function from one module into another one
...allInst *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->getArgOperand(i)); } //replace >>>>>> *p(nInst)* with *p(oInst)* >>>>>> 5. The same 5-6 steps as before, drop and erase >>>>>> >>>>>> Error: >>>>>> Call parameter type does not match func...
2018 Sep 06
2
Replacing a function from one module into another one
...;>>>>> static_cast<llvm::CallInst*>(oInst); // cast both *oInst* and >>>>>>>> *nInst* >>>>>>>> 4. for (unsigned int i = 0; i < callOInst->getNumArgOperands(); >>>>>>>> i++) { callNInst->setArgOperand(i,callOInst->getArgOperand(i)); } //replace >>>>>>>> *p(nInst)* with *p(oInst)* >>>>>>>> 5. The same 5-6 steps as before, drop and erase >>>>>>>> >>>>>>>> Error: >>>>>>>>...
2018 Sep 06
2
Replacing a function from one module into another one
...// cast both *oInst* and >>>>>>>>>> *nInst* >>>>>>>>>> 4. for (unsigned int i = 0; i < >>>>>>>>>> callOInst->getNumArgOperands(); i++) { >>>>>>>>>> callNInst->setArgOperand(i,callOInst->getArgOperand(i)); } //replace >>>>>>>>>> *p(nInst)* with *p(oInst)* >>>>>>>>>> 5. The same 5-6 steps as before, drop and erase >>>>>>>>>> >>>>>>>>>> Error:...