summaryrefslogtreecommitdiffstats
path: root/clang/lib/Checker
Commit message (Collapse)AuthorAgeFilesLines
...
* Delete the new visitor if an old one already exists.Ted Kremenek2010-03-211-1/+3
| | | | llvm-svn: 99114
* Reapply r99024 (but with the memory issue now fixed).Ted Kremenek2010-03-202-0/+51
| | | | llvm-svn: 99064
* Check if a BugReporterVisitor has already been added to a BugReporterContext.Ted Kremenek2010-03-202-2/+31
| | | | | | This avoids redundant diagnostics. llvm-svn: 99063
* Revert r99024, "Augment path diagnostics to include displaying when a messageDaniel Dunbar2010-03-202-49/+4
| | | | | | expression", statistical evidence indicates it has some kind of memory error. llvm-svn: 99040
* Augment path diagnostics to include displaying when a message expressionTed Kremenek2010-03-202-4/+49
| | | | | | is not evaluated because the receiver is nil. llvm-svn: 99024
* Refactor argument checking in CallAndMessageChecker to be the sameTed Kremenek2010-03-181-119/+123
| | | | | | for both CallExprs and ObjCMessageExprs. llvm-svn: 98800
* Detect pass-by-value arguments that are structs that containTed Kremenek2010-03-181-24/+113
| | | | | | uninitialized data. llvm-svn: 98796
* Tweak dead stores checker to not emit a warning when initializationTed Kremenek2010-03-181-8/+17
| | | | | | | | a scalar variable with a scalar parameter. This is a form of defensive programming. If the variable is unused, it will be caused by -Wunused-variable. llvm-svn: 98795
* Mark CXXThisRegion in the current or parent stack frame context as live so thatZhongxing Xu2010-03-175-8/+30
| | | | | | their bindings are not removed. llvm-svn: 98705
* Add VisitCXXContructExpr logic to the analyzer. This still has not fully workedZhongxing Xu2010-03-162-11/+102
| | | | | | since RemoveDeadBinding mistakenly remove the binding to CXXThisRegion. llvm-svn: 98629
* Allow users to set CPPFLAGS and CXXFLAGS on the make command line.Jeffrey Yasskin2010-03-121-1/+1
| | | | | Tested: make CPPFLAGS=-m64 CXXFLAGS=-m64 -j8 && (cd tools/clang;make test) llvm-svn: 98399
* Simplify assertion.Ted Kremenek2010-03-101-5/+1
| | | | llvm-svn: 98176
* Remove '#if 0' code. Lazy compound values have proven their worth.Ted Kremenek2010-03-101-39/+0
| | | | llvm-svn: 98175
* Remove the subregion map cache. It is no longer used.Ted Kremenek2010-03-101-8/+0
| | | | llvm-svn: 98161
* Fix stale comment.Ted Kremenek2010-03-101-1/+1
| | | | llvm-svn: 98160
* Really apply (unnoticed weird git-svn merge conflict in 98144): Refactor ↵Ted Kremenek2010-03-101-299/+290
| | | | | | | | | | | RegionStore::RemoveDeadBindings to use the same core cluster analysis algorithm as RegionStore::InvalidateRegions(). Beyond simplifying the algorithm significantly, we no longer need to build subregion maps in RemoveDeadBindings(). This and other changes cause a significant speedup: the time to analyze sqlite3.c (single core) drops by 14%. llvm-svn: 98159
* Refactor RegionStore::RemoveDeadBindings to use the same coreTed Kremenek2010-03-101-87/+87
| | | | | | | | | | | cluster analysis algorithm as RegionStore::InvalidateRegions(). Beyond simplifying the algorithm significantly, we no longer need to build subregion maps in RemoveDeadBindings(). This and other changes cause a significant speedup: the time to analyze sqlite3.c (single core) drops by 14%. llvm-svn: 98144
* Refactor some of RegionStore's InvalidateRegionsWorker classTed Kremenek2010-03-101-62/+86
| | | | | | | into a 'ClusterAnalysis' parent class. The idea is to potentially reuse this for reworking RemoveDeadBindings. llvm-svn: 98143
* Add use-after-free check to MallocChecker.Zhongxing Xu2010-03-102-1/+42
| | | | llvm-svn: 98136
* Enhance basic store to also lazily symbolicate VarRegionsTed Kremenek2010-03-101-1/+2
| | | | | | with an 'unknown' memory space. llvm-svn: 98110
* Extend ObjCMessageExpr for class method sends with the source locationDouglas Gregor2010-03-081-2/+2
| | | | | | of the class name. llvm-svn: 97943
* Remove unused headers.Duncan Sands2010-03-081-1/+0
| | | | llvm-svn: 97941
* Remove reference to AnalysisContext in Environment. We already have ↵Zhongxing Xu2010-03-055-26/+21
| | | | | | | | LocationContext information in ExplodedNode. llvm-svn: 97785
* When profiling Environment, also profile with AnalysisContext*, bacauseZhongxing Xu2010-03-043-0/+8
| | | | | | | | | | we now may have identical states with different analysis context. Set the right AnalysisContext in state when entering and leaving a callee. With both of the above changes, we can pass the test case. llvm-svn: 97724
* [CFG]Ted Kremenek2010-03-021-19/+29
| | | | | | | | | | | | | | | | | | | After discussion with Zhongxing, don't force the initializer of DeclStmts to be block-level expressions. This led to some interesting fallout: [UninitializedValues] Always visit the initializer of DeclStmts (do not assume they are block-level expressions). [BasicStore] With initializers of DeclStmts no longer block-level expressions, this causes self-referencing initializers (e.g. 'int x = x') to no longer cause the initialized variable to be live before the DeclStmt. While this is correct, it caused BasicStore::RemoveDeadBindings() to prune off the values of these variables from the initial store (where they are set to uninitialized). The fix is to back-port some (and only some) of the lazy-binding logic from RegionStore to BasicStore. Now the default values of local variables are determined lazily as opposed to explicitly initialized. llvm-svn: 97591
* Don't conjure a symbol for DeclStmts when the variable is a C++ reference.Ted Kremenek2010-03-021-5/+5
| | | | llvm-svn: 97590
* Since now we store the cast type with an ElementRegion, there isZhongxing Xu2010-03-015-27/+17
| | | | | | no need to store a type with SymbolRegionValue. llvm-svn: 97437
* Assert when loading from a code text region instead of returning an unknown ↵Zhongxing Xu2010-03-011-1/+3
| | | | | | silently. llvm-svn: 97436
* Use getBody() to get the function definition when the decl referenced is notZhongxing Xu2010-02-281-1/+1
| | | | | | definition. llvm-svn: 97373
* Use a GDM to record the returned expression in the state when VisitReturnStmt.Zhongxing Xu2010-02-261-10/+28
| | | | | | | | | | | Use this information to find the returned value and bind it to CallExpr in ProcessCallExit. And there is no need to remove dead bindings in ProcessCallExit, because a. it would clean up the return value bound to CallExpr b. we still would do it in the next ProcessStmt(), where we would not misclean up the return value. llvm-svn: 97225
* Remove derelict GRStmtNodeBuilder::LastNode.Zhongxing Xu2010-02-262-5/+3
| | | | llvm-svn: 97207
* Restore Zhongxing's commits r97122 r97127 r97129 r97131 which were reverted ↵Douglas Gregor2010-02-253-74/+140
| | | | | | due to a Clang-on-Clang failure llvm-svn: 97162
* Revert patches r97122 r97127 r97129 r97131.Jakob Stoklund Olesen2010-02-253-140/+74
| | | | | | They were breaking clang-x86_64-darwin10-selfhost llvm-svn: 97138
* Move the GenerateCallExitNode logic completely into GREndPathNodeBuilder.Zhongxing Xu2010-02-252-16/+7
| | | | llvm-svn: 97131
* Move the dead bindings removal logic from CallInliner to ↵Zhongxing Xu2010-02-253-15/+19
| | | | | | GRExprEngine::ProcessCallExit(). llvm-svn: 97129
* Add comments.Zhongxing Xu2010-02-251-1/+3
| | | | llvm-svn: 97127
* Call inliner improvements:Zhongxing Xu2010-02-253-50/+119
| | | | | | | | | | | | | | This patch implements the CallEnter/CallExit idea of Ted. Add two interfaces to GRSubEngine: ProcessCallEnter, ProcessCallExit. The CallEnter program point uses caller's location context. The CallExit program point uses callee's location context. CallEnter is built by GRStmtNodeBuilder. CallExit is built by GREndPathNodeBuilder. llvm-svn: 97122
* Add MacOSXAPIChecker, a meta checker to include various precondition checks ↵Ted Kremenek2010-02-254-0/+144
| | | | | | | | | | | | for calls to various MacOS X functions. The checks in BasicObjCFoundationChecks.cpp will gradually be migrated here. As a first check, check that when 'dispatch_once()' is passed a predicate value that has non-local storage. llvm-svn: 97116
* When generating error node, check to see if we already cached out.Ted Kremenek2010-02-251-0/+3
| | | | llvm-svn: 97115
* Enhance the unused ivar checker to not consider an ivar to be accidentally ↵Ted Kremenek2010-02-252-16/+15
| | | | | | | | unused when it is explicitly marked as unused via __attribute__((unused)). llvm-svn: 97104
* Add UnixAPIChecker, a meta checker to include various precondition checks ↵Ted Kremenek2010-02-254-0/+154
| | | | | | | | | | | for calls to various unix/posix functions, e.g. 'open()'. As a first check, check that when 'open()' is passed 'O_CREAT' that it has a third argument. llvm-svn: 97086
* Remove stray #include.Ted Kremenek2010-02-251-1/+0
| | | | llvm-svn: 97085
* Remove #include.Ted Kremenek2010-02-251-1/+0
| | | | llvm-svn: 97084
* Divide list of registration functions in API and foundational checks. Also ↵Ted Kremenek2010-02-251-2/+6
| | | | | | trim whitespace. llvm-svn: 97083
* Sort list of checker registration functions.Ted Kremenek2010-02-251-12/+12
| | | | llvm-svn: 97082
* Dead emit dead store warnings when assigning nil to an ObjC objectTed Kremenek2010-02-231-1/+2
| | | | | | | pointer (for defensive programming). This matches the behavior with assigning NULL to a regular pointer. Fixes <rdar://problem/7631278>. llvm-svn: 96985
* Recognize attributes ns_returns_not_retained and cf_returns_not_retainedTed Kremenek2010-02-181-2/+16
| | | | | | in the static analyzer. llvm-svn: 96539
* Sort @includes.Ted Kremenek2010-02-181-11/+11
| | | | llvm-svn: 96537
* In symbol reaper, a variable is live if its stack frame is the parent of the Zhongxing Xu2010-02-172-4/+20
| | | | | | | | current stack frame. When leaving a callee, remove all bindings belonging to that callee. llvm-svn: 96473
* For inline-based inter-procedural analysis, we will have multiple stack ↵Zhongxing Xu2010-02-171-9/+16
| | | | | | space regions. Use a dense map to store them. llvm-svn: 96472
OpenPOWER on IntegriCloud