summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorMon P Wang <wangmp@apple.com>2011-12-23 02:18:32 +0000
committerMon P Wang <wangmp@apple.com>2011-12-23 02:18:32 +0000
commit5d44a4332a7cc34dbbf91df28fe150e605fb89d7 (patch)
treefa99faa43c4cf383f9982553e50518d7fa2b4e59 /llvm/lib/Transforms
parent2644063ec9db70619abec440e02be1c3c815ef4b (diff)
downloadbcm5719-llvm-5d44a4332a7cc34dbbf91df28fe150e605fb89d7.tar.gz
bcm5719-llvm-5d44a4332a7cc34dbbf91df28fe150e605fb89d7.zip
When not destroying the source, the linker is not remapping the types. Added support
to CloneFunctionInto to allow remapping for this case. llvm-svn: 147217
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Utils/CloneFunction.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp
index c6dfe73b9f2..6ddbed2bbea 100644
--- a/llvm/lib/Transforms/Utils/CloneFunction.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud