search for: nmod

Displaying 3 results from an estimated 3 matches for "nmod".

Did you mean: mod
2018 Sep 06
2
Replacing a function from one module into another one
...llvm::Function::arg_iterator DestI = fOld->arg_begin(); for (llvm::Function::const_arg_iterator J = fNew->arg_begin(); J != fNew->arg_end(); ++J) { DestI->setName(J->getName()); VMap[&*J] = &*DestI++; } void addFunction(llvm::Module *oMod, llvm::Module *nMod, std::string nFName, std::string oFName) { llvm::Function *fNew = nMod->getFunction(nFName); llvm::Function *fOld = oMod->getFunction(oFName); fOld->dropAllReferences(); fOld->deleteBody(); llvm::ValueToValueMapTy VMap; populateVMap(VMap, fOld, fNew); bool ModuleArg = tr...
2018 Sep 06
2
Replacing a function from one module into another one
...tor DestI = fOld->arg_begin(); for (llvm::Function::const_arg_iterator J = fNew->arg_begin(); J != fNew->arg_end(); ++J) { DestI->setName(J->getName()); VMap[&*J] = &*DestI++; } } The same as in *CloneModule*, then I have this code: llvm::Function *fNew = nMod->getFunction(nFName); llvm::Function *fOld = oMod->getFunction(oFName); fOld->dropAllReferences(); fOld->deleteBody(); llvm::ValueToValueMapTy VMap; populateVMap(VMap, fOld, fNew); bool ModuleArg = true; llvm::SmallVector<llvm::ReturnInst*, 8> Returns; llvm::CloneFunctionInto(fO...
2018 Sep 04
2
Replacing a function from one module into another one
Hi Philip, Thank you very much for your answer, the vector declaration example worked. I'm pretty sure the ValueToValueMapTy is the last thing I need because I even saw there is another function that could help me llvm*:*:RemapFunction <http://llvm.org/doxygen/namespacellvm.html#addf0183e92893bdbcde00fc9091dda93>; but my problem is that I don't know how to populate the