diff options
author | David Majnemer <david.majnemer@gmail.com> | 2015-06-30 22:14:01 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2015-06-30 22:14:01 +0000 |
commit | cda8688f612c4a77a6a6840a391674602d57b729 (patch) | |
tree | 9b8291bc60f07bad143645f0771f4ddae04b5447 /llvm/lib/Transforms/Utils/CloneModule.cpp | |
parent | e286b0e1f2549da24e1ede64b37e636c4ae152a7 (diff) | |
download | bcm5719-llvm-cda8688f612c4a77a6a6840a391674602d57b729.tar.gz bcm5719-llvm-cda8688f612c4a77a6a6840a391674602d57b729.zip |
[Cloning] Teach CloneModule about personality functions
CloneModule didn't take into account that it needed to remap the value
using values in the module.
This fixes PR23992.
llvm-svn: 241122
Diffstat (limited to 'llvm/lib/Transforms/Utils/CloneModule.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/CloneModule.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/CloneModule.cpp b/llvm/lib/Transforms/Utils/CloneModule.cpp index 269332206da..61f1811e7b4 100644 --- a/llvm/lib/Transforms/Utils/CloneModule.cpp +++ b/llvm/lib/Transforms/Utils/CloneModule.cpp @@ -99,7 +99,11 @@ Module *llvm::CloneModule(const Module *M, ValueToValueMapTy &VMap) { SmallVector<ReturnInst*, 8> Returns; // Ignore returns cloned. CloneFunctionInto(F, I, VMap, /*ModuleLevelChanges=*/true, Returns); + } + + if (I->hasPersonalityFn()) + F->setPersonalityFn(MapValue(I->getPersonalityFn(), VMap)); } // And aliases |