search for: remapfunction

Displaying 4 results from an estimated 4 matches for "remapfunction".

2018 Sep 06
2
Replacing a function from one module into another one
...ing to do, because the operation is between modules of different files, I'm guessing they have different Contexts too, what could be done in this case? Finally, I also tried moving the BasicBlocks manually and got the same error "Use still stuck..", and then tried calling llvm::RemapFunction afterwards with the populated VMap, but always got the error: Assertion `(Flags & RF_IgnoreMissingLocals) && "Referenced value not in value map!"' failed Which left me clueless since the mapping worked in the *CloneFunctionInto* (the program executed fine, the error &quo...
2018 Sep 06
2
Replacing a function from one module into another one
...en modules of different files, I'm guessing they have different >> Contexts too, what could be done in this case? >> >> Finally, I also tried moving the BasicBlocks manually and got the same >> error "Use still stuck..", and then tried >> calling llvm::RemapFunction afterwards with the populated VMap, but always >> got the error: >> >> Assertion `(Flags & RF_IgnoreMissingLocals) && "Referenced value not in >> value map!"' failed >> >> Which left me clueless since the mapping worked in the >> *...
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 ValueToValueMapTy (VMap) and I couldn't find a single complete example on the internet. To begin with, as the name implies (and also from some errors...
2018 Sep 03
2
Replacing a function from one module into another one
Thank you Ahmad, I figured out that, although the type of both p(oInst) and p(nInst) were the same, I had to: for (unsigned int i = 0; i < callOInst->getNumArgOperands(); i++) { callOInst->getArgOperand(i)->mutateType(callNInst->getArgOperand(i)->getType()); } that solves the issue at the calling instruction in the main function, but now I see that *linkModules* does not work