search for: haspersonalityfn

Displaying 6 results from an estimated 6 matches for "haspersonalityfn".

2015 Dec 22
5
Finding all pointers to functions
...uto &I : inst_range(F)) { for (auto &V : I.operands()) if (auto F = dyn_cast<Function>(V)) But there are other things as well, for example it seems there is something called a personality function that can be a pointer to another function, so need to add that if (F.hasPersonalityFn()) It seems there are other things called prefix data and prologue data, which are pointers to constants, which could contain pointers to functions, so would need to include those as well. Am I correct in thinking that prefix data and prologue data will not be included in the global variables lis...
2018 Sep 06
2
Replacing a function from one module into another one
...ion(oFName); fOld->dropAllReferences(); fOld->deleteBody(); llvm::ValueToValueMapTy VMap; populateVMap(VMap, fOld, fNew); bool ModuleArg = true; 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(origin...
2018 Sep 06
2
Replacing a function from one module into another one
...Mod->getFunction(oFName); fOld->dropAllReferences(); fOld->deleteBody(); llvm::ValueToValueMapTy VMap; populateVMap(VMap, fOld, fNew); bool ModuleArg = true; llvm::SmallVector<llvm::ReturnInst*, 8> Returns; llvm::CloneFunctionInto(fOld, fNew, VMap, ModuleArg, Returns); if (fNew->hasPersonalityFn()) fOld->setPersonalityFn(llvm::MapValue(fNew->getPersonalityFn(), VMap)); But after running the code, I still get the error: *Use still stuck around after Def is destroyed* Which means that the instructions moved from *fNew* still refer to the arguments of *fNew* instead of the "ma...
2015 Dec 22
4
Finding all pointers to functions
...: I.operands()) > if (auto F = dyn_cast<Function>(V)) > > But there are other things as well, for example it seems there is > something called a personality function that can be a pointer to > another function, so need to add that > > if (F.hasPersonalityFn()) > > It seems there are other things called prefix data and prologue > data, which are pointers to constants, which could contain > pointers to functions, so would need to include those as well. > > Am I correct in thinking that prefix data and prologue data will...
2020 Jan 10
2
Register Dataflow Analysis on X86
Hi Scott, Sorry for the late reply, I was out of office during the holidays. 1. A def node can reach either a use node, or another def node. In the highlighted phi node (p3224), the def (d3225) reaches another def (1598) in statement (s1597), that’s why it’s needed. 2. The reason why the def of R11 in s1578 is not connected directly to the use in s1725 is that there may be an intervening
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