search for: refcontext

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

2018 Sep 06
2
Replacing a function from one module into another one
...Name, 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<llvm::Module> refMod(llvm::parseIRFile(referenceFileName, refErr, refContext)); llvm::Module *refMod_copy = refMod.get(); addFunction(origMod_copy, refMod_copy, newFuncName, oldFuncName); printModule(origMod_copy); std::cout << "Finish\n"; // Make s...
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 =