summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/BugReporter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Refactor Dead Stores error reporting to use the simplified ↵Ted Kremenek2008-07-141-2/+3
| | | | | | BugReporter::EmitBasicReport interface. llvm-svn: 53573
* Added method "EmitBasicReport" to BugReporter to simplify the emission of ↵Ted Kremenek2008-07-141-7/+23
| | | | | | | | simple bug diagnostics. Refactored error reporting in CheckObjCDealloc and CheckObjCInstMethSignature to use this new bug reporting interface (major code simplification). llvm-svn: 53560
* Refactored most of the "Store" piece of ValueState into a Store type. TheTed Kremenek2008-07-101-3/+3
| | | | | | | | | current store implementation is now encapsulated by BasicStore. These changes prompted some long due constification of ValueState. Much of the diffs in this patch include adding "const" qualifiers. llvm-svn: 53423
* Have BugReporter::getCFG and BugReporter::getLiveVariables returns pointers ↵Ted Kremenek2008-07-031-1/+1
| | | | | | | | instead of references, because they can both fail on functions we cannot construct full CFGs for yet. llvm-svn: 53081
* Refactored some of the BugReporter interface so that data such as the ↵Ted Kremenek2008-07-021-11/+12
| | | | | | | | ASTContext&, PathDiagnosticClient*, can be provided by an external source. Split BugReporter into BugReporter and GRBugReporter so checkers not based on GRExprEngine can still use the BugReporter mechanism. llvm-svn: 53048
* Modified the dead stores checker to...Ted Kremenek2008-06-201-0/+4
| | | | | | | | | | | | | | | | | 1) Check if a dead store appears as a subexpression. For such cases, we emit a verbose diagnostic so that users aren't confused. This addresses: <rdar://problem/5968508> checker gives misleading report for dead store in loop 2) Don't emit a dead store warning when assigning a null value to a pointer. This is a common form of defensive programming. We may wish to make this an option to the the checker one day. This addresses the feature request in the following email: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2008-June/001978.html llvm-svn: 52555
* Added a new ProgramPoint: PostPurgeDeadSymbols. This new program point ↵Ted Kremenek2008-06-181-27/+70
| | | | | | distinguishes between the cases when we just evaluated the transfer function of a Stmt* (PostStmt) or performed a load (PostLoad). This solves a caching bug observed in a recent bug report. llvm-svn: 52443
* Fix non-termination bug reported by Thomas Clement!Ted Kremenek2008-06-171-1/+25
| | | | llvm-svn: 52426
* Prototyped support in the BugReporter to emit diagnostics of the form "p now ↵Ted Kremenek2008-05-221-2/+167
| | | | | | aliases q". llvm-svn: 51453
* Partitioned BugTypeCachedLocation::isCached() into two methods: one that ↵Ted Kremenek2008-05-161-1/+6
| | | | | | | | accepts and ExplodedNode, and the other that accepts a ProgramPoint. The default behavior is to cache bug reports by the location they occur (the end node). Subclasses can override this behavior by providing a different ProgramPoint. llvm-svn: 51197
* More refactorings in GeneratePathDiagnostic: use ExecutionContinues to displayTed Kremenek2008-05-061-14/+28
| | | | | | "Execution continues..." message, which does a better job at handling corner cases. llvm-svn: 50751
* Rename member variable.Ted Kremenek2008-05-021-4/+4
| | | | llvm-svn: 50597
* Added line number diagnostics to indicate the allocation site of the leaked ↵Ted Kremenek2008-05-011-4/+2
| | | | | | object. llvm-svn: 50553
* Do not highlight bogus ranges for leaks.Ted Kremenek2008-05-011-38/+42
| | | | llvm-svn: 50549
* added preliminary diagnostics in scan-build results to denote whetherTed Kremenek2008-04-301-0/+7
| | | | | | a CF memory leak occurred with GC enabled, etc. llvm-svn: 50507
* Fix bug in BugReporter where we didn't handle emitting diagnostics forTed Kremenek2008-04-251-10/+28
| | | | | | | | | | empty CFGBlocks that only contained a terminator. Added improved diagnostics for break and continue statements and default branches in switch statements. This fixes <rdar://problem/5889244>. llvm-svn: 50286
* Don't emit empty strings for path diagnostics when taking the default branch ↵Ted Kremenek2008-04-251-0/+7
| | | | | | of a switch statement that has no label. llvm-svn: 50242
* Do a better job at computing dead symbols.Ted Kremenek2008-04-251-3/+5
| | | | | | | | | Implemented support for better localized leaks in the CF reference count checker. Now leaks should be flagged close to where they occur. This should implement the desired functionality in <rdar://problem/5879592>, although the diagnostics still need to be improved. llvm-svn: 50241
* For case statements involving enums, BugReporter now generates PathDiagnosticsTed Kremenek2008-04-231-32/+38
| | | | | | | | that say that we are jumping to "case a" instead of "case 0". This is a feature implementation for <rdar://problem/5880430>. llvm-svn: 50197
* Fix minor regression in bug report generation.Ted Kremenek2008-04-231-2/+3
| | | | llvm-svn: 50195
* When building PathDiagnostics for bug reports, generate a trimmed ↵Ted Kremenek2008-04-231-18/+50
| | | | | | ExplodedGraph with a single path that BugReport objects can safely walk and introspect. llvm-svn: 50194
* For default branches in switch statements with no default label, print outTed Kremenek2008-04-221-3/+1
| | | | | | the line we are going to. llvm-svn: 50113
* PathDiagnosticClients now retain ownership of passed PathDiagnostics, requiringTed Kremenek2008-04-221-14/+13
| | | | | | | | | | them to not be stack-allocated. HTMLDiagnostics now batches PathDiagnostics before emitting HTML in its dtor. This is a workaround for a problem when we trampled the Preprocessor state when highlighting macros (sometimes resulting in an assertion failure). llvm-svn: 50102
* Another bug fix in emitting warnings without a path: construct a unit ↵Ted Kremenek2008-04-181-17/+25
| | | | | | | | PathDiagnostic as we did before. This allows the HTMLDiagnostic object to retrieve the bug type, bug description, etc. llvm-svn: 49939
* Reenable using the PathDiagnosticClient for BugReports without paths.Ted Kremenek2008-04-181-2/+5
| | | | llvm-svn: 49934
* Generalize caching mechanism for bugs reports. Now individual BugTypesTed Kremenek2008-04-181-6/+7
| | | | | | | | can decide the policy on how to cache related bugs. This allows us to properly to handle warning about multiple leaks in the same location in the ref count checker (not yet done). llvm-svn: 49918
* BugReport::VisitNode now takes BugReporter& instead of ASTContext&.Ted Kremenek2008-04-181-2/+2
| | | | | | | | Shuffled around code in CFRefCount to better pair classes with implementation, and started adding subclasses of RangedBugReport to handle better diagnostics for reference count bugs. llvm-svn: 49889
* Added null check.Ted Kremenek2008-04-181-0/+3
| | | | llvm-svn: 49887
* Simplified internal logic of BugReporter, consolidating EmitWarning andTed Kremenek2008-04-181-42/+40
| | | | | | | | EmitPathWarning into one method. We now properly handle emitting warnings without a PathDiagnosticClient when the warning does not involve a particular statement. llvm-svn: 49884
* Modified BugReport::getEndPath() to handle the case where end path is atTed Kremenek2008-04-171-15/+43
| | | | | | the exit block of the CFG. llvm-svn: 49880
* Have BugReporter::EmitWarning use the PathDiagnosticClient if it is available.Ted Kremenek2008-04-141-10/+22
| | | | llvm-svn: 49668
* Hooked up the dead-store checker to the BugReporter interface. Now dead-storeTed Kremenek2008-04-141-31/+39
| | | | | | warnings are emitted as part of the warnings registered by GRSimpleVals. llvm-svn: 49658
* Added "RangedBugReport".Ted Kremenek2008-04-111-0/+2
| | | | llvm-svn: 49551
* When not emitting path diagnostics in BugReporter::EmitWarning(), use theTed Kremenek2008-04-101-3/+13
| | | | | | BugReport-specific SourceRanges (when available). llvm-svn: 49486
* Major refactoring/cleanup of GRExprEngine, ExplodedGraph, and BugReporter.Ted Kremenek2008-04-091-40/+36
| | | | | | | | | | | | | | | Bugs are now reported using a combination of "BugType" (previously BugDescription) and Bug "BugReport" objects, which are fed to BugReporter (which generates PathDiagnostics). This provides a far more modular way of registering bug types and plugging in diagnostics. GRExprEngine now owns its copy of GRCoreEngine, and is not owned by the ExplodedGraph. ExplodedGraph is no longer templated on the "checker", but instead on the state contained in the nodes. llvm-svn: 49453
* Added new "BugReporterHelper" class which is used by BugReporter to emitTed Kremenek2008-04-091-8/+24
| | | | | | checker-specific diagnostics. llvm-svn: 49412
* Improve BugReport diagnostics for loops and ? operator.Ted Kremenek2008-04-071-4/+57
| | | | llvm-svn: 49356
* Use "getRanges" in default implementation of "getEndPath" to determineTed Kremenek2008-04-031-2/+12
| | | | | | the ranges of highlighted elements in the source code. llvm-svn: 49181
* Hooked up GRSimpleAPICheck and the simple Objective-C Foundation checks to useTed Kremenek2008-04-031-3/+8
| | | | | | the new BugReporter interface. llvm-svn: 49180
* Handle the case when getEndPath() returns NULL.Ted Kremenek2008-04-031-2/+8
| | | | llvm-svn: 49155
* Add back bug name to PathDiagnostic.Ted Kremenek2008-04-031-2/+1
| | | | llvm-svn: 49139
* When creating PathDiagnostics, created a trimmed graph first and report theTed Kremenek2008-04-031-1/+19
| | | | | | BFS path to the root. This also avoids problems with loops in the ExplodedGraph. llvm-svn: 49133
* Created new path-sensitive bug-reporting scheme based on the classesTed Kremenek2008-04-031-0/+262
"BugReporter" and "BugDescription". BugDescription is used to describe a bug and provide pieces of the PathDiagnostic, and BugReporter creates the actual PathDiagnostic by crawling through the ExplodedGraph. Migrated checks done by GRSimpleVals to be reported using the new BugReporter mechanism. llvm-svn: 49127
OpenPOWER on IntegriCloud