diff options
author | Mon P Wang <wangmp@apple.com> | 2011-12-23 02:18:32 +0000 |
---|---|---|
committer | Mon P Wang <wangmp@apple.com> | 2011-12-23 02:18:32 +0000 |
commit | d24397a9319a41e80169f572ad274a711f41d64e (patch) | |
tree | dde0055e7cdd6b08fc9e2928696bc303619f68ed /lib/Transforms/Utils | |
parent | cf985924fb73e71ed61a55a7a8dba97a8e200b3d (diff) | |
download | external_llvm-d24397a9319a41e80169f572ad274a711f41d64e.zip external_llvm-d24397a9319a41e80169f572ad274a711f41d64e.tar.gz external_llvm-d24397a9319a41e80169f572ad274a711f41d64e.tar.bz2 |
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
Diffstat (limited to 'lib/Transforms/Utils')
-rw-r--r-- | lib/Transforms/Utils/CloneFunction.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Transforms/Utils/CloneFunction.cpp b/lib/Transforms/Utils/CloneFunction.cpp index c6dfe73..6ddbed2 100644 --- a/lib/Transforms/Utils/CloneFunction.cpp +++ b/lib/Transforms/Utils/CloneFunction.cpp @@ -75,7 +75,8 @@ void llvm::CloneFunctionInto(Function *NewFunc, const Function *OldFunc, ValueToValueMapTy &VMap, bool ModuleLevelChanges, SmallVectorImpl<ReturnInst*> &Returns, - const char *NameSuffix, ClonedCodeInfo *CodeInfo) { + const char *NameSuffix, ClonedCodeInfo *CodeInfo, + ValueMapTypeRemapper *TypeMapper) { assert(NameSuffix && "NameSuffix cannot be null!"); #ifndef NDEBUG @@ -141,7 +142,8 @@ void llvm::CloneFunctionInto(Function *NewFunc, const Function *OldFunc, // Loop over all instructions, fixing each one as we find it... for (BasicBlock::iterator II = BB->begin(); II != BB->end(); ++II) RemapInstruction(II, VMap, - ModuleLevelChanges ? RF_None : RF_NoModuleLevelChanges); + ModuleLevelChanges ? RF_None : RF_NoModuleLevelChanges, + TypeMapper); } /// CloneFunction - Return a copy of the specified function, but without |