summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix infinite loop in -Wuninitialized reported in PR 11069.Ted Kremenek2011-10-071-19/+26
| | | | llvm-svn: 141345
* [static analyzer] Fix crash in LiveVariables and Environment::getSVal() when ↵Ted Kremenek2011-10-061-3/+4
| | | | | | analyzing C++ pointer-to-member calls. Fixes <rdar://problem/10243398>. llvm-svn: 141312
* Fix another major performance regression in LiveVariables by not ↵Ted Kremenek2011-10-021-1/+6
| | | | | | canonicalizing the underlying ImmutableSets on every analyzed statement (just at merges). Fixes <rdar://problem/10087538>. llvm-svn: 140958
* Fix LiveVariables analysis bug with MaterializeTemporaryExpr and fix ↵Ted Kremenek2011-10-021-4/+0
| | | | | | handling in ExprEngine. Fixes <rdar://problem/10201666>. llvm-svn: 140956
* Tweak the interface for analyzing the CF conventions for a nameJohn McCall2011-10-011-1/+11
| | | | | | | | | | | | to take a FunctionDecl* instead of an llvm::StringRef. Eventually we might push more logic in there, like using slightly different conventions for C++ methods. Also, fix a bug where 'copy' and 'create' were being caught in non-camel-cased strings. We want copyFoo and CopyFoo and XCopy but not Xcopy or xcopy. llvm-svn: 140911
* Removing a bunch of dead returns/breaks after llvm_unreachables.David Blaikie2011-09-231-2/+0
| | | | llvm-svn: 140407
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-233-5/+5
| | | | llvm-svn: 140367
* Test commitDeLesley Hutchins2011-09-201-1/+1
| | | | llvm-svn: 140149
* [analyzer] Constify a method.Anna Zaks2011-09-191-1/+1
| | | | llvm-svn: 140091
* Fix massive LiveVariables regression (due to LiveVariables rewrite) by ↵Ted Kremenek2011-09-161-62/+222
| | | | | | | | | | | | | | | | addressing two performance problems: - Speed of "merge()", which merged data flow facts. This was doing a set canonicalization on every insertion, which was super slow. To fix this, we use ImmutableSetRef. - Visit CFGBlocks in reverse postorder. This is a huge speedup, as on some test cases the algorithm would take many iterations to converge. This contains a bunch of copy-paste from UninitializedValues.cpp and ThreadSafety.cpp. The idea was to get something working first, and then refactor the common logic for all three files into a separate analysis/library entry point. llvm-svn: 139968
* Thread safety: Adding FIXMEs and a couple cleanupsCaitlin Sadowski2011-09-161-30/+12
| | | | llvm-svn: 139894
* Thread safety: completeing the implementation of shared/exclusive locks ↵Caitlin Sadowski2011-09-151-2/+45
| | | | | | required attributes llvm-svn: 139804
* Thread safety: refactoring various out of scope warnings to use the same ↵Caitlin Sadowski2011-09-151-80/+21
| | | | | | inteface. This eliminates a lot of unnecessary duplicated code. llvm-svn: 139801
* Thread safety: adding additional documentation to the main thread safety ↵Caitlin Sadowski2011-09-141-1/+5
| | | | | | interface, and making the destructor for the thread safety handler pure virtual llvm-svn: 139722
* Thread safety: adding test cases for unparseable lock expressions and ↵Caitlin Sadowski2011-09-141-16/+33
| | | | | | expanding the handling of these expressions llvm-svn: 139720
* Add a bit to the CFGBlock to track when it contains a no-returnChandler Carruth2011-09-131-0/+1
| | | | | | | CFGElement. This will allow greatly simplifying the logic in -Wreturn-type. llvm-svn: 139593
* Consolidate the logic for building a no-return CFG block into a singleChandler Carruth2011-09-131-23/+21
| | | | | | | location with a single comment rather than scattering it in three places. llvm-svn: 139592
* Enhance the CFG construction to detect no-return destructors forChandler Carruth2011-09-131-28/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Thread safety: small formatting changeCaitlin Sadowski2011-09-121-1/+2
| | | | llvm-svn: 139548
* Silence "end of non-void function" warnings with llvm_unreachable and add an ↵Benjamin Kramer2011-09-101-0/+2
| | | | | | assert. llvm-svn: 139474
* Extend the Stmt AST to make it easier to look through label, default,Chandler Carruth2011-09-101-6/+2
| | | | | | | | | | | and case statements. Use this to make the logic in the CFG builder more robust at finding the actual statements within a compound statement, even when there are many layers of labels obscuring it. Also extend the test cases for a large chunk of PR10063. Still more work to do here though. llvm-svn: 139437
* Thread safety: removing unnecessary import and reordering import listCaitlin Sadowski2011-09-091-5/+5
| | | | llvm-svn: 139426
* Thread safety: removing unnecessary importCaitlin Sadowski2011-09-091-1/+0
| | | | llvm-svn: 139425
* Thread safety: This patch deals with previously unhandled cases when ↵Caitlin Sadowski2011-09-091-21/+37
| | | | | | building lock expressions. We now resolve this expressions, avoid crashing when encountering cast expressions, and have a diagnostic for unresolved lock expressions llvm-svn: 139370
* Thread Safety: Moving the analysis to a new fileCaitlin Sadowski2011-09-092-0/+795
| | | | llvm-svn: 139369
* -Wuninitialized: fix insidious bug resulting from interplay of blocks and ↵Ted Kremenek2011-09-021-17/+14
| | | | | | dead code. Fixes <rdar://problem/10060250>. llvm-svn: 139027
* Warn on missing [super finalize] calls.Nico Weber2011-08-281-0/+1
| | | | | | This matches gcc's logic. Second half of PR10661. llvm-svn: 138730
* Teach -Wunreachable-code about dead code caused by macro expansions. This ↵Ted Kremenek2011-08-251-4/+8
| | | | | | should suppress false positives resulting from 'assert' and friends. llvm-svn: 138576
* Start reworking -Wunreachable-code. The original analysis had serious flaws ↵Ted Kremenek2011-08-231-172/+201
| | | | | | | | | | with how it handled SCC's of dead code, or simply having false negatives by overly suppressing warnings. WIP. llvm-svn: 138410
* CFG: record set of C++ 'try' dispatch blocks, which could be of interest to ↵Ted Kremenek2011-08-231-2/+2
| | | | | | various analyses (e.g., reachability). llvm-svn: 138409
* Constify the result of CFGStmt::getStmt().Ted Kremenek2011-08-234-17/+17
| | | | llvm-svn: 138408
* Fix regression in -Wuninitialized involving VLAs. It turns out that we were ↵Ted Kremenek2011-08-231-9/+0
| | | | | | | | | | | modeling sizeof(VLAs) incorrectly in the CFG, and also the static analyzer. This patch regresses the analyzer a bit, but that needs to be followed up with a better solution. Fixes <rdar://problem/10008112>. llvm-svn: 138372
* Remove dead code.Ted Kremenek2011-08-201-13/+1
| | | | llvm-svn: 138183
* Fix else style. No functionality change intended.Chad Rosier2011-08-174-12/+6
| | | | llvm-svn: 137896
* Fix a handful of dead stores found by Clang's static analyzer. There's a ↵Ted Kremenek2011-08-171-2/+2
| | | | | | bunch of others I haven't touched. llvm-svn: 137867
* Cleanup various declarations of 'Stmt*' to be 'Stmt *', etc. in libAnalyzer ↵Ted Kremenek2011-08-125-170/+170
| | | | | | and libStaticAnalyzer[*]. It was highly inconsistent, and very ugly to look at. llvm-svn: 137537
* [analyzer] change "tag" in ProgramPoint from "void*" to a ProgramPointTag*.Ted Kremenek2011-08-122-0/+27
| | | | | | | Having a notion of an actual ProgramPointTag will aid in introspection of the analyzer's behavior. For example, the GraphViz output of the analyzer will pretty-print the tags in a useful manner. llvm-svn: 137529
* Revert "Fix crash in CFGBuilder involving implicit destructor calls and ↵Ted Kremenek2011-08-121-8/+6
| | | | | | gotos jumping after an object was declared. Fixes PR 10620." llvm-svn: 137459
* Fix crash in CFGBuilder involving implicit destructor calls and gotos ↵Ted Kremenek2011-08-121-6/+8
| | | | | | jumping after an object was declared. Fixes PR 10620. llvm-svn: 137426
* Fix another -Wuninitialized assertion failure (this one involving bit casts) ↵Ted Kremenek2011-08-081-8/+23
| | | | | | resulting from the recent -Wuninitialized changes. llvm-svn: 137068
* [analyzer] Simplify logic for ExprEngine::VisitUnaryExprOrTypeTraitExpr to ↵Ted Kremenek2011-08-062-10/+42
| | | | | | | | avoid recursion to subexpression. This exposed bugs in the live variables analysis, and a latent analyzer bug in the SymbolReaper. llvm-svn: 137006
* Fix assertion failure in -Wuninitialized involving no-op casts. Fixes PR 10577.Ted Kremenek2011-08-041-5/+19
| | | | llvm-svn: 136939
* Make helper functions static.Benjamin Kramer2011-08-021-2/+3
| | | | llvm-svn: 136679
* [analyzer] Overhaul how the static analyzer expects CFGs by forcing CFGs to ↵Ted Kremenek2011-07-282-321/+404
| | | | | | | | | | | | be linearized only when used by the static analyzer. This required a rewrite of LiveVariables, and exposed a ton of subtle bugs. The motivation of this large change is to drastically simplify the logic in ExprEngine going forward. Some fallout is that the output of some BugReporterVisitors is not as accurate as before; those will need to be fixed over time. There is also some possible performance regression as RemoveDeadBindings will be called frequently; this can also be improved over time. llvm-svn: 136419
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-238-32/+29
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Move duplicate uninitialized warning suppression into theChandler Carruth2011-07-221-7/+3
| | | | | | | | | | | | AnalysisBasedWarnings Sema layer and out of the Analysis library itself. This returns the uninitialized values analysis to a more pure form, allowing its original logic to correctly detect some categories of definitely uninitialized values. Fixes PR10358 (again). Thanks to Ted for reviewing and updating this patch after his rewrite of several portions of this analysis. llvm-svn: 135748
* Simplify passing of CFGBuildOptions around for AnalysisContext. No ↵Ted Kremenek2011-07-211-15/+29
| | | | | | functionality change. llvm-svn: 135666
* Fix -Wuninitialized regression involving functions invalidating parameters ↵Ted Kremenek2011-07-201-1/+3
| | | | | | passed by reference. llvm-svn: 135610
* Fix false negative in -Wuninitialized involving a () wrapping an ↵Ted Kremenek2011-07-191-6/+11
| | | | | | lvalue-to-rvalue conversion in a DeclStmt. llvm-svn: 135525
* Fix assertion failure in UninitializedValues.cpp where an lvalue to rvalue ↵Ted Kremenek2011-07-191-2/+3
| | | | | | conversion is wrapped in a parenthesis. llvm-svn: 135519
OpenPOWER on IntegriCloud