Remove a kludge from analysis based warnings that used to detect

temporaries with no-return destructors. The CFG now properly supports
temporaries and implicit destructors which both makes this kludge no
longer work, and conveniently removes the need for it.

Turn on CFG handling of implicit destructors and initializers. Several
ad-hoc benchmarks don't indicate any measurable performance impact from
growing the CFG, and it fixes real correctness problems with warnings.

As a result of turning on these CFG elements, we started to tickle an
inf-loop in the unreachable code logic used for warnings. The fix is
trivial.

llvm-svn: 123056
This commit is contained in:
Chandler Carruth
2011-01-08 06:54:40 +00:00
parent bf4832cda8
commit b35635e942
3 changed files with 6 additions and 22 deletions

View File

@@ -30,12 +30,11 @@ static SourceLocation GetUnreachableLoc(const CFGBlock &b, SourceRange &R1,
unsigned sn = 0;
R1 = R2 = SourceRange();
top:
if (sn < b.size()) {
CFGStmt CS = b[sn].getAs<CFGStmt>();
if (!CS)
goto top;
return SourceLocation();
S = CS.getStmt();
} else if (b.getTerminator())
S = b.getTerminator();