search for: newfuncname

Displaying 2 results from an estimated 2 matches for "newfuncname".

2018 Sep 06
2
Replacing a function from one module into another one
...llvm::SmallVector<llvm::ReturnInst*, 8> Returns; llvm::CloneFunctionInto(fOld, fNew, VMap, ModuleArg, Returns); if (fNew->hasPersonalityFn()) fOld->setPersonalityFn(llvm::MapValue(fNew->getPersonalityFn(), VMap)); } void replaceFunctions(std::string oldFuncName, std::string newFuncName) { llvm::SMDiagnostic origErr; llvm::LLVMContext origContext; std::unique_ptr<llvm::Module> origMod = (llvm::parseIRFile(originalFileName, origErr, origContext)); llvm::Module *origMod_copy = origMod.get(); llvm::SMDiagnostic refErr; llvm::LLVMContext refContext; std::unique_ptr...
2018 Sep 06
2
Replacing a function from one module into another one
Hi Philip, Thanks for the reference, I was able to follow it and copy the code that I saw necessary, but I still have some issues (references are still not updated). I created the function: void populateVMap(llvm::ValueToValueMapTy &VMap, llvm::Function *fOld, llvm::Function *fNew) { llvm::Function::arg_iterator DestI = fOld->arg_begin(); for (llvm::Function::const_arg_iterator J =