summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/GRExprEngine.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add EvalEndPath interface to Checker. Now we can check memory leaked at theZhongxing Xu2009-11-171-0/+5
| | | | | | end of the path. Need to unify interfaces. llvm-svn: 89063
* Clear the dest set.Zhongxing Xu2009-11-171-0/+1
| | | | llvm-svn: 89060
* * Do the same thing to the basicstore as in r84163.Zhongxing Xu2009-11-161-3/+10
| | | | | | | | | | * Add a load type to GRExprEngine::EvalLoad(). * When retrieve from 'theValue' of OSAtomic funcitions, use the type of the region instead of the argument expression as the load type. * Then we can convert CastRetrievedSVal to a pure assertion. In the future we can let all Retrieve() methods simply return SVal. llvm-svn: 88888
* Remove an unused parameter.Zhongxing Xu2009-11-161-3/+2
| | | | llvm-svn: 88882
* Move definition of GRExprEngine::ProcessEndPath() out-of-line.Ted Kremenek2009-11-141-0/+7
| | | | llvm-svn: 88729
* Check in a new interface of Checker, which will soon be used.Zhongxing Xu2009-11-131-1/+23
| | | | llvm-svn: 87092
* GRStateManager::CurrentStmt is not used. Remove it.Zhongxing Xu2009-11-131-4/+0
| | | | llvm-svn: 87091
* Enhance Checker class (and GRExprEngine) to support PostVisitation for ↵Ted Kremenek2009-11-121-10/+10
| | | | | | CallExprs. No clients (yet). llvm-svn: 86949
* Remove GRExprEngine::EvalCall(). It had a single callsite in GRExprEngine, ↵Ted Kremenek2009-11-121-13/+10
| | | | | | and was easily inlined. llvm-svn: 86948
* Remove some stale ErrorNodes variables in GRExprEngine and the old buffer ↵Ted Kremenek2009-11-111-0/+12
| | | | | | overflow logic in GRExprEngineInternalChecks.cpp. llvm-svn: 86877
* Add undefined array subscript checker.Zhongxing Xu2009-11-111-1/+4
| | | | llvm-svn: 86837
* Remove the old out-of-bound checking code.Zhongxing Xu2009-11-111-42/+0
| | | | llvm-svn: 86836
* Refactor DereferenceChecker to use only the new Checker API instead ofTed Kremenek2009-11-111-80/+96
| | | | | | | | | | the old builder API. This percolated a bunch of changes up to the Checker class (where CheckLocation has been renamed VisitLocation) and GRExprEngine. ProgramPoint now has the notion of a "LocationCheck" point (with PreLoad and PreStore respectively), and a bunch of the old ProgramPoints that are no longer used have been removed. llvm-svn: 86798
* Fix clang's use of DenseMap iterators after r86636 fixed their constness.Jeffrey Yasskin2009-11-101-1/+1
| | | | | | Patch by Victor Zverovich! llvm-svn: 86638
* Remove stale FIXME.Ted Kremenek2009-11-091-3/+0
| | | | llvm-svn: 86595
* Add checker for CWE-588: Attempt to Access Child of a Non-structure Pointer.Zhongxing Xu2009-11-091-6/+9
| | | | llvm-svn: 86529
* Remove Checker::CheckType() (and instead using ↵Ted Kremenek2009-11-071-16/+5
| | | | | | CheckerVisitor::PreVisitDeclStmt()), and refactor VLASizeChecker to have only one Checker subclass (not two) and to not use the node builders directly (and instead use the newer CheckerContext). llvm-svn: 86329
* static analyzer: refactor checking logic for returning the address of a ↵Ted Kremenek2009-11-061-55/+29
| | | | | | | | | stack variable or a garbage value into their own respective subclasses of Checker (and put them in .cpp files where their implementation details are hidden from GRExprEngine). llvm-svn: 86215
* Modify GRExprEngine::EvalBind() to take both a "store expression" andTed Kremenek2009-11-051-25/+18
| | | | | | | | an "assign expression", representing the expressions where the value binding occurs and the assignment takes place respectively. These are largely syntactic clues for better error reporting. llvm-svn: 86084
* Catch uses of undefined values when they are used in assignment, thus ↵Ted Kremenek2009-11-041-23/+71
| | | | | | catching such bugs closer to the source. llvm-svn: 86003
* Refactor StoreManager::BindDecl() to take a VarRegion* instead of a ↵Ted Kremenek2009-11-041-20/+23
| | | | | | VarDecl*, and modify GRExprEngine::EvalBind() to handle decl initialization as well. This paves the way for adding "checker" visitation in EvalBind(). llvm-svn: 85983
* Change GRTransferFuncs::RegisterChecks() to take a GRExprEngine& instead of ↵Ted Kremenek2009-11-031-1/+1
| | | | | | a BugReporter&. This paves the way for pulling some of the retain/release checker into a "Checker" class. llvm-svn: 85971
* Pull VLA size checker into its own files. Zhongxing Xu2009-11-031-36/+17
| | | | | | | | Split it to two checkers, one for undefined size, the other for zero size, so that we don't need to query the size when emitting the bug report. llvm-svn: 85895
* Implement: <rdar://problem/6250216> Warn against using -[NSAutoreleasePool ↵Ted Kremenek2009-11-031-6/+9
| | | | | | release] in GC mode llvm-svn: 85887
* Remove GRExprEngine::CheckerVisitLocation(). It was only called in one ↵Ted Kremenek2009-11-021-18/+10
| | | | | | place, so we inlined it in to GRExprEngine::EvalLocation(). llvm-svn: 85838
* Tighten computation of ExprVal using ?: expression. No functionality change.Ted Kremenek2009-10-301-5/+1
| | | | llvm-svn: 85618
* Make checkers run in deterministic order.Ted Kremenek2009-10-301-9/+15
| | | | llvm-svn: 85597
* Fix PR5316: make assignment expressions can be visited as lvalue. Then we Zhongxing Xu2009-10-301-25/+22
| | | | | | | can get the correct base lvalue. Revert r85578. llvm-svn: 85579
* Handle loading of field values from LazyCompoundVals in ↵Ted Kremenek2009-10-301-6/+19
| | | | | | | | GRExprEngine::VisitMemberExpr(). This fixes the crash reported in PR 5316. llvm-svn: 85578
* Move NullDeref and UndefDeref into their own checker. Zhongxing Xu2009-10-291-61/+29
| | | | | | | | Add a CheckLocation() interface to Checker. Now ImplicitNullDeref nodes are cached in NullDerefChecker. More cleanups follow. llvm-svn: 85471
* [llvm up]Douglas Gregor2009-10-291-62/+25
| | | | | | | Switch a few ugly switch-on-string-literal constructs to use the new llvm::StringSwitch. llvm-svn: 85461
* 'error' is usually used as a noreturn function. This can suppress some falseZhongxing Xu2009-10-261-11/+4
| | | | | | | warnings. Eventually we need a way to import externally defined functions summaries. llvm-svn: 85092
* Eliminate QualifiedDeclRefExpr, which captured the notion of aDouglas Gregor2009-10-231-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | qualified reference to a declaration that is not a non-static data member or non-static member function, e.g., namespace N { int i; } int j = N::i; Instead, extend DeclRefExpr to optionally store the qualifier. Most clients won't see or care about the difference (since QualifierDeclRefExpr inherited DeclRefExpr). However, this reduces the number of top-level expression types that clients need to cope with, brings the implementation of DeclRefExpr into line with MemberExpr, and simplifies and unifies our handling of declaration references. Extended DeclRefExpr to (optionally) store explicitly-specified template arguments. This occurs when naming a declaration via a template-id (which will be stored in a TemplateIdRefExpr) that, following template argument deduction and (possibly) overload resolution, is replaced with a DeclRefExpr that refers to a template specialization but maintains the template arguments as written. llvm-svn: 84962
* Simplify some code. No functionality change.Zhongxing Xu2009-10-211-55/+43
| | | | llvm-svn: 84757
* PR5218: Replace IdentifierInfo::getName with StringRef version, now that clientsDaniel Dunbar2009-10-181-1/+1
| | | | | | are updated. llvm-svn: 84447
* Move misc clients to IdentifierInfo StringRef API.Daniel Dunbar2009-10-181-1/+1
| | | | | | | | | - strcmp -> == - OS.write(II->getName() ...) -> OS << II->getNameStr() - Avoid std::string concatenation - Use getNameStr().str() when an std::string is really needed. llvm-svn: 84437
* Move clients to use IdentifierInfo::getNameStart() instead of getName()Daniel Dunbar2009-10-181-3/+2
| | | | llvm-svn: 84436
* Remove dead code.Zhongxing Xu2009-10-141-13/+0
| | | | llvm-svn: 84073
* * Remove unused GRState* parameterZhongxing Xu2009-10-141-3/+3
| | | | | | * Make all Base value the last argument. llvm-svn: 84071
* Fix: <rdar://problem/7275774> Static analyzer warns about NULL pointer whenTed Kremenek2009-10-061-1/+1
| | | | | | | | | | | | | | | | | adding assert This fix required a few changes: SimpleSValuator: - Eagerly replace a symbolic value with its constant value in EvalBinOpNN when it is constrained to a constant. This allows us to better constant fold values along a path. - Handle trivial case of '<', '>' comparison of pointers when the two pointers are exactly the same. RegionStoreManager: llvm-svn: 83358
* Fix:Ted Kremenek2009-09-271-4/+5
| | | | | | | | | | | | | | | | <rdar://problem/6914474> checker doesn't realize that variable might have been assigned if a pointer to that variable was passed to another function via a structure The problem here was the RegionStoreManager::InvalidateRegion didn't invalidate the bindings of invalidated regions. This required a rewrite of this method using a worklist. As part of this fix, changed ValueManager::getConjuredSymbolVal() to require a 'void*' SymbolTag argument. This tag is used to differentiate two different symbols created at the same location. llvm-svn: 82920
* Fix PR 4988 by removing an invalid assertion (a function can be referenced inTed Kremenek2009-09-231-1/+1
| | | | | | GRExprEngine::VisitDeclRefExpr without 'asLValue' being true). llvm-svn: 82598
* Fix: <rdar://problem/7242006> [RegionStore] compound literal assignment with ↵Ted Kremenek2009-09-221-0/+1
| | | | | | floats not honored llvm-svn: 82575
* Change all the Type::getAsFoo() methods to specializations of Type::getAs().John McCall2009-09-211-1/+1
| | | | | | | | | | | Several of the existing methods were identical to their respective specializations, and so have been removed entirely. Several more 'leaf' optimizations were introduced. The getAsFoo() methods which imposed extra conditions, like getAsObjCInterfacePointerType(), have been left in place. llvm-svn: 82501
* Remove ImplicitBadDivides/ExplicitBadDivides node sets. This checking is ↵Ted Kremenek2009-09-161-6/+0
| | | | | | now down by a 'Checker' and not build into GRExprEngine. llvm-svn: 82017
* Per feedback from Eli, recognize in the transfer function logic forTed Kremenek2009-09-151-6/+12
| | | | | | | | | __builtin_offsetof in the static analyzer that __builtin_offsetof is not guaranteed to return an integer constant. We will need to shore this up later, but now at least we have correct support for when this *is* an integer constant. llvm-svn: 81830
* Add static analyzer transfer function support for __builtin_offsetof.Ted Kremenek2009-09-151-3/+8
| | | | llvm-svn: 81820
* Remove unnecessary ASTContext parameter from FunctionDecl::isBuiltinIDDouglas Gregor2009-09-121-1/+1
| | | | llvm-svn: 81590
* Introduce "DefinedOrUnknownSVal" into the SVal class hierarchy, providing a wayTed Kremenek2009-09-111-130/+107
| | | | | | | | | | | | to statically type various methods in SValuator/GRState as required either a defined value or a defined-but-possibly-unknown value. This leads to various logic cleanups in GRExprEngine, and lets the compiler enforce via type checking our assumptions about what symbolic values are possibly undefined and what are not. Along the way, clean up some of the static analyzer diagnostics regarding the uses of uninitialized values. llvm-svn: 81579
* Make AnalysisManager stateless. Now other analyzer components only depends onZhongxing Xu2009-09-101-12/+14
| | | | | | local node information. llvm-svn: 81433
OpenPOWER on IntegriCloud