summaryrefslogtreecommitdiffstats
path: root/clang/lib/Checker
Commit message (Collapse)AuthorAgeFilesLines
...
* Add simpler checker to check if variables captured by a block are uninitialized.Ted Kremenek2010-02-165-2/+123
| | | | llvm-svn: 96341
* Convert GRExprEngine's handling of ObjCMessageExprs to use a worklistTed Kremenek2010-02-151-202/+208
| | | | | | to evaluate arguments. llvm-svn: 96293
* clang::Attr objects should be treated as AST nodes as well byTed Kremenek2010-02-141-1/+5
| | | | | | the LLVMConventionsChecker. llvm-svn: 96202
* Add LLVM conventions check that scans for AST elements (types, stmts, decls)Ted Kremenek2010-02-141-13/+194
| | | | | | that allocate heap memory. llvm-svn: 96184
* Change LLVMConventionsChecker to accept an entire translation unit insteadTed Kremenek2010-02-141-4/+20
| | | | | | | | | | | | | | | | of operating on each code decl. This exposes two flaws in AnalysisConsumer that should eventually be fixed: (1) It is not possible to associate multiple "actions" with a single command line argument. This will require the notion of an "analysis" group, and possibly tablegen support. (although eventually we want to support dynamically loading analyses as well) (2) AnalysisConsumer may not actually be scanning the declarations in namespaces. We'll experiment first in LLVMConventionsChecker before changing the behavior in AnalysisConsumer. llvm-svn: 96183
* For the StringRef check, also visit the children of DeclStmts.Ted Kremenek2010-02-141-0/+3
| | | | llvm-svn: 96181
* Place type-checking static methods at type of file (where they will congregate).Ted Kremenek2010-02-141-33/+37
| | | | | | No functionality change. llvm-svn: 96180
* Fix pr6293. If ptr is NULL, no operation is preformed.Zhongxing Xu2010-02-141-0/+5
| | | | llvm-svn: 96154
* Add new static analyzer for checking LLVM coding conventions: ↵Ted Kremenek2010-02-142-0/+128
| | | | | | | | | | | | | -analyzer-check-llvm-conventions Currently these checks are intended to be largely syntactical, but may get more sophisticated over time. As an initial foray into this brave new world, emit a static analyzer warning when binding a temporary 'std::string' to an 'llvm::StringRef' where the lifetime of the 'std::string' does not outlive the 'llvm::StringRef'. llvm-svn: 96147
* Enhance RegionStore::InvalidateRegions() to correctly invalidate bindingsTed Kremenek2010-02-131-12/+32
| | | | | | by scanning through the values of LazyCompoundVals. llvm-svn: 96067
* Pull logic for visiting value bindings in InvalidateRegionsWorker into a ↵Ted Kremenek2010-02-131-20/+28
| | | | | | | | separate method. No functionality change. llvm-svn: 96060
* Eliminate the ASTContext parameter from RecordDecl::getDefinition()Douglas Gregor2010-02-113-3/+3
| | | | | | | and CXXRecordDecl::getDefinition(); it's totally unnecessary. No functionality change. llvm-svn: 95836
* Add comment.Zhongxing Xu2010-02-101-1/+2
| | | | llvm-svn: 95755
* Fix lookup of fields from lazy bindings to check if the region isTed Kremenek2010-02-091-9/+5
| | | | | | | | NULL, not the store, to determine if a lookup succeeded. The store can be null if it contained no bindings. This fixes a false positive reported to me by a user of the analyzer. llvm-svn: 95679
* Fix -Asserts warning.Daniel Dunbar2010-02-081-1/+3
| | | | llvm-svn: 95563
* Simplify another switch/strcmp construct. No functionality/performance change.Benjamin Kramer2010-02-081-55/+16
| | | | llvm-svn: 95561
* Reapply r95546, no intended change in performance or functionality.Benjamin Kramer2010-02-082-150/+75
| | | | llvm-svn: 95552
* Revert 95546 since it changed the algorithmic characteristics of the ↵Ted Kremenek2010-02-082-74/+151
| | | | | | convention lookup. llvm-svn: 95547
* Simplify code with StringRef.Benjamin Kramer2010-02-082-151/+74
| | | | | | 3 files changed, 76 insertions(+), 153 deletions(-) llvm-svn: 95546
* Revert 95541.Ted Kremenek2010-02-0828-128/+123
| | | | llvm-svn: 95545
* Rename: GRState::getSVal(Stmt*) => getExprVal(),Zhongxing Xu2010-02-0828-123/+128
| | | | | | GRState::getSVal(MemRegion*) => Load(). llvm-svn: 95541
* BindInternal is redundant. Remove it.Zhongxing Xu2010-02-081-14/+9
| | | | llvm-svn: 95540
* Like for symbolic region, automatically create a element zero region for Zhongxing Xu2010-02-081-15/+5
| | | | | | alloca region. llvm-svn: 95539
* Unify the implementation of getLValueElement of store managers.Zhongxing Xu2010-02-084-118/+55
| | | | | | | It's more sophisticated than the original one of BasicStore. But it does matter. llvm-svn: 95536
* Unify the implementation of getLValueIvar and getLValueField of store managers.Zhongxing Xu2010-02-084-122/+36
| | | | llvm-svn: 95535
* Move common methods to the base StoreManager class.Zhongxing Xu2010-02-083-57/+0
| | | | llvm-svn: 95534
* ASTContext is now a reference member of StoreManager.Zhongxing Xu2010-02-082-3/+3
| | | | llvm-svn: 95531
* Add support for binding and retrieving VarRegions in flat store.Zhongxing Xu2010-02-081-12/+61
| | | | llvm-svn: 95529
* Also teach RegionStore::RetrieveVar() to handle 'static' pointers that are ↵Ted Kremenek2010-02-061-1/+3
| | | | | | implicitly initialized to NULL. llvm-svn: 95479
* Fix regression in RegionStore (from BasicStore) where static variables were ↵Ted Kremenek2010-02-061-3/+15
| | | | | | not treated as being implicitly initialized to 0 (and instead were getting symbolicated). llvm-svn: 95478
* Teach RegionStore::InvalidateRegions() to also invalidate static variables ↵Ted Kremenek2010-02-062-5/+6
| | | | | | referenced by blocks. llvm-svn: 95459
* More GRState* -> Store changes.Zhongxing Xu2010-02-054-23/+15
| | | | llvm-svn: 95365
* Remove unused parameter.Zhongxing Xu2010-02-052-5/+3
| | | | llvm-svn: 95364
* More GRState* -> Store changes.Zhongxing Xu2010-02-054-14/+9
| | | | llvm-svn: 95362
* More GRState* -> Store changes.Zhongxing Xu2010-02-055-173/+144
| | | | llvm-svn: 95360
* More GRState* -> Store changes.Zhongxing Xu2010-02-053-37/+32
| | | | llvm-svn: 95357
* Change LazyCompoundVal to a <Store, MemRegion*> pair. We really don't need toZhongxing Xu2010-02-053-55/+54
| | | | | | spread GRState* everywhere. llvm-svn: 95354
* Cast evaluation no longer touch GRState.Zhongxing Xu2010-02-045-44/+27
| | | | llvm-svn: 95290
* Specially handle casts to 'void' in AdjustedReturnValueChecker.Ted Kremenek2010-02-041-2/+9
| | | | llvm-svn: 95287
* Remove stray typo.Ted Kremenek2010-02-041-1/+1
| | | | llvm-svn: 95286
* Now that CastRetrievedVal returns SVal, there is no need to use CastResult.Zhongxing Xu2010-02-043-45/+27
| | | | llvm-svn: 95279
* static analyzer: handle casts of a function to a function pointer withTed Kremenek2010-02-044-1/+94
| | | | | | | | a different return type. While we don't emit any errors (yet), at least we avoid cases where we might crash because of an assertion failure later on (when the return type differs from what is expected). llvm-svn: 95268
* Add FlatStore.cpp (from r95214) to CMake build. Don't forget about it! =DChandler Carruth2010-02-031-0/+1
| | | | llvm-svn: 95215
* Add skeleton of flat store manager.Zhongxing Xu2010-02-031-0/+154
| | | | llvm-svn: 95214
* Fix regression in RegionStore due to recent changes inTed Kremenek2010-02-031-84/+90
| | | | | | | | | RegionStoreManager::InvalidateRegions() by adjusting the worklist to iterate over BindingKeys instead of MemRegions. We also only need to do the actual invalidation work on base regions, and for non-base regions just blow away their bindings. llvm-svn: 95200
* Rework RegionStoreManager's implementation of InvalidateRegions() toTed Kremenek2010-02-031-214/+249
| | | | | | | | | | | | | | | | | | | | | not build a subregion map and instead do a single scan of the store. This is done by building "region clusters" that represent the collection of regions that have the same base region. Invalidating any region in a cluster means that they all should get invalidated. This change brought out a point that Zhongxing mentioned to me offline: the flattened memory binding has issues distinguishing between direct and default bindings. For example, setting the default value for an entire struct is the same as binding to the first element. To address this problem, I moved the binding "tag" (Direct or Default) from BindingVal to BdingKey (and removed BindingVal entirely). This requires us to do double lookups in some cases; and there is still much more cleanup that can be done. This change produced a noticeable speedup when analyzing sqlite3 (a reduction of 4% in running time). llvm-svn: 95193
* Remove RegionStoreSubRegionMap::iterator and ↵Ted Kremenek2010-02-021-26/+28
| | | | | | RegionStoreSubRegionMap::begin_end(). This is a precursor to using DenseSet to represent region sets instead of ImmutableSet. llvm-svn: 95151
* Explicitly check for casts to double or complex types instead of possibly ↵Ted Kremenek2010-02-021-0/+6
| | | | | | asserting in SValuator. llvm-svn: 95128
* Fix bug in GRExprEngine::VisitSizeOfAlignOfExpr() where we do not addTed Kremenek2010-02-021-0/+2
| | | | | | | 'Pred' to 'Dst' for cases we currently don't handle. This fixes <rdar://problem/7593875>. llvm-svn: 95048
* Hoist diagnostic generation in ReturnStackAddressChecker into a separate ↵Ted Kremenek2010-02-021-58/+69
| | | | | | method. No functionality change. llvm-svn: 95037
OpenPOWER on IntegriCloud