summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/CheckNSError.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Rename NSErrorCheck to NSErrorChecker.Ted Kremenek2009-11-031-241/+0
| | | | llvm-svn: 85877
* Move NullDerefChecker.h instead a 'Checkers' subdirectory.Ted Kremenek2009-10-301-1/+1
| | | | llvm-svn: 85596
* Add an assertion to ensure NullDerefChecker exists.Zhongxing Xu2009-10-291-0/+1
| | | | llvm-svn: 85497
* Move NullDeref and UndefDeref into their own checker. Zhongxing Xu2009-10-291-2/+4
| | | | | | | | Add a CheckLocation() interface to Checker. Now ImplicitNullDeref nodes are cached in NullDerefChecker. More cleanups follow. llvm-svn: 85471
* Change all the Type::getAsFoo() methods to specializations of Type::getAs().John McCall2009-09-211-2/+2
| | | | | | | | | | | Several of the existing methods were identical to their respective specializations, and so have been removed entirely. Several more 'leaf' optimizations were introduced. The getAsFoo() methods which imposed extra conditions, like getAsObjCInterfacePointerType(), have been left in place. llvm-svn: 82501
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-45/+45
| | | | llvm-svn: 81346
* Sentence-case bug category.Ted Kremenek2009-09-011-1/+1
| | | | llvm-svn: 80644
* Add LocationContext* field to VarRegion. This is needed for interprocedural ↵Ted Kremenek2009-08-211-5/+7
| | | | | | analysis. llvm-svn: 79680
* Tie the local check NSErrorCheck to a Decl to pave the wayZhongxing Xu2009-08-211-20/+20
| | | | | | to untie the ExplodedGraph from a specific Decl. llvm-svn: 79588
* Last step of template cleanup: merge *BuilderImpl to *Builder.Zhongxing Xu2009-08-061-3/+3
| | | | | | Some Builders need further cleanup. llvm-svn: 78301
* Fix typo reported in <rdar://problem/7121409>.Ted Kremenek2009-08-061-1/+1
| | | | llvm-svn: 78285
* Change uses of:Ted Kremenek2009-07-291-2/+2
| | | | | | | | | | | | | | | | | | | | Type::getAsReferenceType() -> Type::getAs<ReferenceType>() Type::getAsRecordType() -> Type::getAs<RecordType>() Type::getAsPointerType() -> Type::getAs<PointerType>() Type::getAsBlockPointerType() -> Type::getAs<BlockPointerType>() Type::getAsLValueReferenceType() -> Type::getAs<LValueReferenceType>() Type::getAsRValueReferenceType() -> Type::getAs<RValueReferenceType>() Type::getAsMemberPointerType() -> Type::getAs<MemberPointerType>() Type::getAsReferenceType() -> Type::getAs<ReferenceType>() Type::getAsTagType() -> Type::getAs<TagType>() And remove Type::getAsReferenceType(), etc. This change is similar to one I made a couple weeks ago, but that was partly reverted pending some additional design discussion. With Doug's pending smart pointer changes for Types, it seemed natural to take this approach. llvm-svn: 77510
* Per offline discussion with Steve Naroff, add back Type::getAsXXXType() methodsTed Kremenek2009-07-171-2/+2
| | | | | | | | | until Doug Gregor's Type smart pointer code lands (or more discussion occurs). These methods just call the new Type::getAs<XXX> methods, so we still have reduced implementation redundancy. Having explicit getAsXXXType() methods makes it easier to set breakpoints in the debugger. llvm-svn: 76193
* Add member template 'Type::getAs<T>', which converts a Type* to a respective T*.Ted Kremenek2009-07-161-2/+2
| | | | | | | | | | | | | | | | | | | | | This method is intended to eventually replace the individual Type::getAsXXXType<> methods. The motivation behind this change is twofold: 1) Reduce redundant implementations of Type::getAsXXXType() methods. Most of them are basically copy-and-paste. 2) By centralizing the implementation of the getAs<Type> logic we can more smoothly move over to Doug Gregor's proposed canonical type smart pointer scheme. Along with this patch: a) Removed 'Type::getAsPointerType()'; now clients use getAs<PointerType>. b) Removed 'Type::getAsBlockPointerTypE()'; now clients use getAs<BlockPointerType>. llvm-svn: 76098
* This patch includes a conceptually simple, but very intrusive/pervasive change. Steve Naroff2009-07-101-7/+13
| | | | | | | | | | | | The idea is to segregate Objective-C "object" pointers from general C pointers (utilizing the recently added ObjCObjectPointerType). The fun starts in Sema::GetTypeForDeclarator(), where "SomeInterface *" is now represented by a single AST node (rather than a PointerType whose Pointee is an ObjCInterfaceType). Since a significant amount of code assumed ObjC object pointers where based on C pointers/structs, this patch is very tedious. It should also explain why it is hard to accomplish this in smaller, self-contained patches. This patch does most of the "heavy lifting" related to moving from PointerType->ObjCObjectPointerType. It doesn't include all potential "cleanups". The good news is additional cleanups can be done later (some are noted in the code). This patch is so large that I didn't want to include any changes that are purely aesthetic. By making the ObjC types truly built-in, they are much easier to work with (and require fewer "hacks"). For example, there is no need for ASTContext::isObjCIdStructType() or ASTContext::isObjCClassStructType()! We believe this change (and the follow-up cleanups) will pay dividends over time. Given the amount of code change, I do expect some fallout from this change (though it does pass all of the clang tests). If you notice any problems, please let us know asap! Thanks. llvm-svn: 75314
* Remove more uses of GRStateRef.Ted Kremenek2009-06-171-8/+7
| | | | llvm-svn: 73648
* Simplify more code by using SVal::getAsSymbol().Ted Kremenek2009-03-301-8/+6
| | | | llvm-svn: 68052
* Overhaul BugReporter interface and implementation. The new interface cleans upTed Kremenek2009-02-041-92/+65
| | | | | | | | | | | | | | | | | | | | | 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
* Rename NamedDecl::getName() to getNameAsString(). Replace a bunch of Chris Lattner2008-11-241-1/+1
| | | | | | | | | | | uses of getName() with uses of getDeclName(). This upgrades a bunch of diags to take DeclNames instead of std::strings. This also tweaks a couple of diagnostics to be cleaner and changes CheckInitializerTypes/PerformInitializationByConstructor to pass around DeclarationNames instead of std::strings. llvm-svn: 59947
* - constify some uses of MemRegion* (MemRegion should be immutable).Ted Kremenek2008-10-171-1/+5
| | | | | | | | | - Added new region "SymbolicRegion", which maps symbol values to the region domain. - Enhanced BasicStore::getFieldLValue() to return a FieldRegion (using SymbolicRegion) - Added some utility methods to GRState for fetch svals from the store. - Fixed regression in CheckNSError (we weren't getting the value bound to the parameter) llvm-svn: 57717
* This patch did the following renaming. There should be no functional changes.Zhongxing Xu2008-10-171-5/+5
| | | | | | | | | | RVal => SVal LVal => Loc NonLVal => NonLoc lval => loc nonlval => nonloc llvm-svn: 57671
* Remove lval::FieldOffset, lval::ArrayOffset. These will be replaced with ↵Ted Kremenek2008-10-171-1/+1
| | | | | | | | | | | regions. Remove GRExprEngine::getLVal and RValues::MakeVal. Enhance StoreManager "GetLValue" methods to dispatch for specific kinds of lvalue queries, as opposed to interogating the expression tree (GRExprEngine already does this). Added FIXMEs. In particular, we no longer "assume" that a base pointer in a field/array access is null (this logic was removed). Perhaps we should do this when fetching the lvalue for fields and array elements? llvm-svn: 57657
* This is a big patch, but the functionality change is small and the rest of ↵Ted Kremenek2008-10-041-1/+1
| | | | | | | | | | | | | | the patch consists of deltas due to API changes. This patch overhauls the "memory region" abstraction that was prototyped (but never really used) as part of the Store.h. This patch adds MemRegion.h and MemRegion.cpp, which defines the class MemRegion and its subclasses. This classes serve to define an abstract representation of memory, with regions being layered on other regions to to capture the relationships between fields and variables, variables and the address space they are allocated in, and so on. The main motivation of this patch is that key parts of the analyzer assumed that all value bindings were to VarDecls. In the future this won't be the case, and this patch removes lval::DeclVal and replaces it with lval::MemRegionVal. Now all pieces of the analyzer must reason about abstract memory blocks instead of just variables. There should be no functionality change from this patch, but it opens the door for significant improvements to the analyzer such as field-sensitivity and object-sensitivity, both which were on hold until the memory abstraction got generalized. The memory region abstraction also allows type-information to literally be affixed to a memory region. This will allow the some now redundant logic to be removed from the retain/release checker. llvm-svn: 57042
* Enhance NSError** checking with analogous checking for CFErrorRef*.Ted Kremenek2008-10-011-38/+137
| | | | | | Expand checking to include functions, not just methods. llvm-svn: 56938
* Add a bug category for NSError** checks.Ted Kremenek2008-09-211-0/+2
| | | | llvm-svn: 56394
* Register the implicit null-dereferenced object as a notable symbol.Ted Kremenek2008-09-181-0/+1
| | | | llvm-svn: 56319
* Implement second part of PR 2600: NSError** parameter may be null, and ↵Ted Kremenek2008-09-181-0/+48
| | | | | | should be checked before being dereferenced. llvm-svn: 56318
* Change implementation of NSError** coding-style check to be invoked at the ↵Ted Kremenek2008-09-181-42/+76
| | | | | | end of the retain/release analysis. llvm-svn: 56312
* Implemented one of the checks requested in PR 2600:Ted Kremenek2008-09-181-0/+72
"Method accepting NSError** argument should have non-void return value to indicate that an error occurred." Test case written, but the header needs to be delta-debugged reduced. Will commit shortly. llvm-svn: 56297
OpenPOWER on IntegriCloud