summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
* GRExprEngine:Ted Kremenek2009-03-203-2/+26
| | | | | | | | - Conjure symbols at '--' and '++' unary operations - Add utility method SVal::GetConjuredSymbolVal() and constify some arguments along the way. llvm-svn: 67395
* retain/release checker: Tracking autorelease counts for objects. We're still notTed Kremenek2009-03-201-7/+48
| | | | | | completely there with accurately modeling autorelease pools. llvm-svn: 67384
* Fix PR 3836 by eagerly assuming symbolic constraints returned by unary '!'.Ted Kremenek2009-03-181-2/+10
| | | | llvm-svn: 67260
* Fix crash reported in <rdar://problem/6695527>. We now haveTed Kremenek2009-03-182-16/+19
| | | | | | | | | SVal::GetRValueSymbolVal do the checking if we can symbolicate a type instead of having BasicStoreManager do it (which wasn't always doing the check consistently). Having this check in SVal::GetRValueSymbolVal keeps the check in one centralized place. llvm-svn: 67245
* Use a work list to recursively build up the subregion mapping, and mark liveZhongxing Xu2009-03-181-9/+17
| | | | | | var region roots. llvm-svn: 67152
* Stub out some code for support for NSDeallocateObject. This is enabled yet untilTed Kremenek2009-03-171-0/+12
| | | | | | we resolve the semantics of this function when GC is enabled. llvm-svn: 67116
* retain/release checker: Add support for reasoning about -dealloc.Ted Kremenek2009-03-171-35/+128
| | | | llvm-svn: 67094
* Build system changes to use TableGen to generate the variousDouglas Gregor2009-03-162-1/+3
| | | | | | | | | | | | | | | | | | diagnostics. This builds on the patch that Sebastian committed and then revert. Major differences are: - We don't remove or use the current ".def" files. Instead, for now, we just make sure that we're building the ".inc" files. - Fixed CMake makefiles to run TableGen and build the ".inc" files when needed. Tested with both the Xcode and Makefile generators provided by CMake, so it should be solid. - Fixed normal makefiles to handle out-of-source builds that involve the ".inc" files. I'll send a separate patch to the list with Sebastian's changes that eliminate the use of the .def files. llvm-svn: 67058
* Fix PR 3677 [retain checker]: custom 'allocWithZone' methods should be allowedTed Kremenek2009-03-131-3/+6
| | | | | | to return an owning pointer. llvm-svn: 66934
* Add a hack in the analyzer to recover some path-sensitivity at branchTed Kremenek2009-03-131-1/+58
| | | | | | | | | | | | | | | | | | conditions. Currently the analyzer does not reason well about promotions/truncations of symbolic values, so at branch conditions when we see: if (condition) and condition is something like a 'short' or 'char', essentially ignore the promotion to 'int' so that we track constraints on the original symbolic value. We only ignore the casts if the underlying type has the same or fewer bits as the converted type. This fixes: <rdar://problem/6619921> llvm-svn: 66899
* Updated comment.Ted Kremenek2009-03-131-0/+2
| | | | llvm-svn: 66894
* Fix failure reported by Sebastian of test/Analysis/ptr-arith.c when the targetTed Kremenek2009-03-131-6/+7
| | | | | | | | | | is 64-bit. I used his suggestion of doing a direct bitwidth/signedness conversion of the 'offset' instead of just changing the sign. For more information, see: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2009-March/004587.html llvm-svn: 66892
* Use the correct data structures!Ted Kremenek2009-03-122-12/+12
| | | | | | | | | | | | | | | | 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-122-91/+134
| | | | | | | | | | | | | | | | - 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
* Add comments.Zhongxing Xu2009-03-121-0/+8
| | | | llvm-svn: 66782
* Use getAsRecordType() to get around sugar types.Zhongxing Xu2009-03-121-1/+1
| | | | llvm-svn: 66768
* Remove '[naming convention]' from bug type.Ted Kremenek2009-03-111-2/+2
| | | | llvm-svn: 66739
* Add TypedViewRegion::isBoundable() to indicate whether or not theTed Kremenek2009-03-111-1/+1
| | | | | | | | | | | | | | | TypedViewRegion has a valid rvalue type. Also renamed instance variable 'T' to 'LvalueType' to make it unambiguous of its purpose. This fixes some crashes I was seeing after: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20090309/013771.html This is because 'isBoundable()' is defined in TypedRegion (the parent class) in terms of the rvalue type (which could be null), while for TypedViewRegion it should be defined in terms of the lvalue type. llvm-svn: 66712
* Do not stipulate the record type is a definition in BindStruct().Zhongxing Xu2009-03-111-1/+3
| | | | llvm-svn: 66654
* Fix crash when LHS of pointer arithmetic is not ElementRegion.Zhongxing Xu2009-03-111-3/+15
| | | | llvm-svn: 66649
* RegionStore::getLValueElement: Handle the case where the signedness of theTed Kremenek2009-03-111-2/+6
| | | | | | | | offset may be different that the base. Ultimately we need a better solution for these issues, but this point-by-point fixes are gradually outlining the scope of the problem. llvm-svn: 66638
* GRExprEngine::ProcessBranch: Don't register a "pretty-stack printer" when ↵Ted Kremenek2009-03-111-7/+6
| | | | | | the Condition is null. llvm-svn: 66636
* Fix PR 3780: In one code path in BasicValueFactory::getValue() we would notTed Kremenek2009-03-111-1/+1
| | | | | | return an unsigned integer for a null pointer value. llvm-svn: 66630
* GRExprEngine: Add pretty-stack trace printing for crashes and assertion ↵Ted Kremenek2009-03-111-2/+14
| | | | | | failures. llvm-svn: 66629
* SimpleConstraintManager doesn't reason about bitwise-constraints on symbolicTed Kremenek2009-03-111-0/+13
| | | | | | | values. Indicating this in 'canReasonAbout' allows GRExprEngine to recover path-sensitivity in some cases. llvm-svn: 66628
* GRExprEngine: For places we might conjure up a new symbol to recoverTed Kremenek2009-03-111-7/+11
| | | | | | | | path-sensitivity, beyond checking to see if the value is "unknown" also check if the ConstraintManager can handle the SVal. This allows us to recover some path-sensitivity by actually discarding some information. llvm-svn: 66627
* Added method "canReasonAbout" to ConstraintManager. This method returns true ifTed Kremenek2009-03-112-0/+7
| | | | | | a ConstraintManager can usefully reason about the given SVal. llvm-svn: 66624
* Use the BugReports in BugReporter to determine the root nodes for "trim-egraph".Ted Kremenek2009-03-111-31/+15
| | | | llvm-svn: 66622
* Remove some now-unneeded calls to llvm::errs().flush().Daniel Dunbar2009-03-101-1/+1
| | | | llvm-svn: 66555
* BugReporter:Ted Kremenek2009-03-102-0/+122
| | | | | | | | | | | | - 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
* retain/release checker: Allow allocations to fail by returning nil.Ted Kremenek2009-03-091-1/+5
| | | | llvm-svn: 66487
* RegionStore::getElementLValue(): Handle the case where the base is a null ↵Ted Kremenek2009-03-091-1/+5
| | | | | | pointer. llvm-svn: 66486
* Teach GRSimpleVals::EvalNE and GRSimplVals::EvalEQ about TypedRegionViews andTed Kremenek2009-03-091-4/+41
| | | | | | | SymbolicRegions. This fixes a serious regression when checking symbolic pointers against null. llvm-svn: 66444
* Remove some dead spacing. No functionality change.Ted Kremenek2009-03-091-2/+0
| | | | llvm-svn: 66437
* Only track integer and pointer values.Zhongxing Xu2009-03-091-2/+5
| | | | llvm-svn: 66419
* Now we do not retrieve untyped regions.Zhongxing Xu2009-03-091-8/+7
| | | | llvm-svn: 66418
* Fix a serious bug in RegionStore: we got the new state with new store fromZhongxing Xu2009-03-091-4/+2
| | | | | | Bind() and BindStruct(), but we returned a state with the old store. llvm-svn: 66409
* Create PathDiagnosticPiece subclasses PathDiagnosticEventPiece andTed Kremenek2009-03-063-29/+25
| | | | | | | | 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
* Start work on subclassing PathDiagnosticPiece to distinguish more between ↵Ted Kremenek2009-03-061-0/+6
| | | | | | control-flow pieces, events, etc. llvm-svn: 66291
* Fix regression: initialize 'size' for PathDiagnostic to 0.Ted Kremenek2009-03-061-4/+14
| | | | | | Add some assertions along the way... llvm-svn: 66265
* Like PathDiagnosticPieces, strip trailing periods at the end of ↵Ted Kremenek2009-03-061-0/+14
| | | | | | PathDiagnostic descriptions llvm-svn: 66263
* Fix another GRExprEngine::VisitCast regression: handle casts of void* to ↵Ted Kremenek2009-03-051-1/+16
| | | | | | function pointers. llvm-svn: 66211
* Minor tweak: Recognize 'CGCF' prefix in addition to 'CF' and 'CG'.Ted Kremenek2009-03-051-1/+11
| | | | llvm-svn: 66208
* Fix regression in GRExprEngine::VisitCast: Do not wrap symbolic function ↵Ted Kremenek2009-03-051-23/+26
| | | | | | pointers with TypedViewRegions. llvm-svn: 66187
* Retrofit some basic tracking of ivars (for the current object) into BasicStore.Ted Kremenek2009-03-051-30/+85
| | | | llvm-svn: 66166
* Minor code compaction. No functionality change.Ted Kremenek2009-03-051-11/+5
| | | | llvm-svn: 66165
* Rename VarBindings -> Bindings.Ted Kremenek2009-03-051-15/+15
| | | | llvm-svn: 66164
* BasicStore:Ted Kremenek2009-03-053-19/+24
| | | | | | | | | | | | | - 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
* Add initial support for tracking ivars, with special handling for ivars of ↵Ted Kremenek2009-03-051-8/+33
| | | | | | 'self'. llvm-svn: 66133
* Add 'cast<>' to remove an extra function call and dynamic cast.Ted Kremenek2009-03-051-2/+2
| | | | llvm-svn: 66131
OpenPOWER on IntegriCloud