Commit Graph

7 Commits

Author SHA1 Message Date
Chandler Carruth ad74725ab5 Enhance the CFG construction to detect no-return destructors for
temporary objects and local variables. When detected, these split the
block, marking the new one as having only the exit block as a successor.
This prevents a large number of false positives in warnings sensitive to
no-return constructs such as -Wreturn-type, and fixes the remainder of
PR10063 along with several variations of this bug that had not been
reported. The test cases are extended across the board to cover these
patterns.

This also checks in a stress test for these types of CFGs. The stress
test declares some 32k variables, a mixture of no-return and normal
destructors. Previously, this resulted in roughly 2500 CFG blocks, but
didn't model any of the no-return destructors. With this patch, it
results in over 33k blocks, many of them now unreachable.

The nice thing about how the analyzer is set up? This causes *no*
regression in performance of building the CFG. It actually in some cases
makes it faster, as best I can benchmark. The analysis for -Wreturn-type
(and any other that cares about no-return code paths) is technically
slower now as it has to look at many more candidate blocks, but it
computes the correct answer. I have more test cases to follow, I think
they all work now. Also I have further work that should dramatically
simplify analyses in the presence of no-return.

llvm-svn: 139586
2011-09-13 06:09:01 +00:00
Chandler Carruth d280754094 Add several CFG-stress-testing input source files. These use the
preprocessor to build up very large CFGs in various shapes that can
produce different algorithmic behavior in CFG-walking code.

llvm-svn: 134698
2011-07-08 11:20:51 +00:00
Douglas Gregor 4d46522df1 Add an input file that includes all standard C++ headers
llvm-svn: 83042
2009-09-29 03:26:11 +00:00
Chris Lattner d6d0619fb4 added to wrong directory
llvm-svn: 62997
2009-01-26 04:36:31 +00:00
Chris Lattner bb26836c35 add an evil macro expansion perf test from Neil.
llvm-svn: 40138
2007-07-21 04:54:14 +00:00
Steve Naroff f84d11f9d7 Bug #:
Submitted by:
Reviewed by:
Added "global" statistics gathering for Decls/Stmts/Exprs.
Very useful for working with a single file. When we start compiling
multiple files, will need to enhance this to collect stats on a per-module
basis.

llvm-svn: 39485
2007-05-23 21:48:04 +00:00
Chris Lattner 21b691d573 add some of the smaller test inputs I use.
llvm-svn: 39073
2006-10-27 18:15:56 +00:00