summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
* Add initial implementation of checking for uses of floating point as a loop ↵Ted Kremenek2009-07-232-0/+123
| | | | | | counter. llvm-svn: 76833
* Add 'previsit' Checker pass for ObjCMessageExprs.Ted Kremenek2009-07-231-3/+16
| | | | llvm-svn: 76831
* Improve CFG support for C++ throw expressions.Mike Stump2009-07-221-0/+21
| | | | llvm-svn: 76814
* Refactor 'PostStmt' and 'PreStmt' to subclass a common parent 'StmtPoint'.Ted Kremenek2009-07-228-67/+73
| | | | | | | | | | | | 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
* Migrate the path-sensitive checking of 'nonnull' arguments over to the newTed Kremenek2009-07-221-31/+63
| | | | | | | | | 'Checker' interface. An updated test case illustrates that after calling a function with the 'nonnull' attribute we now register the fact that the passed pointer must be non-null. This retention of information was not possible with the previously used GRSimpleAPICheck interface. llvm-svn: 76797
* Make 'SaveAndRestore' and friends reusable classes in libAnalysis.Ted Kremenek2009-07-221-12/+1
| | | | llvm-svn: 76795
* 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
* Add support for 'PreStmt' program points to GRCoreEngine and GRStmtNodeBuilder.Ted Kremenek2009-07-221-2/+5
| | | | llvm-svn: 76792
* Move bug reporter "visitors" to their own file and make them part of the publicTed Kremenek2009-07-223-326/+343
| | | | | | BugReporter API. No real functionality change. llvm-svn: 76760
* Temporarily disable most use of region casts in RegionStoreManager,Ted Kremenek2009-07-221-8/+32
| | | | | | | | | | | | | | | | instead preferring to use the a region's actual type when creating symbols and using the QualType passed to Retrieve for implicit casting. This preprocessor logic is temporary; eventually we will either remove region casts or keep them. Temporarily toggle (via preprocessor directives) that SymbolicRegions with heap storage are not undefined, but instead should be symbolicated. If we want to model that a SymbolicRegion is uninitialized, we can explicitly model that by binding UndefinedVal to that region. It turns out that we want to treat most heap objects as being defined, not the other way around. llvm-svn: 76720
* Fix a crasher in StoreManager::InvalidateRegion() caused by using theTed Kremenek2009-07-221-0/+8
| | | | | | | | | 'cast type' of a region to invalidate its binding. This only occurs when using RegionStoreManager, as it records the cast type. I'm currently considering removing the notion of a cast type (see comments in code). llvm-svn: 76719
* Fix long-lurking bug in ObjCSummaryCache revealed by Torok's recent memoryTed Kremenek2009-07-211-41/+38
| | | | | | | poisoning changes to DenseMap. We were using an iterator after it had been invalidated by an insertion into the DenseMap. llvm-svn: 76677
* Fix PR 4594 by refactoring almost all casting logic from GRExprEngine::VisitCastTed Kremenek2009-07-217-204/+200
| | | | | | | | | 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
* Remove the ASTContext parameter from Entity::getPrintableName().Argyrios Kyrtzidis2009-07-211-3/+2
| | | | llvm-svn: 76546
* Wire up CFG improvements for __builtin_choose_expr.Mike Stump2009-07-211-2/+20
| | | | llvm-svn: 76531
* Wire up CFG improvements for do { } while () when the condition is known.Mike Stump2009-07-211-7/+26
| | | | llvm-svn: 76530
* Wire up for statement CFG improvements for conditionals that are known.Mike Stump2009-07-211-10/+31
| | | | llvm-svn: 76529
* Wire up CFG improvements for while when the condition is known.Mike Stump2009-07-211-6/+26
| | | | llvm-svn: 76522
* RegionStore:Ted Kremenek2009-07-212-13/+55
| | | | | | | | | | -refactor logic for retrieving bindings from VarDecls into RegionStoreManager::RetrieveVar() - improve RegionStoreManager::CastRetrievedVal() and SimpleSValuate::EvalCastNL to better handle casts of values of the same canonical type as well as casts of LocAsInteger values. llvm-svn: 76516
* Change the semantics for Entity.Argyrios Kyrtzidis2009-07-211-6/+6
| | | | | | | | | | Entity can now refer to declarations that are not visible outside the translation unit. It is a wrapper of a pointer union, it's either a Decl* for declarations that don't "cross" translation units, or an EntityImpl* which is associated with the specific "visible" Decl. Included is a test case for handling fields across translation units. llvm-svn: 76515
* Add yet more analysis for CFGs involving conditionals that are actually ↵Mike Stump2009-07-201-25/+99
| | | | | | constant. llvm-svn: 76500
* Enhanced IsReinterpreted() (RegionStore.cpp) to reason about higher-orderTed Kremenek2009-07-201-13/+48
| | | | | | | | | | | | | pointers. Enhanced RegionStoreManager::Retrieve() to handle automatic casts when the loaded value is different from the requested value. This should be refined over time, but essentially we should always symbolicate locations as locations, and convert them to non-locations on demand. These changes now cause 'misc-ps.m' to pass again. llvm-svn: 76497
* Enhance GRExprEngine::EvalBind to handle some implicit casts from nonlocs toTed Kremenek2009-07-201-1/+18
| | | | | | locs and vis versa. llvm-svn: 76483
* Enhance SimpleSValuator to handle nonloc::LocAsInteger -> location casts.Ted Kremenek2009-07-201-3/+8
| | | | llvm-svn: 76481
* Add FIXME.Ted Kremenek2009-07-201-0/+5
| | | | llvm-svn: 76466
* Enhance GRBranchNodeBuilderImpl (part of GRCoreEngine) to understand the caseTed Kremenek2009-07-202-11/+22
| | | | | | | | 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
* Implement FIXME in pretty-printing for StringRegions.Ted Kremenek2009-07-191-3/+2
| | | | llvm-svn: 76381
* Improve debug pretty-printing for ObjCIVarRegions.Ted Kremenek2009-07-191-0/+4
| | | | llvm-svn: 76380
* Replace stmt visitors with the fall back method.Zhongxing Xu2009-07-181-21/+1
| | | | llvm-svn: 76294
* Fix crash in StoreManager::NewCastRegion() when handling casts from 'id' (or ↵Ted Kremenek2009-07-181-2/+20
| | | | | | whatever) to a BlockPointerType. llvm-svn: 76288
* Return CodeTextRegions for BlockPointerTypes in addition to ↵Ted Kremenek2009-07-181-9/+9
| | | | | | FunctionPointerTypes. llvm-svn: 76287
* Fix some fallout from CFGBuilder restructuring: all expressions that we ↵Ted Kremenek2009-07-181-20/+24
| | | | | | explicitly handle have the possibility to be block-level expressions. llvm-svn: 76277
* Fix caching bug revealed by analyzing ClamAV using RegionStore.Ted Kremenek2009-07-171-2/+1
| | | | llvm-svn: 76262
* Fix possible null dereference in CFG construction.Ted Kremenek2009-07-171-0/+1
| | | | llvm-svn: 76261
* Restructure CFG builder to have just one visitor path instead of two. The resultTed Kremenek2009-07-171-328/+407
| | | | | | | | is an algorithm that is much easier to understand and slightly more efficient. Thanks to Mike Stump for our discussions on the CFGBuilder and his comments that helped prompt this long needed cleanup. llvm-svn: 76250
* Move WalkAST logic for 'ChooseExpr' to 'VisitChooseExpr'.Ted Kremenek2009-07-171-34/+35
| | | | llvm-svn: 76205
* Move WalkAST logic for 'ConditionalOperator' into 'VisitConditionalOperator'.Ted Kremenek2009-07-171-58/+61
| | | | llvm-svn: 76202
* Remove stale comments.Ted Kremenek2009-07-171-6/+2
| | | | llvm-svn: 76196
* Per offline discussion with Steve Naroff, add back Type::getAsXXXType() methodsTed Kremenek2009-07-176-19/+19
| | | | | | | | | 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
* clean up this code, add the fixme back.Chris Lattner2009-07-171-11/+6
| | | | llvm-svn: 76180
* Rename Entity::getName() to Entity::getPrintableName() to make its purposeZhongxing Xu2009-07-171-2/+3
| | | | | | more obvious. llvm-svn: 76167
* As suggested by Argyrios, revert r76159 and make "FindImmediateParent" Zhongxing Xu2009-07-171-1/+4
| | | | | | a public static method of ASTLocation. llvm-svn: 76166
* Refactor code into a new CallExpr::getDirectCallee() method. Simplify someZhongxing Xu2009-07-172-23/+7
| | | | | | code with the new method. llvm-svn: 76164
* CallGraph: add a bunch of stmt visitors.Zhongxing Xu2009-07-171-6/+20
| | | | llvm-svn: 76161
* CallGraph:Zhongxing Xu2009-07-171-6/+12
| | | | | | | | - add IfStmt visitor. - print information only when a function has callee. Otherwise its ASTContext map is NULL. llvm-svn: 76156
* Fixup indentation of rest of switch statement to match llvm codingMike Stump2009-07-171-690/+667
| | | | | | | conventions. Also reflowed comments and removed spaces at end of lines and fixed up 80 col violations. llvm-svn: 76140
* Replaced Type::getAsLValueReferenceType(), Type::getAsRValueReferenceType(), ↵Ted Kremenek2009-07-172-2/+2
| | | | | | Type::getAsMemberPointerType(), Type::getAsTagType(), and Type::getAsRecordType() with their Type::getAs<XXX> equivalents. llvm-svn: 76139
* Make noreturn functions alter the CFG.Mike Stump2009-07-171-4/+34
| | | | llvm-svn: 76133
* Add member template 'Type::getAs<T>', which converts a Type* to a respective T*.Ted Kremenek2009-07-166-17/+17
| | | | | | | | | | | | | | | | | | | | | 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
* Move the source-level CFG from libAST to libAnalysis.Ted Kremenek2009-07-164-2/+1927
| | | | llvm-svn: 76092
OpenPOWER on IntegriCloud