summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/GRExprEngine.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement: <rdar://problem/7185647> [RegionStore] 'self' cannot be NULL ↵Ted Kremenek2009-09-091-4/+22
| | | | | | | | | | | upon entry to a method Here we implement this as a precondition within GRExprEngine, even though it is related to how BasicStoreManager and RegionStoreManager model 'self' differently. Putting this as a high-level precondition is more general, which is why it isn't in RegionStore.cpp. llvm-svn: 81378
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-624/+623
| | | | llvm-svn: 81346
* pass the correct predecessor node.Zhongxing Xu2009-09-051-1/+1
| | | | llvm-svn: 81066
* Refactor builtin function evaluation code into its own function.Zhongxing Xu2009-09-051-33/+44
| | | | llvm-svn: 81061
* move the check into MarkNoReturnFunction.Zhongxing Xu2009-09-041-2/+5
| | | | llvm-svn: 80980
* Extract mark-no-return-function code into a function.Zhongxing Xu2009-09-041-80/+84
| | | | llvm-svn: 80979
* Fix 80 column violations.Ted Kremenek2009-09-031-5/+8
| | | | llvm-svn: 80873
* Refactor the check for bad divide into a checker.Zhongxing Xu2009-09-021-64/+7
| | | | | | | | | Also fix a checker context bug: the Dst set is not always empty initially. Because in GRExprEngine::CheckerVisit(), *CurrSet is used repeatedly. So we removed the Dst.empty() condition in ~CheckerContext() when deciding whether to do autotransision. llvm-svn: 80786
* Refactor bad callee check into a Checker.Zhongxing Xu2009-09-021-14/+1
| | | | | | Now bad callee is checked as a PreVisit to the CallExpr. llvm-svn: 80771
* Eliminate CXXAdornedMemberExpr entirely. Instead, optionally allocateDouglas Gregor2009-08-311-2/+0
| | | | | | | | space within the MemberExpr for the nested-name-specifier and its source range. We'll do the same thing with explicitly-specified template arguments, assuming I don't flip-flop again. llvm-svn: 80642
* Rename CXXQualifiedMemberExpr -> CXXAdornedMemberExpr, since we willDouglas Gregor2009-08-311-2/+2
| | | | | | | also be adding explicit template arguments as an additional "adornment". No functionality change. llvm-svn: 80628
* Refactor undefined argument checking into a Checker.Zhongxing Xu2009-08-291-24/+1
| | | | llvm-svn: 80417
* Rename 'bindExpr' to 'BindExpr'.Ted Kremenek2009-08-271-52/+52
| | | | llvm-svn: 80294
* Remove a unused member variable. Instead query the option from AnalysisManager.Zhongxing Xu2009-08-271-3/+3
| | | | llvm-svn: 80226
* Simplify 'Environment' to contain only one map from 'const Stmt*' to SVals, ↵Ted Kremenek2009-08-271-75/+61
| | | | | | greatly simplifying the logic of the analyzer in many places. We now only distinguish between block-level expressions and subexpressions in Environment::RemoveDeadBindings and GRState pretty-printing. llvm-svn: 80194
* When a member reference expression includes a qualifier on the memberDouglas Gregor2009-08-261-0/+2
| | | | | | | | | | | | | | | | | name, e.g., x->Base::f() retain the qualifier (and its source range information) in a new subclass of MemberExpr called CXXQualifiedMemberExpr. Provide construction, transformation, profiling, printing, etc., for this new expression type. When a virtual function is called via a qualified name, don't emit a virtual call. Instead, call that function directly. Mike, could you add a CodeGen test for this, too? llvm-svn: 80167
* Move logic of GRExprEngine::EvalBinOp to SValuator::EvalBinOp.Ted Kremenek2009-08-251-37/+5
| | | | llvm-svn: 80018
* Remove CodeDecl and CFG from GRExprEngine and GRStateManager.Zhongxing Xu2009-08-251-63/+70
| | | | | | | Now AnalysisManager is the only place we can get CodeDecl. This leads to an API change: GRState::bindExpr() now takes the CFG argument. llvm-svn: 79980
* Remove Decl and CFG from ExplodedGraph. This leads to a series small changes.Zhongxing Xu2009-08-251-5/+5
| | | | llvm-svn: 79973
* Replace cerr with errs().Benjamin Kramer2009-08-231-3/+2
| | | | llvm-svn: 79854
* Remove 'AnalysisContext::setDecl()', as we the Decl associated with anTed Kremenek2009-08-211-2/+2
| | | | | | | AnalysisContext should never change. Along the way, propagate some constness around. llvm-svn: 79701
* Add LocationContext* field to VarRegion. This is needed for interprocedural ↵Ted Kremenek2009-08-211-9/+12
| | | | | | analysis. llvm-svn: 79680
* Get the code decl from the initial location context.Zhongxing Xu2009-08-211-1/+1
| | | | llvm-svn: 79591
* Using "ObjCImplicitSetterGetterRefExpr" instead of ↵Fariborz Jahanian2009-08-201-3/+3
| | | | | | | | "ObjCImplctSetterGetterRefExpr". A field rename and more comments. llvm-svn: 79537
* Renamed ObjCKVCRefExpr to ObjCImplctSetterGetterRefExpr.Fariborz Jahanian2009-08-181-3/+3
| | | | | | | | Removed an unnecessary loop to get to setters incoming argument. Added DoxyGen comments. Still more work to do in this area (WIP). llvm-svn: 79365
* To make the analysis independent on the locally stored liveness and cfgZhongxing Xu2009-08-171-2/+2
| | | | | | | of GRStateManager and GRExprEngine, pass the initial location context to the getInitialState() method. llvm-svn: 79228
* Extend the ProgramPoint to include the context information LocationContext,Zhongxing Xu2009-08-151-5/+8
| | | | | | | which is either a stack frame context of the function or a local scope context. llvm-svn: 79072
* Last step of template cleanup: merge *BuilderImpl to *Builder.Zhongxing Xu2009-08-061-177/+177
| | | | | | Some Builders need further cleanup. llvm-svn: 78301
* As GRState seems general enough, it is time to merge some template classes Zhongxing Xu2009-08-061-10/+10
| | | | | | | and their impl base classes. This can greatly simply some code of the core analysis engine. This patch merges ExplodedNodeImpl into ExplodedNode. llvm-svn: 78270
* If the UnaryOperator has non-location type, use its type to create theZhongxing Xu2009-08-051-2/+11
| | | | | | | | | constant value. If the UnaryOperator has location type, create the constant with int type and pointer width. This fixes the bug that all pointer increments 'p++' evaluated to Unknown. llvm-svn: 78147
* Temporarily disable out-of-bounds checking. The current checking logic will ↵Ted Kremenek2009-08-011-1/+6
| | | | | | not work quite right with the changes I'm about to commit. llvm-svn: 77779
* 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
* Fix PR 4631. The compound initializers of unions were not being evaluated, whichTed Kremenek2009-07-281-8/+2
| | | | | | | | | could cause false positives if any the subexpressions had side-effects. These initializers weren't evaluated because the StoreManager would need to handle them, but that's an orthogonal problem of whether or not the StoreManager can handle the binding. llvm-svn: 77361
* Revert r76831, there are many Analyzer test failures on multiple platforms.Daniel Dunbar2009-07-231-16/+3
| | | | | | | | --- Reverse-merging r76831 into '.': U include/clang/Analysis/PathSensitive/GRExprEngine.h U lib/Analysis/GRExprEngine.cpp llvm-svn: 76851
* Add 'previsit' Checker pass for ObjCMessageExprs.Ted Kremenek2009-07-231-3/+16
| | | | llvm-svn: 76831
* Refactor 'PostStmt' and 'PreStmt' to subclass a common parent 'StmtPoint'.Ted Kremenek2009-07-221-5/+6
| | | | | | | | | | | | Educate GRExprEngine::VisitGraph() about 'PreStmt'. Mark the constructor of 'PostStmt' to be explicit, preventing implicit conversions and the selection of the wrong 'generateNode' method in GRStmtNodeBuilder. Constify a bunch of arguments, which falls out of the changes to ProgramPoint. llvm-svn: 76809
* Add support for registering 'Checker' objects with GRExprEngine.Ted Kremenek2009-07-221-5/+48
| | | | | | Add a 'previsit' stage (that dispatches to registered Checkers) when evaluating the effects of CallExprs. llvm-svn: 76794
* Fix PR 4594 by refactoring almost all casting logic from GRExprEngine::VisitCastTed Kremenek2009-07-211-162/+29
| | | | | | | | | to SValuator::EvalCast. In the process, the StoreManagers now use this new cast machinery, and the hack in GRExprEngine::EvalBind to handle implicit casts involving OSAtomicCompareAndSwap and friends has been removed (and replaced with logic closer to the logic specific to those functions). llvm-svn: 76641
* Enhance GRExprEngine::EvalBind to handle some implicit casts from nonlocs toTed Kremenek2009-07-201-1/+18
| | | | | | locs and vis versa. llvm-svn: 76483
* Add FIXME.Ted Kremenek2009-07-201-0/+5
| | | | llvm-svn: 76466
* Enhance GRBranchNodeBuilderImpl (part of GRCoreEngine) to understand the caseTed Kremenek2009-07-201-8/+12
| | | | | | | | where the true or false CFGBlock* for a branch could be NULL. This will handle the case where we can determine during CFG construction that a branch is infeasible. llvm-svn: 76450
* Fix caching bug revealed by analyzing ClamAV using RegionStore.Ted Kremenek2009-07-171-2/+1
| | | | llvm-svn: 76262
* 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
* Two changes:Ted Kremenek2009-07-161-5/+5
| | | | | | | | | | | | | (1) Moved the SValuator object from GRExprEngine to ValueManager. This allows ValueManager to use the SValuator when creating SVals. (2) Added ValueManager::makeArrayIndex() and ValueManager::convertToArrayIndex(), two SVal creation methods that will help RegionStoreManager always have a consistent set of SVals with the same integer size and type when reasoning about array indices. llvm-svn: 75882
* Instead of recovering from a wrong invalidation, this patch aims to Zhongxing Xu2009-07-141-3/+3
| | | | | | | | invalidate the region correctly. It uses the cast-to type to invalidate the region when available. To avoid invalid cast-to type like 'void*' or 'id', region store now only records non-generic casts of regions. llvm-svn: 75580
* Handle insidious corner case exposed by RegionStoreManager when handling ↵Ted Kremenek2009-07-111-0/+13
| | | | | | | | void* values that are bound to symbolic regions and then treated like integers. llvm-svn: 75356
* Remove the ASTContext parameter from the attribute-related methods of Decl.Argyrios Kyrtzidis2009-06-301-2/+2
| | | | | | | | | The implementations of these methods can Use Decl::getASTContext() to get the ASTContext. This commit touches a lot of files since call sites for these methods are everywhere. I used pre-tokenized "carbon.h" and "cocoa.h" headers to do some timings, and there was no real time difference between before the commit and after it. llvm-svn: 74501
* Key decisions about 'bool' vs '_Bool' to be based on a new flag in langoptions.Chris Lattner2009-06-301-4/+7
| | | | | | | | | | | | This is simple enough, but then I thought it would be nice to make PrintingPolicy get a LangOptions so that various things can key off "bool" and "C++" independently. This spiraled out of control. There are many fixme's, but I think things are slightly better than they were before. One thing that can be improved: CFG should probably have an ASTContext pointer in it, which would simplify its clients. llvm-svn: 74493
* Remove '#include <sstream>' from libAnalysis.Ted Kremenek2009-06-261-1/+0
| | | | llvm-svn: 74245
OpenPOWER on IntegriCloud