In preparation for fixing PR 6884, rework CFGElement to have getAs<> return pointers instead of fresh CFGElements.

- Also, consoldiate getDtorKind() and getKind() into one "kind".
- Add empty getDestructorDecl() method to CFGImplicitDtor.

llvm-svn: 126738
This commit is contained in:
Ted Kremenek
2011-03-01 03:15:10 +00:00
parent 9720642c68
commit 96a7a59119
10 changed files with 158 additions and 140 deletions

View File

@@ -50,11 +50,11 @@ 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;
CFGStmt CS = CE.getAs<CFGStmt>();
if (!CS.isValid())
const CFGStmt *CS = CE.getAs<CFGStmt>();
if (!CS)
continue;
CFGBlock *&Entry = SM[CS];
CFGBlock *&Entry = SM[CS->getStmt()];
// If 'Entry' is already initialized (e.g., a terminator was already),
// skip.
if (Entry)