summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/BasicBlock.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-07-31 17:58:14 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-07-31 17:58:14 +0000
commit654e130b6ec76c1a2910b2594cb403ecd2773af8 (patch)
tree79a53c08a138345e3cdd13b36940d3d1cf6f5917 /llvm/lib/IR/BasicBlock.cpp
parente430654fd85a04f04c93eab40ba7fe87d8657130 (diff)
downloadbcm5719-llvm-654e130b6ec76c1a2910b2594cb403ecd2773af8.tar.gz
bcm5719-llvm-654e130b6ec76c1a2910b2594cb403ecd2773af8.zip
New EH representation for MSVC compatibility
This introduces new instructions neccessary to implement MSVC-compatible exception handling support. Most of the middle-end and none of the back-end haven't been audited or updated to take them into account. Differential Revision: http://reviews.llvm.org/D11097 llvm-svn: 243766
Diffstat (limited to 'llvm/lib/IR/BasicBlock.cpp')
-rw-r--r--llvm/lib/IR/BasicBlock.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/llvm/lib/IR/BasicBlock.cpp b/llvm/lib/IR/BasicBlock.cpp
index 0a0449434a7..b5671a66f04 100644
--- a/llvm/lib/IR/BasicBlock.cpp
+++ b/llvm/lib/IR/BasicBlock.cpp
@@ -197,7 +197,7 @@ BasicBlock::iterator BasicBlock::getFirstInsertionPt() {
return end();
iterator InsertPt = FirstNonPHI;
- if (isa<LandingPadInst>(InsertPt)) ++InsertPt;
+ if (InsertPt->isEHPad()) ++InsertPt;
return InsertPt;
}
@@ -333,6 +333,17 @@ void BasicBlock::removePredecessor(BasicBlock *Pred,
}
}
+bool BasicBlock::canSplitPredecessors() const {
+ const Instruction *FirstNonPHI = getFirstNonPHI();
+ if (isa<LandingPadInst>(FirstNonPHI))
+ return true;
+ // This is perhaps a little conservative because constructs like
+ // CleanupBlockInst are pretty easy to split. However, SplitBlockPredecessors
+ // cannot handle such things just yet.
+ if (FirstNonPHI->isEHPad())
+ return false;
+ return true;
+}
/// This splits a basic block into two at the specified
/// instruction. Note that all instructions BEFORE the specified iterator stay
OpenPOWER on IntegriCloud