summaryrefslogtreecommitdiffstats
path: root/clang/lib/Checker/Environment.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Start migration of static analyzer to using theTed Kremenek2010-12-161-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | implicit lvalue-to-rvalue casts that John McCall recently introduced. This causes a whole bunch of logic in the analyzer for handling lvalues to vanish. It does, however, raise a few issues in the analyzer w.r.t to modeling various constructs (e.g., field accesses to compound literals). The .c/.m analysis test cases that fail are due to a missing lvalue-to-rvalue cast that will get introduced into the AST. The .cpp failures were more than I could investigate in one go, and the patch was already getting huge. I have XFAILED some of these tests, and they should obviously be further investigated. Some highlights of this patch include: - CFG no longer requires an lvalue bit for CFGElements - StackFrameContext doesn't need an 'asLValue' flag - The "VisitLValue" path from GRExprEngine has been eliminated. Besides the test case failures (XFAILed), there are surely other bugs that are fallout from this change. llvm-svn: 121960
* Rename CXXExprWithTemporaries -> ExprWithCleanups; there's no theoreticalJohn McCall2010-12-061-2/+2
| | | | | | reason this is limited to C++, and it's certainly not limited to temporaries. llvm-svn: 120996
* Rename Environment::LookupExpr() toTed Kremenek2010-12-051-1/+10
| | | | | | | Environment::lookupExpr() and move its implementation out-of-line. llvm-svn: 120969
* Although we currently have explicit lvalue-to-rvalue conversions, they'reJohn McCall2010-12-041-1/+2
| | | | | | | | | | | | | | | | | | | not actually frequently used, because ImpCastExprToType only creates a node if the types differ. So explicitly create an ICE in the lvalue-to-rvalue conversion code in DefaultFunctionArrayLvalueConversion() as well as several other new places, and consistently deal with the consequences throughout the compiler. In addition, introduce a new cast kind for loading an ObjCProperty l-value, and make sure we emit those nodes whenever an ObjCProperty l-value appears that's not on the LHS of an assignment operator. This breaks a couple of rewriter tests, which I've x-failed until future development occurs on the rewriter. Ted Kremenek kindly contributed the analyzer workarounds in this patch. llvm-svn: 120890
* Merge ValueManager into SValBuilder.Ted Kremenek2010-12-021-26/+9
| | | | llvm-svn: 120696
* handle CXXFunctionalCastExpr in visitLValue and Environment.Zhongxing Xu2010-11-251-0/+4
| | | | llvm-svn: 120143
* Improve comments.Zhongxing Xu2010-11-251-2/+1
| | | | llvm-svn: 120142
* Let StackFrameContext represent if the call expr is evaluated as lvalue.Zhongxing Xu2010-11-241-1/+12
| | | | | | This is required for supporting const reference to temporary objects. llvm-svn: 120093
* Adjust method calls to reflect name changes inTed Kremenek2010-11-241-7/+7
| | | | | | | | | | ImmutableSet/ImmtuableMap/ImmutableList APIs. Along the way, clean up some method names in the static analyzer so that they are more descriptive and/or start with lowercase letters. llvm-svn: 120071
* Fix a typo in EnvironmentManager::bindExprAndLocation(). Reviewed by kremenek.Zhanyong Wan2010-11-201-1/+2
| | | | llvm-svn: 119899
* Add optional record of "location" SVals in the environment. When we ↵Ted Kremenek2010-09-031-2/+39
| | | | | | analyzing loads/stores, we lose the location SVal, which makes it difficult to recover in some cases (e.g., for post diagnostics). This is prep for pending changes to GRExprEngine. llvm-svn: 112930
* Add an ivar to SymbolReaper for the current statement, and then stop passing ↵Jordy Rose2010-07-011-2/+2
| | | | | | the current statement around everywhere. Preparation for symbolic extents. llvm-svn: 107422
* Add support for CXXBoolLiteralExpr.Zhongxing Xu2010-04-141-0/+7
| | | | llvm-svn: 101238
* Always assume block-level expressions in the caller are alive when analyzingZhongxing Xu2010-04-051-2/+29
| | | | | | the callee. llvm-svn: 100429
* Since now we process regions in clusters when removing dead bindings, thisZhongxing Xu2010-04-051-8/+0
| | | | | | code can be removed. llvm-svn: 100428
* Checker: random include cleanup.Benjamin Kramer2010-03-271-2/+3
| | | | llvm-svn: 99731
* Remove reference to AnalysisContext in Environment. We already have ↵Zhongxing Xu2010-03-051-4/+4
| | | | | | | | LocationContext information in ExplodedNode. llvm-svn: 97785
* Split libAnalysis into two libraries: libAnalysis and libChecker.Ted Kremenek2010-01-251-0/+164
(1) libAnalysis is a generic analysis library that can be used by Sema. It defines the CFG, basic dataflow analysis primitives, and inexpensive flow-sensitive analyses (e.g. LiveVariables). (2) libChecker contains the guts of the static analyzer, incuding the path-sensitive analysis engine and domain-specific checks. Now any clients that want to use the frontend to build their own tools don't need to link in the entire static analyzer. This change exposes various obvious cleanups that can be made to the layout of files and headers in libChecker. More changes pending. :) This change also exposed a layering violation between AnalysisContext and MemRegion. BlockInvocationContext shouldn't explicitly know about BlockDataRegions. For now I've removed the BlockDataRegion* from BlockInvocationContext (removing context-sensitivity; although this wasn't used yet). We need to have a better way to extend BlockInvocationContext (and any LocationContext) to add context-sensitivty. llvm-svn: 94406
OpenPOWER on IntegriCloud