summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove ValueManager::getRegionValueSymbolValOrUnknown(). It was just extra ↵Ted Kremenek2009-12-151-7/+6
| | | | | | veneer on top of getRegionValueSymbolVal(). llvm-svn: 91471
* update to match LLVM API change:Chris Lattner2009-12-151-4/+2
| | | | | | | | | Remove isPod() from DenseMapInfo, splitting it out to its own isPodLike type trait. This is a generally useful type trait for more than just DenseMap, and we really care about whether something acts like a pod, not whether it really is a pod. llvm-svn: 91422
* Until we can make the dead stores checker smarter, dont' emit dead store ↵Ted Kremenek2009-12-151-0/+4
| | | | | | warnings for C++ objects (whose constructors/destructors have possible side-effects). llvm-svn: 91412
* Start the ball rolling on C++ support in the static analyzer. ForTed Kremenek2009-12-152-0/+37
| | | | | | | | now, don't construct CFGs that contain C++ try/catch statements, and have GRExprEngine abort a path if it encounters a C++ construct it doesn't understand (which is mostly everything at this point). llvm-svn: 91389
* Fix: <rdar://problem/7468209> SymbolManager::isLive() should not crash on ↵Ted Kremenek2009-12-143-3/+14
| | | | | | captured block variables that are passed by reference llvm-svn: 91348
* Use insert to avoid destroying existing nodes.Zhongxing Xu2009-12-141-1/+1
| | | | llvm-svn: 91258
* Add initial support for realloc() in MallocChecker.Zhongxing Xu2009-12-121-10/+82
| | | | llvm-svn: 91216
* Un-namespace-qualify llvm_unreachable. It's a macro, so the qualification gaveJeffrey Yasskin2009-12-121-1/+1
| | | | | | no extra safety anyway. llvm-svn: 91207
* Switch PathDiagnostic to StringRef.Benjamin Kramer2009-12-111-36/+13
| | | | llvm-svn: 91155
* Enhance understanding of VarRegions referenced by a block whose declarations ↵Ted Kremenek2009-12-114-10/+40
| | | | | | are outside the current stack frame. Fixes <rdar://problem/7462324>. llvm-svn: 91107
* Completely evaluate malloc/free in MallocChecker.cpp.Zhongxing Xu2009-12-111-8/+20
| | | | llvm-svn: 91100
* Use 'class' instead of 'struct'.Zhongxing Xu2009-12-111-1/+2
| | | | llvm-svn: 91085
* Fix null dereference in OSAtomicChecker and special case SymbolicRegions. ↵Ted Kremenek2009-12-091-4/+13
| | | | | | We still aren't handling them correctly; I've added to failing test cases to test/Analysis/NSString-failed-cases.m that should pass and then be merged in to test/Analysis/NSString.m. llvm-svn: 90993
* Refactor OSAtomic evaluation logic into OSAtomicChecker.Zhongxing Xu2009-12-094-151/+191
| | | | llvm-svn: 90968
* Use a temporary destination set such that we can clear fake auto transitions.Zhongxing Xu2009-12-091-3/+24
| | | | | | | | Otherwise, even when real evaluation occurs, the previous fake auto transitions would still be in the destination set, causing fake state bifurcation. llvm-svn: 90967
* OSAtomic simulation: use the original region as the location to load from,Zhongxing Xu2009-12-092-4/+7
| | | | | | | | instead of the ElementRegion obtained from casts. Test cast: the leak cannot occur bacause the true branch cannot be taken. llvm-svn: 90964
* remove dead code.Zhongxing Xu2009-12-091-41/+0
| | | | llvm-svn: 90953
* Insert instead of assign to the dest node set, since we use the dest node setZhongxing Xu2009-12-091-1/+1
| | | | | | repeatedly. llvm-svn: 90952
* Fix a horrid bug in GRExprEngine::CheckerVisit() that was identifiedTed Kremenek2009-12-091-41/+58
| | | | | | | | | by the test case in PR 5627. Essentially we shouldn't clear the ExplodedNodeSet where we deposit newly constructed nodes if that set is the 'Dst' set passed in. It is not okay to clear that set because it may already contain nodes. llvm-svn: 90931
* Refactor builtin function evaluation into a checker.Zhongxing Xu2009-12-084-8/+79
| | | | llvm-svn: 90847
* Add analysis support for blocks. This includes a few key changes:Ted Kremenek2009-12-078-184/+238
| | | | | | | | | | | | | | | | | - Refactor the MemRegion hierarchy to distinguish between different StackSpaceRegions for locals and parameters. - VarRegions for "captured" variables now have the BlockDataRegion as their super region (except those passed by reference) - Add transfer function support to GRExprEngine for BlockDeclRefExprs. This change also supports analyzing blocks as an analysis entry point (top-of-the-stack), which required pushing more context-sensitivity around in the MemRegion hierarchy via the use of LocationContext objects. Functionally almost everything is the same, except we track LocationContexts in a few more areas and StackSpaceRegions now refer to a StackFrameContext object. In the future we will need to modify MemRegionManager to allow multiple StackSpaceRegions in flight at once (for the analysis of multiple stack frames). llvm-svn: 90809
* Add EvalCallExpr interface to checker, and migrate the no-return functionZhongxing Xu2009-12-074-59/+136
| | | | | | | | | handler to this interface. GRExprEngine::CheckerEvalCall() will return true if one of the checkers has processed the node. In the future this might return void when we have some default checker. llvm-svn: 90755
* Teach AnalysisContext::getBody() about BlockDecls.Ted Kremenek2009-12-041-0/+2
| | | | llvm-svn: 90585
* Teach 'ExecutionContinues' (part of BugReporter's diagnostic generation) ↵Ted Kremenek2009-12-041-4/+13
| | | | | | about BlockDecls. llvm-svn: 90584
* Include BlockDeclRefExprs in constructed CFGs.Ted Kremenek2009-12-041-10/+0
| | | | llvm-svn: 90583
* Replace SymbolReaper::isLive(VarDecl) with SymbolReaper::isLive(VarRegion).Ted Kremenek2009-12-043-2/+6
| | | | llvm-svn: 90582
* Rename instance variable to avoid name conflict with parameters, and modify ↵Ted Kremenek2009-12-041-2/+2
| | | | | | addTransition() to compare the correct state values. llvm-svn: 90552
* Allow BlockInvocationContext to wrap either a BlockDecl* or a ↵Ted Kremenek2009-12-041-3/+16
| | | | | | BlockDataRegion*, giving us choice in our degree of context-sensitivity. llvm-svn: 90516
* Refactor LocationContext creation logic into a single member template.Ted Kremenek2009-12-041-48/+50
| | | | llvm-svn: 90509
* Refactor FoldingSet profiling code for LocationContexts, and add a new ↵Ted Kremenek2009-12-041-8/+25
| | | | | | BlockInvocationContext to represent the invocation of a block. llvm-svn: 90506
* constify MemRegion* returned by MemRegionManager::getXXXRegion() methods.Ted Kremenek2009-12-043-39/+36
| | | | llvm-svn: 90503
* More template-logic for MemRegion construction out of MemRegion.h and into ↵Ted Kremenek2009-12-041-0/+155
| | | | | | MemRegion.cpp. llvm-svn: 90499
* Tweak handling of BlockDataRegions in ↵Ted Kremenek2009-12-031-4/+6
| | | | | | RegionStoreManager::RemoveDeadBindings(): only the VarRegions for variables marked with the '__block' annotation should have their lifetime extended by a BlockDataRegion. llvm-svn: 90462
* Add security syntactic checker for mktemp.Zhongxing Xu2009-12-031-1/+41
| | | | | | Patch by Lei Zhang! llvm-svn: 90444
* Update CMake for CallGraph.cpp move.Daniel Dunbar2009-12-031-1/+0
| | | | llvm-svn: 90443
* Add value invalidation logic for block-captured variables. Conceptually ↵Ted Kremenek2009-12-032-2/+23
| | | | | | invoking a block (without specific reasoning of what the block does) can invalidate any value to it by reference when the block was created. llvm-svn: 90431
* Make BlockDataRegion::referenced_vars_iterator an actual class that enforces ↵Ted Kremenek2009-12-031-2/+4
| | | | | | that all MemRegions iterated over are VarRegions. llvm-svn: 90430
* Fix layering violation by moving Analysis/CallGraph to IndexDaniel Dunbar2009-12-031-150/+0
| | | | llvm-svn: 90424
* Add batch version of 'StoreManager::InvalidateRegion()' for invalidating ↵Ted Kremenek2009-12-033-28/+64
| | | | | | multiple regions as once. After adopting this in the CFRefCount::EvalCall(), we see a reduction in analysis time of 1.5% when analyzing all of SQLite3. llvm-svn: 90405
* Add a heuristic to the dead stores checker to prune dead stores for ↵Ted Kremenek2009-12-031-1/+2
| | | | | | variables annotated with '__block'. This is overly conservative, but now the analyzer doesn't report dead stores for variables that can be updated by a block call. llvm-svn: 90364
* Hard bifurcate the state into nil receiver and non-nil receiver, so thatZhongxing Xu2009-12-023-83/+73
| | | | | | | | | | | we don't need to use the DoneEvaluation hack when check for ObjCMessageExpr. PreVisitObjCMessageExpr() only checks for undefined receiver or arguments. Add checker interface EvalNilReceiver(). This is a 'once-and-done' interface. llvm-svn: 90296
* Provide the correct vector size for referenced variables.Ted Kremenek2009-12-011-1/+1
| | | | llvm-svn: 90267
* Fix early-return logic in scanReachableSymbols() to match the rest of the ↵Ted Kremenek2009-12-011-6/+6
| | | | | | recursive logic in the methods of ScanReachableSymbols. llvm-svn: 90245
* Eliminate another VISIBILITY_HIDDENDouglas Gregor2009-11-301-4/+1
| | | | llvm-svn: 90139
* Adapt to the DOTGraphTraits changes in LLVM.Tobias Grosser2009-11-303-4/+11
| | | | llvm-svn: 90137
* Port BugReporter and BugType to StringRef.Benjamin Kramer2009-11-298-23/+20
| | | | llvm-svn: 90086
* Kill some unnecessary calls to c_str().Benjamin Kramer2009-11-293-5/+4
| | | | llvm-svn: 90084
* Fix null dereference in UndefResultChecker identified by running the ↵Ted Kremenek2009-11-291-2/+3
| | | | | | analyzer over Postgresql. llvm-svn: 90060
* Cleanup includes and forward decls.Benjamin Kramer2009-11-282-0/+2
| | | | llvm-svn: 90034
* Remove unneeded includes.Benjamin Kramer2009-11-281-10/+2
| | | | llvm-svn: 90032
OpenPOWER on IntegriCloud