summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/BugReporter.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement function-try-blocks. However, there's a very subtle bug that I ↵Sebastian Redl2009-04-261-2/+4
| | | | | | can't track down. llvm-svn: 70155
* Minor code cleanup.Eli Friedman2009-04-261-16/+4
| | | | llvm-svn: 70144
* split ObjC and C++ Statements out into their own headers.Chris Lattner2009-04-261-2/+2
| | | | llvm-svn: 70105
* BugReporter (extensive diagnostics): Recursively adjust the referred expressionTed Kremenek2009-04-231-12/+16
| | | | | | when popping location contexts. llvm-svn: 69898
* BugReporter (extensive diagnostics): Ignore parentheses when added control-flowTed Kremenek2009-04-231-0/+16
| | | | | | pieces for location contexts. llvm-svn: 69895
* BugReporter (extensive diagnostics): Use correct location for location contexts.Ted Kremenek2009-04-221-1/+1
| | | | llvm-svn: 69824
* BugReporter (extensive diagnostics): always add an edge if there is no locationTed Kremenek2009-04-221-1/+8
| | | | | | context. llvm-svn: 69823
* BugReporter (extensive diagnostics):Ted Kremenek2009-04-221-3/+2
| | | | | | | | - Remove stale assertion that was breaking the test suite. - When popping location contexts, only add a control-flow piece for fileID locations. llvm-svn: 69814
* BugReporter (extensive diagnostic algorithm): The initial control-flow edge nowTed Kremenek2009-04-221-2/+16
| | | | | | starts from the first character of the first statement. llvm-svn: 69813
* FunctionDecl::getBody() is getting an ASTContext argument for use inDouglas Gregor2009-04-181-3/+3
| | | | | | | | lazy PCH deserialization. Propagate that argument wherever it needs to be. No functionality change, except that I've tightened up a few PCH tests in preparation. llvm-svn: 69406
* Removed some commented code.Ted Kremenek2009-04-071-16/+3
| | | | llvm-svn: 68495
* PathDiagnostic generation: experiment with avoiding generation of control-flowTed Kremenek2009-04-071-4/+4
| | | | | | pieces between block entrance and block end unless necessary. llvm-svn: 68483
* Don't overguard to adding a control-flow piece when "alwaysAdd" is true.Ted Kremenek2009-04-071-2/+2
| | | | llvm-svn: 68476
* Rewrite control-flow diagnostic generation "extensive" algorithm using "edgeTed Kremenek2009-04-061-22/+277
| | | | | | contexts". This allows us to use a stack of contexts to keep track of what control-flow pieces to include when exiting blocks like 'if', 'for', etc. llvm-svn: 68473
* Add another null pointer check. Simplify condition.Ted Kremenek2009-04-021-7/+8
| | | | llvm-svn: 68283
* Add null pointer check.Ted Kremenek2009-04-021-1/+2
| | | | llvm-svn: 68281
* BugReporter, extensive path-diagnostics: add an extra control-flow edge to theTed Kremenek2009-04-011-0/+32
| | | | | | enclosing statement when jumping to a subexpression. llvm-svn: 68244
* Fix comment.Ted Kremenek2009-04-011-1/+1
| | | | llvm-svn: 68236
* BugReporter: for extensive path diagnostics:Ted Kremenek2009-04-011-11/+9
| | | | | | | | - When processing BlockEdges with terminators, using the condition as the control-flow point for terminators that are expressions (e.g., '&&', '?') - When processing events, allow intra-compound statement "jumping" llvm-svn: 68228
* BugReporter: for extensive PathDiagnostic generation, add control-flow from theTed Kremenek2009-04-011-1/+17
| | | | | | start of the function/method. llvm-svn: 68217
* BugReporter: For the "extensive" PathDiagnostic generation algorithm, elide mostTed Kremenek2009-04-011-13/+21
| | | | | | | intra-compound statement jumps unless they are between terminators (i.e., branches). llvm-svn: 68216
* - Changed PathDiagnosticPiece::getLocation() to return a PathDiagnosticLocationTed Kremenek2009-04-011-5/+168
| | | | | | | | | instead of a FullSourceLoc. This resulted in a bunch of small edits in various clients. - Updated BugReporter to include an alternate PathDiagnostic generation algorithm for PathDiagnosticClients desiring more control-flow pieces. llvm-svn: 68193
* More code reshuffling. No functionality change.Ted Kremenek2009-03-311-465/+465
| | | | llvm-svn: 68157
* Allow two codepaths for PathDiagnostic generation. This patch mainly consists ofTed Kremenek2009-03-311-41/+77
| | | | | | refactoring to make this possible (no functionality change). llvm-svn: 68141
* Simplify more code by using SVal::getAsSymbol().Ted Kremenek2009-03-301-9/+4
| | | | llvm-svn: 68052
* Convert use of loc::SymbolVal and nonloc::SymbolVal to V.getAsSymbol(). ThisTed Kremenek2009-03-301-11/+4
| | | | | | | also makes this code more correct as it transparently handles SVals that wrapped TypedViewRegions(SymbolicRegions). llvm-svn: 68048
* Adjust control-flow endpoints for '&&' and '||'.Ted Kremenek2009-03-281-17/+49
| | | | llvm-svn: 67948
* Text PathDiagnosticBuilder::getEnclosingStmt() about '?'Ted Kremenek2009-03-281-2/+19
| | | | llvm-svn: 67909
* Teach PathDiagnosticBuilder::getEnclosingStmtLocation() about while/if/do/for,Ted Kremenek2009-03-281-2/+30
| | | | | | | etc., so that the "body" is always considered a top-level statement for edge transitions (even if it is an expression). llvm-svn: 67901
* BugReporter: For control-flow edges from 'if', 'for', 'do', 'while' toTed Kremenek2009-03-271-4/+40
| | | | | | | successor, using 'getEnclosingStmt()' to have the end location be the top-level Stmt* enclosing the target Expr*. llvm-svn: 67869
* BugReporter: PathDiagnosticBuilder::ExecutionContinues now returns aTed Kremenek2009-03-271-39/+43
| | | | | | PathDiagnosticLocation. llvm-svn: 67866
* BugReporter:Ted Kremenek2009-03-271-31/+78
| | | | | | | | - Added an internal helper class 'PathDiagnosticBuilder' which now bundles the 'ExecutionContinues' methods. - Added preliminary diagnostics for short-circuit '&&' and '||' llvm-svn: 67822
* - Add class PathDiagosticLocationPair.Ted Kremenek2009-03-261-22/+22
| | | | | | - Have PathDiagnosticControlFlowPiece use a vector of PathDiagnosticLocationPairs to represent transitions. llvm-svn: 67786
* analyzer infrastructure: make a bunch of changes to symbolic expressions thatTed Kremenek2009-03-261-3/+3
| | | | | | | | | | | | | | | | Zhongxing and I discussed by email. Main changes: - Removed SymIntConstraintVal and SymIntConstraint - Added SymExpr as a parent class to SymbolData, SymSymExpr, SymIntExpr - Added nonloc::SymExprVal to wrap SymExpr - SymbolRef is now just a typedef of 'const SymbolData*' - Bunch of minor code cleanups in how some methods were invoked (no functionality change) This changes are part of a long-term plan to have full symbolic expression trees. This will be useful for lazily evaluating complicated expressions. llvm-svn: 67731
* Use the correct data structures!Ted Kremenek2009-03-121-7/+9
| | | | | | | | | | | | | | | | ExplodedGraph::TrimGraph: - Just do a DFS both ways instead of BFS-DFS. We're just determining what subset of the nodes are reachable from the root and reverse-reachable from the bug nodes. DFS is more efficient for this task. BugReporter: - MakeReportGraph: Do a reverse-BFS instead of a reverse-DFS to determine the approximate shortest path through the simulation graph. We were seeing some weird cases where too many loops were being reported for simple bugs. Possibly we will need to replace this with actually computing the shortest path in terms of line numbers. llvm-svn: 66842
* PathDiagnostics:Ted Kremenek2009-03-121-91/+127
| | | | | | | | | | | | | | | | - PathDiagnosticControlFlowPiece now consists of a "start" and "end" location to indicating the branch location and where the branch goes. BugReporter: - Updated BugReporter to construct PathDiagnosticControlFlowPiece objects with "end" locations. PlistDiagnostics: - Plists now contain the bug "type" (not just bug "category") - Plists now encode control-flow pieces differently than events; now the "start" and "end" locations are recorded llvm-svn: 66818
* BugReporter:Ted Kremenek2009-03-101-0/+96
| | | | | | | | | | | | - Group control flow and event PathDiagnosticPieces into PathDiagnosticMacroPieces. - Afterwards, eliminate any PathDiagnosticMacroPieces from a PathDiagnostic that contain no informative events. HTMLDiagnostics: - Use new information about PathDiagnosticMacroPieces to specially format message bubbles for macro expansions containing interesting events. llvm-svn: 66524
* Create PathDiagnosticPiece subclasses PathDiagnosticEventPiece andTed Kremenek2009-03-061-25/+19
| | | | | | | | PathDiagnosticControlFlowPiece to distinguish (in the class hierarchy) between events and control-flow diagnostic pieces. Clients must now use these directly when constructing PathDiagnosticPieces. llvm-svn: 66310
* BasicStore:Ted Kremenek2009-03-051-2/+4
| | | | | | | | | | | | | - Store bindings using a MemRegion -> SVal binding instead of VarDecl -> SVal binding. This mirrors some of the idea of RegionStore, but is far simpler and not nearly as functional. This leads to some code simplification and some potential for some minor precision hacks. Along the way... - constify the use of MemRegion* in a few places - add operator<<(llvm::raw_ostream, const MemRegion*) llvm-svn: 66163
* Rework use of loc::SymbolVal in the retain/release checker to use the new methodTed Kremenek2009-03-031-1/+1
| | | | | | | | | | | SVal::getAsLocSymbol(). This simplifies the code and allows the retain/release checker to (I believe) also correctly reason about location symbols wrapped in SymbolicRegions. Along the way I cleaned up SymbolRef a little, disallowing implicit casts to 'unsigned'. llvm-svn: 65972
* BugReporter: Construct path-related PathDiagnosticPieces with kind ↵Ted Kremenek2009-03-021-11/+21
| | | | | | "ControlFlow". llvm-svn: 65876
* When retrieving the location of a Node, for MemberExprs use the location of theTed Kremenek2009-02-271-1/+7
| | | | | | '.' or '->'. llvm-svn: 65651
* Use Loc::IsLocType() instead of isPointerType() and isReferenceType().Ted Kremenek2009-02-261-2/+1
| | | | llvm-svn: 65568
* Drop uses of isPointerLikeType.Daniel Dunbar2009-02-261-1/+1
| | | | | | - No functionality change. llvm-svn: 65560
* Tidy up 'ExecutionContinues' to distinguish between jumping to the end of a ↵Ted Kremenek2009-02-231-17/+14
| | | | | | 'method' or 'funciton'. llvm-svn: 65346
* Tidy up the path diagnostic generation logic in BugReporter and remove a ↵Ted Kremenek2009-02-231-50/+53
| | | | | | case where an "Execution continues..." diagnostic could result in an empty message bubble. llvm-svn: 65342
* Hooked up the necessary machinery to allow the retain/release checker referenceTed Kremenek2009-02-181-10/+40
| | | | | | | | | | | | | back to the summary used when evaluating the statement associated with a simulation node. This is now being used to help improve the checker's diagnostics. To get things started, the checker now emits a path diagnostic indicating that 'autorelease' is a no-op in GC mode. Some of these changes are exposing further grossness in the interface between BugReporter and the ExplodedGraph::Trim facilities. These really need to be cleaned up one day. llvm-svn: 64881
* BugReporter: Use llvm::raw_string_stream instead of std::ostringstream.Ted Kremenek2009-02-101-29/+25
| | | | llvm-svn: 64259
* Use BugReport::getDescription() for the compiler warning text.Ted Kremenek2009-02-071-2/+2
| | | | llvm-svn: 64038
* Overhaul BugReporter interface and implementation. The new interface cleans upTed Kremenek2009-02-041-182/+196
| | | | | | | | | | | | | | | | | | | | | the ownership of BugTypes and BugReports. Now BugReports are owned by BugTypes, and BugTypes are owned by the BugReporter object. The major functionality change in this patch is that reports are not immediately emitted by a call to BugReporter::EmitWarning (now called EmitReport), but instead of queued up in report "equivalence classes". When BugReporter::FlushReports() is called, it emits one diagnostic per report equivalence class. This provides a nice cleanup with the caching of reports as well as enables the BugReporter engine to select the "best" path for reporting a path-sensitive bug based on all the locations in the ExplodedGraph that the same bug could occur. Along with this patch, Leaks are now coalesced into a common equivalence class by their allocation site, and the "summary" diagnostic for leaks now reports the allocation site as the location of the bug (this may later be augmented to also provide an example location where the leak occurs). llvm-svn: 63796
OpenPOWER on IntegriCloud