aboutsummaryrefslogtreecommitdiff
path: root/lib/Checker
AgeCommit message (Collapse)Author
2010-11-25For CFGAutomaticObjDtor, the type may be reference type, e.g., const A &c = A();Zhongxing Xu
Also apply some new coding style. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120144 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-25handle CXXFunctionalCastExpr in visitLValue and Environment.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120143 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-25Improve comments.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120142 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-25Add dump method.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120141 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-24When getting CXXThisRegion from CXXMethodDecl, use the qualifiers. This is Zhongxing Xu
to be consistent with the type of 'this' expr in the method. 此行及以下内容将会被忽略-- M test/Analysis/method-call.cpp M include/clang/Checker/PathSensitive/GRExprEngine.h M lib/Checker/GRCXXExprEngine.cpp git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120094 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-24Let StackFrameContext represent if the call expr is evaluated as lvalue.Zhongxing Xu
This is required for supporting const reference to temporary objects. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120093 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-24Use StackFrameContext directly in CallEnter program point. Then we don't needZhongxing Xu
to remake the stackframe everytime in GRExprEngine::ProcessCallEnter(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120087 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-24Add an assert() to catch errors using EvalLoad(). Reviewed by kremenek.Zhanyong Wan
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120073 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-24Adjust method calls to reflect name changes inTed Kremenek
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120071 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-20Add comments.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119900 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-20Fix a typo in EnvironmentManager::bindExprAndLocation(). Reviewed by kremenek.Zhanyong Wan
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119899 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-20Handle CFGAutomaticObjDtor. Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119897 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-18Since multiple diagnostics can share one diagnostic client, have the client ↵Argyrios Kyrtzidis
keeping track of the total number of warnings/errors reported. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119731 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-18Refactoring of Diagnostic class.Argyrios Kyrtzidis
-Move the stuff of Diagnostic related to creating/querying diagnostic IDs into a new DiagnosticIDs class. -DiagnosticIDs can be shared among multiple Diagnostics for multiple translation units. -The rest of the state in Diagnostic object is considered related and tied to one translation unit. -Have Diagnostic point to the SourceManager that is related with. Diagnostic can now accept just a SourceLocation instead of a FullSourceLoc. -Reflect the changes to various interfaces. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119730 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-18Added method for handling CXXOperatorCallExpr differently from CallExpr if ↵Marcin Swiderski
CXXOperatorCallExpr represents method call. Also fixed returning ExpolodedNodeSet from VisitCXXMethodCallExpr. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119684 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17In EvalArguments allow for evaluation of first argument always as a lvalue. ↵Marcin Swiderski
Will be used for CXXOperatorCallExpr that represents method call. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119567 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17Add skeleton for handling various cfg dtors.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119491 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17do not do post checks. Because at this point we just enter the call.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119480 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17Remove comments. We are already doing actual method call by inlining it.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119477 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17Added mapping from 'this' to it's SymbolicRegion in ↵Marcin Swiderski
BasicStoreManager::getInitialStore. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119467 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17Add comments.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119436 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-16Static analyzer: Catch calls to malloc() withTed Kremenek
allocation sizes of 0 bytes. Fixes PR 2899. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119364 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-16Reverting r119341: doesn't compile, no obvious fix.John McCall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119342 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-16Refactored GRExprEngine::getCXXThisRegion to use CXXMethodDecl::getThisType ↵Marcin Swiderski
instead of calculating it by hand. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119341 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-16Handle member initializer in C++ ctor. Zhongxing Xu
- Add a new Kind of ProgramPoint: PostInitializer. - Still use GRStmtNodeBuilder. But special handling PostInitializer in GRStmtNodeBuilder::GenerateAutoTransition(). - Someday we should clean up the interface of GRStmtNodeBuilder. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119335 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-16Basic support for C++ in BasicStore:Marcin Swiderski
- CXXThisRegion treated like VarRegion and ObjCIVarRegion in various places, - Reference treated like pointer in BindDeclInternal. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119333 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-16Kill CK_Unknown and flesh out the documentation for the existing CastKinds.John McCall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119331 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-15Add a new expression kind, OpaqueValueExpr, which is useful forJohn McCall
certain internal type-checking procedures as well as for representing certain implicitly-generated operations. Uses to follow. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119289 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-15Adds a README for the Clang static analyzer to document its design and work ↵Zhanyong Wan
flow. The contents are taken from email notes by kremenek and xuzhongxing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119288 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-15Relax assertion in SValuator so that we don't crash when analyzing a call ↵Ted Kremenek
via a function pointer that casts the return value to something completely different. While we need better reasoning here, we should definately not crash. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119177 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-15Assorted work leading towards the elimination of CK_Unknown.John McCall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119138 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-15Add skeleton for handling other kinds of CFGElements.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119135 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-14Add a few more complex-related cast kinds that arise due to arbitraryJohn McCall
implicit conversions; the last batch was specific to promotions. I think this is the full set we need. I do think dividing the cast kinds into floating and integral is probably a good idea. Annotate a *lot* more C casts with useful cast kinds. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119036 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-13Introduce five new cast kinds for various conversions into andJohn McCall
between complex types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118994 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-13Refine IdempotentOperationChecker::PathWasCompletelyAnalyzed() to also checkTed Kremenek
BlockEdges, BlockEntrances, and BlockExits for the target block value. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118984 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-13Teach IdempotentOperations::PathWasCompletelyAnalyzed to also consider items ↵Ted Kremenek
remaining in the worklist that could have impacted the evaluation of a block. Fixes <rdar://problem/8663596>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118983 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-13Add GRWorkList::VisitItemsInWorkList() to allow a client to introspect the ↵Ted Kremenek
contents of a worklist. This API required changing the BFS worklist to use a deque instead of a queue, but that is better for performance reasons anyway. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118982 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-13Introduce a null-to-pointer implicit cast kind.John McCall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118966 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-12Make sure to always check the result ofDouglas Gregor
SourceManager::getPresumedLoc(), so that we don't try to make use of an invalid presumed location. Doing so can cause crashes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118885 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-11RegionStore/BasicStore: do not return UndefinedVal for accesses to concrete ↵Ted Kremenek
addresses; instead return UnknownVal. This leads it up to checkers (e.g., DereferenceChecker) to guard against illegal accesses (e.g., null dereferences). Fixes PR 5272 and <rdar://problem/6839683>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118852 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09Teach AttrNonNullChecker about transparent unions. Fixes crash reported in ↵Ted Kremenek
<rdar://problem/8642434>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118473 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-08Only enable the ObjCAtSyncChecker when the translation unit uses Objective-C.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118414 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-01Teach the CStringChecker and PthreadLockChecker about non-identifierDouglas Gregor
declaration names, from Jim Goodnow II! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117970 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-01Now initializer of C++ record type is visited as block-level expr. Zhongxing Xu
Let the destination of AggExprVisitor be an explicit MemRegion. Reenable the test case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117908 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-31Make Clang static analyzer skip function template definitions. This fixes ↵Zhanyong Wan
Clang PR 8426, 8427, & 8433. Reviewed by Ted Kremenek and Doug Gregor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117853 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-29Don't flag idempotent '+' or '-' warnings for pointer arithmetic (typically ↵Ted Kremenek
false positives). Fixes <rdar://problem/8601243>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117635 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-28Don't warn about unamed bitfield ivars in the ObjCUnusedIvarsChecker. Fixes ↵Ted Kremenek
<rdar://problem/8481311>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117521 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-26Fix lazy symbolication bug in RegionStore involving fields of global ↵Ted Kremenek
variables. When invalidated, the entire globals memory space gets assigned a symbolic value, but that value was not being used for lazy symbolication of fields of globals. This could result in cases where bogus null dereferences were being reported. Fixes PR 8440. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117336 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-26Move 'includeGlobals' as a field into ClusterAnalysis.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117335 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-26Tweak null dereference checker to give better diagnostics for null ↵Ted Kremenek
dereferences resulting from array accesses. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117334 91177308-0d34-0410-b5e6-96231b3b80d8