When not destroying the source, the linker is not remapping the types. Added support

to CloneFunctionInto to allow remapping for this case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147217 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Mon P Wang
2011-12-23 02:18:32 +00:00
parent cf985924fb
commit d24397a931
3 changed files with 9 additions and 6 deletions

View File

@@ -890,7 +890,7 @@ void ModuleLinker::linkFunctionBody(Function *Dst, Function *Src) {
} else {
// Clone the body of the function into the dest function.
SmallVector<ReturnInst*, 8> Returns; // Ignore returns.
CloneFunctionInto(Dst, Src, ValueMap, false, Returns);
CloneFunctionInto(Dst, Src, ValueMap, false, Returns, "", NULL, &TypeMap);
}
// There is no need to map the arguments anymore.