Displaying 2 results from an estimated 2 matches for "refmod".
2018 Sep 06
2
Replacing a function from one module into another one
...tic 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 sure the program finished
}
int main() {
std...
2018 Sep 06
2
Replacing a function from one module into another one
...*llvm::SmallVectorImpl<
>>>> llvm::ReturnInst *> &Returns *argument for the *CloneFunctionInto, *can
>>>> anyone please give an example of use of that function? I guess that's the
>>>> only way because otherwise if I move the blocks from foo3 in the refModule
>>>> to the oldModule, the references of the moved block still point to the
>>>> arguments of foo3 defined in the refModule, and I don't know how to go
>>>> instruction by instruction in all the moved blocks and correct the
>>>> reference to po...