summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/GRSimpleVals.cpp
Commit message (Collapse)AuthorAgeFilesLines
* When we have a binary expression 'int operator symbol', properly rewrite this asTed Kremenek2008-09-191-6/+16
| | | | | | | | 'symbol operator-reverse int'. This patch is a combination of code from Zhongxing Xu and myself (Zhongxing noticed this bug for the cases of relational operators). llvm-svn: 56351
* Rename ValueState -> GRState.Ted Kremenek2008-08-131-12/+12
| | | | | | Rename ValueStateManager -> GRStateManager. llvm-svn: 54721
* Moved registration of basic path-sensitive checks from GRSimpleVals.cpp to ↵Ted Kremenek2008-07-221-394/+0
| | | | | | GRExprEngineInternalChecks.cpp. llvm-svn: 53909
* Added path-sensitive checking for null pointer values passed to function ↵Ted Kremenek2008-07-221-0/+58
| | | | | | | | arguments marked nonnull. This implements <rdar://problem/6069935> llvm-svn: 53891
* Fix regression by explicitly checking if we are negating a SymIntConstantVal.Ted Kremenek2008-07-181-1/+6
| | | | llvm-svn: 53753
* Improve path-sensitivity when using the logical not operator.Ted Kremenek2008-07-181-0/+34
| | | | llvm-svn: 53752
* Renamed deterministic EvalBinOp to DetermEvalBinOpNN. This name mangling is ↵Ted Kremenek2008-07-181-2/+3
| | | | | | unfortunately needed because virtual methods with the same name can be hidden by subclasses. llvm-svn: 53751
* Created ValueStateSet class to manage the creation of multiple states by a ↵Ted Kremenek2008-07-181-3/+3
| | | | | | | | method. Modified the new EvalBinOpNN to generate states instead of nodes. This is a much simpler interface and is what clients will want to do. llvm-svn: 53750
* Fix regression introduced by ↵Ted Kremenek2008-07-161-2/+4
| | | | | | | | http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20080714/006514.html. The regression was the casts from integers to pointers where not being handled: they would just return UnknownVal. This would greatly decrease path-sensitivity. llvm-svn: 53659
* Fix transfer function logic in GRSimpleVals for integer casts: only support ↵Ted Kremenek2008-07-151-0/+4
| | | | | | | | casts from integers to integers. This fixes a crash reported by Anders Carlsson! llvm-svn: 53649
* Refactored auditor interface within GRExprEngine and GRCoreEngine to use a ↵Ted Kremenek2008-07-111-4/+4
| | | | | | "batch auditor" to dispatch to specialized auditors instead of having a separate vector for each audited Expr*. This not only provides a much cleaner implementation, but also allows us to install auditors for any expression. llvm-svn: 53464
* Refactored most of the "Store" piece of ValueState into a Store type. TheTed Kremenek2008-07-101-5/+5
| | | | | | | | | current store implementation is now encapsulated by BasicStore. These changes prompted some long due constification of ValueState. Much of the diffs in this patch include adding "const" qualifiers. llvm-svn: 53423
* Unify the code path for the Dead Stores checker to always use the ↵Ted Kremenek2008-07-021-3/+0
| | | | | | BugReporter interface. llvm-svn: 53054
* Refactored some of the BugReporter interface so that data such as the ↵Ted Kremenek2008-07-021-10/+10
| | | | | | | | ASTContext&, PathDiagnosticClient*, can be provided by an external source. Split BugReporter into BugReporter and GRBugReporter so checkers not based on GRExprEngine can still use the BugReporter mechanism. llvm-svn: 53048
* Added a simple static analysis check to look for improper uses of ↵Ted Kremenek2008-06-261-3/+7
| | | | | | CFCreateNumber. llvm-svn: 52799
* Support StringLiteralVal when comparing LVal types.Ted Kremenek2008-05-121-0/+2
| | | | llvm-svn: 50979
* Rename IsPointerType to LVal::IsLValType, and update CFRefCount::EvalSummary ↵Ted Kremenek2008-05-091-5/+5
| | | | | | to use IsLValType when conjuring symbols for return values (this fixes a bug with an assertion firing in the analyzer when two qualified objective-c types were compared). llvm-svn: 50924
* When reporting branch conditions that evaluate to an uninitialized value,Ted Kremenek2008-05-051-5/+77
| | | | | | | | | | highlight the most nested subexpression that appears most responsible (giving the user better diagnostic feedback). Updated test cases to illustrate this feature. Implements: <rdar://problem/5880443> llvm-svn: 50647
* Support implicit casts from pointers to references.Ted Kremenek2008-04-301-1/+7
| | | | llvm-svn: 50498
* Teach more of the static analyzer about ObjCQualifiedIdType.Ted Kremenek2008-04-301-6/+6
| | | | llvm-svn: 50494
* Handle lval::ArrayOffset and lval::FieldOffset in EvalNE and EvalEQ.Ted Kremenek2008-04-301-0/+10
| | | | llvm-svn: 50486
* Fixed: <rdar://problem/5881148>Ted Kremenek2008-04-231-1/+1
| | | | | | | | | | Problem: In the recently refactored VisitDeref (which processes dereferences), we were incorrectly skipping the node just generated for the subexpression of the dereference. This was a horrible regression. llvm-svn: 50176
* Added lval type (and tracking) for StringLiterals.Ted Kremenek2008-04-221-0/+4
| | | | llvm-svn: 50109
* Generalize caching mechanism for bugs reports. Now individual BugTypesTed Kremenek2008-04-181-11/+10
| | | | | | | | can decide the policy on how to cache related bugs. This allows us to properly to handle warning about multiple leaks in the same location in the ref count checker (not yet done). llvm-svn: 49918
* Simplified internal logic of BugReporter, consolidating EmitWarning andTed Kremenek2008-04-181-4/+4
| | | | | | | | EmitPathWarning into one method. We now properly handle emitting warnings without a PathDiagnosticClient when the warning does not involve a particular statement. llvm-svn: 49884
* Added some comments to GRExprEngine. Reorder some of the method definitionsTed Kremenek2008-04-151-1/+30
| | | | | | | | to start logically organizing them. Added initial plug-in transfer function support for Objective-C message expressions. llvm-svn: 49752
* Fix a compiler error on MSVC (variable name 'E' clash).Argyrios Kyrtzidis2008-04-151-1/+1
| | | | llvm-svn: 49727
* Hooked up the dead-store checker to the BugReporter interface. Now dead-storeTed Kremenek2008-04-141-43/+22
| | | | | | warnings are emitted as part of the warnings registered by GRSimpleVals. llvm-svn: 49658
* Refactored all logic to run the GRSimpleVals and CFRef checker into a commonTed Kremenek2008-04-101-28/+3
| | | | | | | | code path in the clang driver. Renamed options --grsimple to -checker-simple and -check-cfref to -checker-cfref. llvm-svn: 49500
* Fixed regressions in error reporting due to copy-paste errors (using the "begin"Ted Kremenek2008-04-101-4/+4
| | | | | | | iterator instead of "end") and not implementing "getDescription()" for Nil argument checks. llvm-svn: 49485
* Major refactoring/cleanup of GRExprEngine, ExplodedGraph, and BugReporter.Ted Kremenek2008-04-091-116/+192
| | | | | | | | | | | | | | | Bugs are now reported using a combination of "BugType" (previously BugDescription) and Bug "BugReport" objects, which are fed to BugReporter (which generates PathDiagnostics). This provides a far more modular way of registering bug types and plugging in diagnostics. GRExprEngine now owns its copy of GRCoreEngine, and is not owned by the ExplodedGraph. ExplodedGraph is no longer templated on the "checker", but instead on the state contained in the nodes. llvm-svn: 49453
* templates can't be static.Chris Lattner2008-04-061-7/+7
| | | | llvm-svn: 49258
* Better range highlight for undefined-argument checks.Ted Kremenek2008-04-031-7/+27
| | | | llvm-svn: 49184
* When reporting "bad receiver" warnings, highlight the receiver.Ted Kremenek2008-04-031-3/+20
| | | | llvm-svn: 49183
* Hooked up GRSimpleAPICheck and the simple Objective-C Foundation checks to useTed Kremenek2008-04-031-3/+4
| | | | | | the new BugReporter interface. llvm-svn: 49180
* Created new path-sensitive bug-reporting scheme based on the classesTed Kremenek2008-04-031-347/+144
| | | | | | | | | | | "BugReporter" and "BugDescription". BugDescription is used to describe a bug and provide pieces of the PathDiagnostic, and BugReporter creates the actual PathDiagnostic by crawling through the ExplodedGraph. Migrated checks done by GRSimpleVals to be reported using the new BugReporter mechanism. llvm-svn: 49127
* 80 col violationTed Kremenek2008-04-021-1/+1
| | | | llvm-svn: 49120
* Added more PathDiagnostic rendering for terminators: switch, goto, loops.Ted Kremenek2008-04-021-27/+127
| | | | llvm-svn: 49119
* Shorted bug-description.Ted Kremenek2008-04-021-1/+1
| | | | llvm-svn: 49102
* simplify some code by using PointerLikeType.Chris Lattner2008-04-021-1/+1
| | | | llvm-svn: 49101
* Beginning of some cleanups; start generating path diagnostics using objectsTed Kremenek2008-04-021-119/+152
| | | | | | that describe a bug. llvm-svn: 49086
* Added initial hacked support for display path diagnostics withTed Kremenek2008-04-021-3/+107
| | | | | | GRSimpleVals warnings. Cleaning up, but now we get multiple bubbles (branches are annotated). llvm-svn: 49077
* Patch by Argiris Kirtzidis: Fix a dangling pointer error!Ted Kremenek2008-04-011-1/+3
| | | | llvm-svn: 49057
* Do not prepend the keyword "[CHECKER]" to checker messages when usingTed Kremenek2008-03-311-2/+5
| | | | | | a PathDiagnosticClient. llvm-svn: 48996
* Include ranges in GRSimpleVals diagnostics.Ted Kremenek2008-03-311-1/+3
| | | | llvm-svn: 48990
* Inlined clang/Analysis/Analyses/GRSimpleVals.h into LocalCheckers.h and removedTed Kremenek2008-03-311-21/+25
| | | | | | | | | | GRSimpleVals.h Added a PathDiagnosticClient option to the driver functions for the CFRefCountChecker and the GRSimpleVals analysis. Both analyses now accept a "-o" argument from the driver that specifies where HTML reports should be dumped. llvm-svn: 48989
* Added path-sensitive check for return statements that return the addressTed Kremenek2008-03-311-0/+5
| | | | | | | of a stack variable. This is the path-sensitive version of a check that is already done during semantic analysis. llvm-svn: 48980
* Hooked up initial NSString interface checking to GRSimpleVals.Ted Kremenek2008-03-271-1/+1
| | | | llvm-svn: 48895
* Add creation of BasicObjCFoundationChecks when running GRSimpleVals from the ↵Ted Kremenek2008-03-271-3/+9
| | | | | | driver. llvm-svn: 48886
* GRSimple analysis now outputs additional diagnostic warnings aboutTed Kremenek2008-03-251-8/+14
| | | | | | passing an uninitialized value to a message expresion. llvm-svn: 48776
OpenPOWER on IntegriCloud