diff options
author | Andrew Kaylor <andrew.kaylor@intel.com> | 2015-03-11 23:22:06 +0000 |
---|---|---|
committer | Andrew Kaylor <andrew.kaylor@intel.com> | 2015-03-11 23:22:06 +0000 |
commit | 6b67d4277366cbaa0b76b544b94ebafab26e502a (patch) | |
tree | dd6a56a77fa213f1f967eb9939216f48789f0466 /llvm/lib/Transforms/Utils/CloneFunction.cpp | |
parent | 5f141b03fa622e6c2992b3c0b855a297f585dc0d (diff) | |
download | llvm-6b67d4277366cbaa0b76b544b94ebafab26e502a.zip llvm-6b67d4277366cbaa0b76b544b94ebafab26e502a.tar.gz llvm-6b67d4277366cbaa0b76b544b94ebafab26e502a.tar.bz2 |
Extended support for native Windows C++ EH outlining
Differential Review: http://reviews.llvm.org/D7886
llvm-svn: 231981
Diffstat (limited to 'llvm/lib/Transforms/Utils/CloneFunction.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/CloneFunction.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp index 00c3e06..7053283 100644 --- a/llvm/lib/Transforms/Utils/CloneFunction.cpp +++ b/llvm/lib/Transforms/Utils/CloneFunction.cpp @@ -392,6 +392,14 @@ void PruningFunctionCloner::CloneBlock(const BasicBlock *BB, // terminator into the new basic block in this case. if (Action == CloningDirector::StopCloningBB) return; + if (Action == CloningDirector::CloneSuccessors) { + // If the director says to skip with a terminate instruction, we still + // need to clone this block's successors. + const TerminatorInst *TI = BB->getTerminator(); + for (unsigned i = 0, e = TI->getNumSuccessors(); i != e; ++i) + ToClone.push_back(TI->getSuccessor(i)); + return; + } assert(Action != CloningDirector::SkipInstruction && "SkipInstruction is not valid for terminators."); } |