summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
* Added the notion of a "boundable region", which is a region that can have a ↵Ted Kremenek2009-03-042-7/+17
| | | | | | direct binding in the StoreManager. llvm-svn: 66005
* RegionStore: Handle implicit parameters.Ted Kremenek2009-03-041-3/+5
| | | | llvm-svn: 65987
* Create "TypedViewRegions" that layer on top of SymbolicRegions when handlingTed Kremenek2009-03-041-5/+23
| | | | | | pointer-to-pointer casts involving symbolic locations. llvm-svn: 65984
* Use GetSValAsScalarOrLoc instead of GetSVal to prevent unintended structure ↵Ted Kremenek2009-03-041-16/+16
| | | | | | or array "loads". llvm-svn: 65983
* Add "GetSValAsScalarOrLoc" methods to GRState/GRStateRef that only perform aTed Kremenek2009-03-041-2/+2
| | | | | | retrieval from the store/environment for locations or scalar types. llvm-svn: 65982
* RegionStore::RemoveDeadBindings needs to check all the symbols of the super ↵Ted Kremenek2009-03-041-0/+20
| | | | | | region of a scanned region as well. llvm-svn: 65981
* Rework use of loc::SymbolVal in the retain/release checker to use the new methodTed Kremenek2009-03-035-70/+94
| | | | | | | | | | | 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
* Don't use std::auto_ptr with getSubRegionMap().Ted Kremenek2009-03-033-7/+6
| | | | llvm-svn: 65957
* Fix case where we should use dyn_cast instead of cast.Ted Kremenek2009-03-031-1/+1
| | | | llvm-svn: 65956
* Fix extra ';' bug noticed by Mike Stump.Ted Kremenek2009-03-031-1/+1
| | | | llvm-svn: 65954
* Implement FIXME: GRStateManager::scanReachableSymbols now supports scanning ↵Ted Kremenek2009-03-034-21/+80
| | | | | | MemRegions. llvm-svn: 65919
* Add StoreManager::getSubRegionMap(). This method returns an opaque mapping ↵Ted Kremenek2009-03-032-0/+58
| | | | | | for clients of StoreManagers from MemRegions to their subregions. llvm-svn: 65914
* BugReporter: Construct path-related PathDiagnosticPieces with kind ↵Ted Kremenek2009-03-021-11/+21
| | | | | | "ControlFlow". llvm-svn: 65876
* For now, do not output the 'DisplayHint' in plist files.Ted Kremenek2009-03-021-4/+4
| | | | llvm-svn: 65860
* remove an implemented fixme.Zhongxing Xu2009-03-021-2/+0
| | | | llvm-svn: 65817
* Initial support for pointer arithmetic. Only support concrete indexes and Zhongxing Xu2009-03-022-1/+31
| | | | | | offsets for now. llvm-svn: 65814
* Rename lib/Driver (etc) to lib/Frontend in prep for the *actual*Daniel Dunbar2009-03-021-1/+1
| | | | | | driver taking lib/Driver. llvm-svn: 65811
* Rename AnonTypedRegion to TypedViewRegion.Ted Kremenek2009-03-015-17/+17
| | | | llvm-svn: 65764
* Adjust wording of bug names.Ted Kremenek2009-03-011-8/+8
| | | | llvm-svn: 65763
* Revert 65707 (causes stack memory to be referenced after it is released).Ted Kremenek2009-02-281-3/+3
| | | | llvm-svn: 65717
* remove static ctor.Chris Lattner2009-02-281-3/+3
| | | | llvm-svn: 65707
* improve compatibility with the VC++'08 C++ compiler. Patch byChris Lattner2009-02-281-1/+2
| | | | | | Niklas Larsson! llvm-svn: 65706
* When retrieving the location of a Node, for MemberExprs use the location of theTed Kremenek2009-02-271-1/+7
| | | | | | '.' or '->'. llvm-svn: 65651
* Create a new TypeNodes.def file that enumerates all of the types,Douglas Gregor2009-02-262-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | giving them rough classifications (normal types, never-canonical types, always-dependent types, abstract type representations) and making it far easier to make sure that we've hit all of the cases when decoding types. Switched some switch() statements on the type class over to using this mechanism, and filtering out those things we don't care about. For example, CodeGen should never see always-dependent or non-canonical types, while debug info generation should never see always-dependent types. More switch() statements on the type class need to be moved over to using this approach, so that we'll get warnings when we add a new type then fail to account for it somewhere in the compiler. As part of this, some types have been renamed: TypeOfExpr -> TypeOfExprType FunctionTypeProto -> FunctionProtoType FunctionTypeNoProto -> FunctionNoProtoType There shouldn't be any functionality change... llvm-svn: 65591
* PathDiagnosticPiece now automatically strips off trailing periods in ↵Ted Kremenek2009-02-261-0/+27
| | | | | | diagnostic messages. llvm-svn: 65574
* Refine some grammar in the retain/release diagnostics.Ted Kremenek2009-02-261-21/+15
| | | | llvm-svn: 65571
* Introduce code modification hints into the diagnostics system. When weDouglas Gregor2009-02-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | know how to recover from an error, we can attach a hint to the diagnostic that states how to modify the code, which can be one of: - Insert some new code (a text string) at a particular source location - Remove the code within a given range - Replace the code within a given range with some new code (a text string) Right now, we use these hints to annotate diagnostic information. For example, if one uses the '>>' in a template argument in C++98, as in this code: template<int I> class B { }; B<1000 >> 2> *b1; we'll warn that the behavior will change in C++0x. The fix is to insert parenthese, so we use code insertion annotations to illustrate where the parentheses go: test.cpp:10:10: warning: use of right-shift operator ('>>') in template argument will require parentheses in C++0x B<1000 >> 2> *b1; ^ ( ) Use of these annotations is partially implemented for HTML diagnostics, but it's not (yet) producing valid HTML, which may be related to PR2386, so it has been #if 0'd out. In this future, we could consider hooking this mechanism up to the rewriter to actually try to fix these problems during compilation (or, after a compilation whose only errors have fixes). For now, however, I suggest that we use these code modification hints whenever we can, so that we get better diagnostics now and will have better coverage when we find better ways to use this information. This also fixes PR3410 by placing the complaint about missing tokens just after the previous token (rather than at the location of the next token). llvm-svn: 65570
* 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
* Fix subtle bug in EvalEagerlyAssume: Check if the previous node was at the ↵Ted Kremenek2009-02-251-10/+17
| | | | | | same statement. llvm-svn: 65486
* Fix recently introduced switch case fallthrough bug.Ted Kremenek2009-02-251-4/+4
| | | | llvm-svn: 65485
* Add experimental logic in GRExprEngine::EvalEagerlyAssume() to handleTed Kremenek2009-02-251-3/+49
| | | | | | | | | | | expressions of the form: 'short x = (y != 10);' While we handle 'int x = (y != 10)' lazily, the cast to another integer type currently loses the symbolic constraint. Eager evaluation of the constraint causes the paths to bifurcate and eagerly evaluate 'y != 10' to a constant of 1 or 0. This should address <rdar://problem/6619921> until we have a better (more lazy approach) for handling promotions/truncations of symbolic integer values. llvm-svn: 65480
* retain/release checker: Implement basic tracking of autorelease stack. Next ↵Ted Kremenek2009-02-251-6/+26
| | | | | | thing is to wire up pools with their contents. llvm-svn: 65425
* Fix broken logic from my last commit. Branches only occur at basic blocks ↵Ted Kremenek2009-02-241-1/+1
| | | | | | that end with terminators. llvm-svn: 65410
* Fix diagnostic regression where the leak diagnostic could appear earlier in ↵Ted Kremenek2009-02-241-1/+11
| | | | | | the path than the branches taken. llvm-svn: 65407
* retain/release checker:Ted Kremenek2009-02-241-70/+38
| | | | | | | | | | | | - For autorelease pool tracking, keep information about the stack of pools separate from their contents. Also, keep track of the number of times an autorelease pool will send the "release" message to an object when the pool is destroyed. - Update CFRefCount::Update to return a new state instead of a reference count binding. This will allow us to implement more complicated semantics with autorelease pools. llvm-svn: 65384
* Fix <rdar://problem/6611677>: Add basic transfer function support in the staticTed Kremenek2009-02-242-3/+18
| | | | | | | | | analyzer for array subscript expressions involving bases that are vectors. This solution is probably a hack: it gets the lvalue of the vector instead of an rvalue like all other types. This should be reviewed (big FIXME in GRExprEngine). llvm-svn: 65366
* 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
* Add more boilerplate logic to more accurately reason about autorelease pools.Ted Kremenek2009-02-231-4/+52
| | | | | | | This doesn't change the current functionality, but better codifies the autorelease pool stack itself. llvm-svn: 65328
* Fix 80 col. violations.Ted Kremenek2009-02-231-2/+4
| | | | llvm-svn: 65322
* Per Chris L.'s suggestion, use getAsFunctionType() instead of ↵Ted Kremenek2009-02-231-5/+7
| | | | | | getDesguaredType(). Constify some pointers along the way. llvm-svn: 65321
* retain/release checker: For now don't track the retain count of NSWindow ↵Ted Kremenek2009-02-231-1/+5
| | | | | | objects (opt for false negatives). llvm-svn: 65304
* Remove typo.Ted Kremenek2009-02-231-1/+1
| | | | llvm-svn: 65302
* '[NSAutoreleasePool addObject:]' has an 'autorelease' effect, not a ↵Ted Kremenek2009-02-231-2/+2
| | | | | | DoNothing effect. llvm-svn: 65301
* Fix regression in naming convention derivation: a method only follows the ↵Ted Kremenek2009-02-221-1/+1
| | | | | | copy 'rule' if it doesn't already start with 'init', etc. llvm-svn: 65269
* Use llvm::StringsEqualNoCase instead of strncasecmp.Ted Kremenek2009-02-211-8/+5
| | | | llvm-svn: 65237
* Fix build on windows.Cedric Venet2009-02-211-0/+4
| | | | | | Should clang have a config.h or should we use the config.h of llvm or using the preprocessor is OK? I did a quick fix here, but having a guideline on how to handle non portable function would be great (or ask ted to stop breaking the windows build :)). llvm-svn: 65233
* Improved naming convention heuristics in the retain/release checker to betterTed Kremenek2009-02-211-9/+94
| | | | | | | | | handle method names that contain 'new', 'copy', etc., but those words might be the substring of larger words such as 'newsgroup' and 'photocopy' that do not indicate the allocation of objects. This should address the issues discussed in <rdar://problem/6552389>. llvm-svn: 65224
* Greatly simplify the logic in ExplodedGraphImpl::TrimGraph. Now we just do aTed Kremenek2009-02-201-111/+42
| | | | | | | | | vanilla reverse-BFS followed by a forward-DFS instead of resulting to strange histrionics (whose purpose I can no longer remember) in the reverse-BFS stage. This fixes an assertion failure in BugReporter due to edge cases where no root was being hit in the reverse-BFS phase. llvm-svn: 65160
OpenPOWER on IntegriCloud