diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-09-16 01:25:47 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-09-16 01:25:47 +0000 |
commit | 2cd7a78c760d1c8052fed67317de2abf2844c5ef (patch) | |
tree | 00cd6b740cd87f2ef4fe0ccd5c8478ef6bfa100c /clang/lib/Analysis/CFGStmtMap.cpp | |
parent | 7ce490c6b5670448b6ee95254d054e8fcf34441f (diff) | |
download | bcm5719-llvm-2cd7a78c760d1c8052fed67317de2abf2844c5ef.tar.gz bcm5719-llvm-2cd7a78c760d1c8052fed67317de2abf2844c5ef.zip |
Introduce new CFGElement hierarchy to support C++ CFG, based on Marcin's patch
and discussions with Ted and Jordy.
llvm-svn: 114056
Diffstat (limited to 'clang/lib/Analysis/CFGStmtMap.cpp')
-rw-r--r-- | clang/lib/Analysis/CFGStmtMap.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/clang/lib/Analysis/CFGStmtMap.cpp b/clang/lib/Analysis/CFGStmtMap.cpp index 965eca1b3c9..3a030f9bdd1 100644 --- a/clang/lib/Analysis/CFGStmtMap.cpp +++ b/clang/lib/Analysis/CFGStmtMap.cpp @@ -50,15 +50,18 @@ static void Accumulate(SMap &SM, CFGBlock *B) { // First walk the block-level expressions. for (CFGBlock::iterator I = B->begin(), E = B->end(); I != E; ++I) { const CFGElement &CE = *I; - if (Stmt *S = CE.getStmt()) { - CFGBlock *&Entry = SM[S]; - // If 'Entry' is already initialized (e.g., a terminator was already), - // skip. - if (Entry) - continue; + CFGStmt CS = CE.getAs<CFGStmt>(); + if (!CS.isValid()) + continue; + + CFGBlock *&Entry = SM[CS]; + // If 'Entry' is already initialized (e.g., a terminator was already), + // skip. + if (Entry) + continue; - Entry = B; - } + Entry = B; + } // Look at the label of the block. |