summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers
Commit message (Collapse)AuthorAgeFilesLines
...
* Add source-level dominators analysis. Patch by Guoping Long!Ted Kremenek2011-10-252-0/+27
| | | | llvm-svn: 142885
* [analyzer] Node builders cleanup + commentsAnna Zaks2011-10-241-2/+2
| | | | | | Renamed PureNodeBuilder->StmtNodeBuilder. llvm-svn: 142849
* [analyzer] Remove more dependencies from global BuilderAnna Zaks2011-10-241-29/+9
| | | | | | | - OSAtomicChecker - ExprEngine::processStmt llvm-svn: 142846
* Rename AnalysisContext to AnalysisDeclContext. Not only is this name more ↵Ted Kremenek2011-10-248-27/+27
| | | | | | accurate, but it frees up the name AnalysisContext for other uses. llvm-svn: 142782
* [analyzer] Make NodeBuilder and Pred node loosely coupledAnna Zaks2011-10-181-5/+5
| | | | | | NodeBuilder should not assume it's dealing with a single predecessor. Remove predecessor getters. Modify the BranchNodeBuilder to not be responsible for doing auto-transitions (which depend on a predecessor). llvm-svn: 142453
* [analyzer] Remove dead code.Anna Zaks2011-10-181-1/+0
| | | | | | ExprEngineBuilders is not used. llvm-svn: 142450
* [analyzer] Modularize builder use in processBranch.Anna Zaks2011-10-181-7/+11
| | | | | | Take advantage of the new builders for branch processing. As part of this change pass generic NodeBuilder (instead of BranchNodeBuilder) to the BranchCondition callback and remove the unused methods form BranchBuilder. llvm-svn: 142448
* [analyzer] NodeBuilder Refactoring: Subclass BranchNodeBuilder from NodeBuilder.Anna Zaks2011-10-181-2/+2
| | | | llvm-svn: 142444
* [analyzer] Node Builder refactoring: Introduce a simple Node Builder ↵Anna Zaks2011-10-181-7/+11
| | | | | | | | | | | | | | | | | responsible for generating the node frontier. Currently we have a bunch of different node builders which provide some common functionality but are difficult to refactor. Each builder generates nodes of different kinds and calculates the frontier nodes, which should be propagated to the next step (after the builder dies). Introduce a new NodeBuilder which provides very basic node generation facilities but takes care of the second problem. The idea is that all the other builders will eventually use it. Use this builder in CheckerContext instead of StmtNodeBuilder (the way the frontier is propagated to the StmtBuilder is a hack and will be removed later on). llvm-svn: 142443
* Change operator<< for raw_ostream and NamedDecl to take a reference instead ↵Benjamin Kramer2011-10-1411-23/+23
| | | | | | | | of a pointer. Passing a pointer was a bad idea as it collides with the overload for void*. llvm-svn: 141971
* [analyzer] Fix a typo.Anna Zaks2011-10-111-1/+1
| | | | llvm-svn: 141678
* [analyzer] Warn about the use of insecure, deprecated vfork() function ↵Anna Zaks2011-10-111-0/+22
| | | | | | | | PR11053 (http://llvm.org/bugs/show_bug.cgi?id=11053). A patch by Graham Lee! llvm-svn: 141643
* Constant expression evaluation refactoring:Richard Smith2011-10-101-4/+6
| | | | | | | | | | | - Remodel Expr::EvaluateAsInt to behave like the other EvaluateAs* functions, and add Expr::EvaluateKnownConstInt to capture the current fold-or-assert behaviour. - Factor out evaluation of bitfield bit widths. - Fix a few places which would evaluate an expression twice: once to determine whether it is a constant expression, then again to get the value. llvm-svn: 141561
* Remove AnalysisContext::getLiveVariables(), and introduce a templatized ↵Ted Kremenek2011-10-072-2/+2
| | | | | | mechanism to lazily create analyses that are attached to AnalysisContext objects. llvm-svn: 141425
* Rename TagDecl::isDefinition -> isCompleteDefinitionJohn McCall2011-10-071-1/+1
| | | | | | | for better self-documenting code, since the semantics are subtly different from getDefinition(). llvm-svn: 141355
* Clang-side build system infrastructure for multiple tblgens.Peter Collingbourne2011-10-061-2/+2
| | | | llvm-svn: 141267
* [analyzer] Remove the dependency on CheckerContext::getStmt() as well as the ↵Anna Zaks2011-10-068-19/+31
| | | | | | method itself. llvm-svn: 141262
* Fix major regression in RetainCountChecker. DefaultSummaries were not being ↵Ted Kremenek2011-10-051-89/+101
| | | | | | used when they were meant to be. Fixes <rdar://problem/10241614>. llvm-svn: 141250
* [analyzer] Remove the last dependency on CheckerContext::getNodeBuilder() as ↵Anna Zaks2011-10-051-14/+10
| | | | | | | | well as the method itself. Checkers should not directly access NodeBuilder, nodes can be created by calling the CheckerContext's generateNode() methods. llvm-svn: 141249
* [analyzer] OSAtomicChecker implements evalCall in a very invasive way - it ↵Anna Zaks2011-10-051-21/+44
| | | | | | | | essentially simulates inlining of compareAndSwap() by means of setting the NodeBuilder flags and calling ExprEngine directly. This commit introduces a new callback just for this checker to unblock checker API cleanup. llvm-svn: 141246
* [analyzer] Removing more references to CheckerContext::getNodeBuilder(): ask ↵Anna Zaks2011-10-041-6/+2
| | | | | | CheckerContext to generate the nodes. llvm-svn: 141136
* [analyzer] Removing references to CheckerContext::getNodeBuilder(): checkers ↵Anna Zaks2011-10-045-13/+13
| | | | | | can obtain block count directly from the Context. llvm-svn: 141112
* [analyzer] Remove unused methods, add comments to others.Anna Zaks2011-10-041-1/+1
| | | | llvm-svn: 141098
* [analyzer] Remove redundant state (AnalysisContext pointer for every ↵Anna Zaks2011-10-031-4/+9
| | | | | | BinaryOperator tracked) from IdempotentOperationChecker. llvm-svn: 141045
* [analyzer] In UndefBranchChecker, use a node generator which does not create ↵Anna Zaks2011-10-031-1/+1
| | | | | | an edge/branching. (ExprEngine should be in charge of generating edges. The checkers should examine the condition and generate PostCondition node if needed.) llvm-svn: 141034
* [analyzer] Cleanup in UndefBranchChecker:Anna Zaks2011-10-031-7/+4
| | | | | | | - Remove unused FindUndefExpr::ProgramStateManager. - The Condition parameter of the callback is the terminator of the block, no need to retrieve it again. llvm-svn: 141027
* Allow getting all source locations of selector identifiers in a ObjCMethodDecl.Argyrios Kyrtzidis2011-10-032-4/+5
| | | | | | | | | | | | | Instead of always storing all source locations for the selector identifiers we check whether all the identifiers are in a "standard" position; "standard" position is -Immediately before the arguments: -(id)first:(int)x second:(int)y; -With a space between the arguments: -(id)first: (int)x second: (int)y; -For nullary selectors, immediately before ';': -(void)release; In such cases we infer the locations instead of storing them. llvm-svn: 140989
* Tweak the interface for analyzing the CF conventions for a nameJohn McCall2011-10-011-8/+6
| | | | | | | | | | | | 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
* [analyzer] Fix a bug in RetainReleaseChecker diagnostics. It gives more ↵Anna Zaks2011-09-301-1/+1
| | | | | | precise error message on the modified test case (and prevents duplicate diagnostics when we purge at block granularity). llvm-svn: 140840
* Fix a crash in MallocOverflowSecurityChecker. Patch by Lei Zhang.Anna Zaks2011-09-271-0/+2
| | | | llvm-svn: 140648
* Fix comment typo.Benjamin Kramer2011-09-241-1/+1
| | | | | | Patch by Rui Paulo! llvm-svn: 140448
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-1/+1
| | | | llvm-svn: 140367
* [analyzer] Refactor PathDiagnosticLocation: Make ↵Anna Zaks2011-09-2013-53/+120
| | | | | | | | PathDiagnosticLocation(SourceLocation...) private. Most of the effort here goes to making BugReport refer to a PathDiagnosticLocation instead of FullSourceLocation. (Another step closer to the goal of having Diagnostics which can recover from invalid SourceLocations.) llvm-svn: 140182
* [analyzer] Refactor: make PathDiagnosticLocation responsible for validation ↵Anna Zaks2011-09-151-2/+2
| | | | | | | | | of SourceLocations (commit 2 of ?): - Fix a fixme and move the logic of creating a PathDiagnosticLocation corresponding to a ProgramPoint into a PathDiagnosticLocation constructor. - Rename PathDiagnosticLocation::create to differentiate from the added constructor. llvm-svn: 139825
* [analyzer] Refactor: make PathDiagnosticLocation responsible for validation ↵Anna Zaks2011-09-152-3/+6
| | | | | | | | | of SourceLocations (commit 2 of ?): - Modify all PathDiagnosticLocation constructors that take Stmt to also requre LocationContext. - Add a constructor which should be used in case there is no valid statement/location (it will grab the location of the enclosing function). llvm-svn: 139763
* [analyzer] Refactor: Make PathDiagnosticLocation responsible for creating a ↵Anna Zaks2011-09-141-23/+1
| | | | | | valid object given an ExploadedNode (the same logic can be reused by other checkers). llvm-svn: 139672
* Switch LangOptions over to a .def file that describes header of theDouglas Gregor2011-09-133-10/+10
| | | | | | | | | | language options. Use that .def file to declare the LangOptions class and initialize all of its members, eliminating a source of annoying initialization bugs. AST serialization changes are next up. llvm-svn: 139605
* Make helpers static, remove unused variables.Benjamin Kramer2011-09-031-1/+1
| | | | llvm-svn: 139078
* [analyzer] Remove TransferFuncs.h, then deal with the fallout.Jordy Rose2011-09-026-2/+8
| | | | | | And with that, TransferFuncs is gone! llvm-svn: 139003
* [analyzer] Move RetainReleaseChecker to the Checkers library and rename it ↵Jordy Rose2011-09-022-0/+3601
| | | | | | to RetainCountChecker...and clean up the file while I'm at it. llvm-svn: 139002
* [analyzer] Move the knowledge of whether or not GC is enabled for the ↵Jordy Rose2011-09-021-0/+4
| | | | | | | | | | current analysis from CFRefCount to ExprEngine. Remove TransferFuncs from ExprEngine and AnalysisConsumer. Demote RetainReleaseChecker to a regular checker, and give it the name osx.cocoa.RetainCount (class name change coming shortly). Update tests accordingly. llvm-svn: 138998
* Extend the ASTContext constructor to delay the initialization ofDouglas Gregor2011-09-023-3/+4
| | | | | | | | builtin types (When requested). This is another step toward making ASTUnit build the ASTContext as needed when loading an AST file, rather than doing so after the fact. No actual functionality change (yet). llvm-svn: 138985
* If size was equal to 0, either NULL or a pointer suitable to be passed to Zhongxing Xu2011-09-011-5/+2
| | | | | | | | free() is returned by realloc(). Most code expect NULL. And we only need to transfer one final ProgramState. llvm-svn: 138937
* [analyzer] Fix varargs helper to only use POD types even for named ↵Jordy Rose2011-08-311-4/+4
| | | | | | arguments. Thanks, Joerg. llvm-svn: 138875
* [analyzer] MacOSKeychainAPIChecker: Simplify getSymbolForRegion by using ↵Anna Zaks2011-08-291-7/+3
| | | | | | existing API. Thanks Jordy. llvm-svn: 138765
* Fix: Bug 10798 - [analyzer] Crash when analyzing ICU. (A slight improvement ↵Anna Zaks2011-08-291-1/+1
| | | | | | on the previous commit.) llvm-svn: 138762
* Fix bug 10797: Crash: "cast<Ty>() argument of incompatible type!" assert ↵Anna Zaks2011-08-291-2/+4
| | | | | | | | when analyzing ICU. Patch by Jean-Daniel Dupas. Thanks for spotting and fixing! llvm-svn: 138757
* [analyzer] Change the check::RegionChanges callback to include the regions ↵Jordy Rose2011-08-271-7/+8
| | | | | | | | | | explicitly requested for invalidation. Also, allow CallOrObjCMessage to wrap a CXXConstructExpr as well. Finally, this allows us to remove the clunky whitelisting system from CFRefCount/RetainReleaseChecker. Slight regression due to CXXNewExprs not yet being handled in post-statement callbacks (PR forthcoming). llvm-svn: 138716
* Handle CXXTempObjectRegion in StackAddrEscapeChecker.Jeffrey Yasskin2011-08-261-0/+5
| | | | | | | | Also convert stack-addr-ps.cpp to use the analyzer instead of just Sema, now that it doesn't crash, and extract the stack-block test into another file since it errors, and that prevents the analyzer from running. llvm-svn: 138613
* [analyzer] MacOSKeychainAPIChecker: Cleanup AllocationState structure.Anna Zaks2011-08-251-11/+10
| | | | llvm-svn: 138535
OpenPOWER on IntegriCloud