Added CFGTerminator class, that holds information about CFGBlock terminator statement.

llvm-svn: 117642
This commit is contained in:
Marcin Swiderski
2010-10-29 05:21:47 +00:00
parent 93aa84e83b
commit a7d84a7615
3 changed files with 56 additions and 9 deletions

View File

@@ -244,7 +244,8 @@ void FindUnreachableCode(AnalysisContext &AC, Callback &CB) {
CFGBlock &b = **I;
if (!reachable[b.getBlockID()]) {
if (b.pred_empty()) {
if (!AddEHEdges && dyn_cast_or_null<CXXTryStmt>(b.getTerminator())) {
if (!AddEHEdges
&& dyn_cast_or_null<CXXTryStmt>(b.getTerminator().getStmt())) {
// When not adding EH edges from calls, catch clauses
// can otherwise seem dead. Avoid noting them as dead.
numReachable += ScanReachableFromBlock(b, reachable);