summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer] Remove IdempotentOperations checker.Ted Kremenek2014-01-041-736/+0
| | | | | | | | | This checker has not been updated to work with interprocedural analysis, and actually contains both logical correctness issues but also memory bugs. We can resuscitate it from version control once there is focused interest in making it a real viable checker again. llvm-svn: 198476
* Eliminate BinaryTypeTraitExprAlp Toker2013-12-131-1/+0
| | | | | | | | | | | | | | | | | There's nothing special about type traits accepting two arguments. This commit eliminates BinaryTypeTraitExpr and switches all related handling over to TypeTraitExpr. Also fixes a CodeGen failure with variadic type traits appearing in a non-constant expression. The BTT/TT prefix and evaluation code is retained as-is for now but will soon be further cleaned up. This is part of the ongoing work to unify type traits. llvm-svn: 197273
* Fix two incorrect comments.Jordan Rose2013-09-131-2/+2
| | | | | | Patch by Jared Grubb! llvm-svn: 190652
* Make IgnoreParens() look through ChooseExprs.Eli Friedman2013-07-201-13/+2
| | | | | | | | | | | | | This is the same way GenericSelectionExpr works, and it's generally a more consistent approach. A large part of this patch is devoted to caching the value of the condition of a ChooseExpr; it's needed to avoid threading an ASTContext into IgnoreParens(). Fixes <rdar://problem/14438917>. llvm-svn: 186738
* [analyzer] Apply the suppression rules to the nil receiver only if the value ↵Anna Zaks2013-03-281-2/+2
| | | | | | | | | | | | | | participates in the computation of the nil we warn about. We should only suppress a bug report if the IDCed or null returned nil value is directly related to the value we are warning about. This was not the case for nil receivers - we would suppress a bug report that had an IDCed nil receiver on the path regardless of how it’s related to the warning. 1) Thread EnableNullFPSuppression parameter through the visitors to differentiate between tracking the value which is directly responsible for the bug and other values that visitors are tracking (ex: general tracking of nil receivers). 2) in trackNullOrUndef specifically address the case when a value of the message send is nil due to the receiver being nil. llvm-svn: 178309
* Replace ProgramPoint llvm::cast support to be well-defined.David Blaikie2013-02-211-10/+7
| | | | | | See r175462 for another example/more details. llvm-svn: 175812
* Replace SVal llvm::cast support to be well-defined.David Blaikie2013-02-201-2/+2
| | | | | | See r175462 for another example/more details. llvm-svn: 175594
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-6/+6
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Include pruning and general cleanup.Benjamin Kramer2012-12-011-0/+1
| | | | llvm-svn: 169095
* [analyzer] Rename 'EmitReport' to 'emitReport'.Jordan Rose2012-11-021-1/+1
| | | | | | No functionality change. llvm-svn: 167275
* [analyzer] Fix BugType memory leak in IdempotentOperationChecker.Tom Care2012-05-311-1/+4
| | | | llvm-svn: 157772
* Remove BlockDeclRefExpr and introduce a bit on DeclRefExpr toJohn McCall2012-03-101-1/+0
| | | | | | | | track whether the referenced declaration comes from an enclosing local context. I'm amenable to suggestions about the exact meaning of this bit. llvm-svn: 152491
* Basic: import SmallString<> into clang namespaceDylan Noblesmith2012-02-051-1/+1
| | | | | | | (I was going to fix the TODO about DenseMap too, but that would break self-host right now. See PR11922.) llvm-svn: 149799
* Move a method from IdentifierTable.h out of line and remove the SmallString ↵Benjamin Kramer2012-02-041-0/+1
| | | | | | | | include. Fix all the transitive include users. llvm-svn: 149783
* Change references to 'const ProgramState *' to typedef 'ProgramStateRef'.Ted Kremenek2012-01-261-1/+1
| | | | | | | | At this point this is largely cosmetic, but it opens the door to replace ProgramStateRef with a smart pointer that more eagerly acts in the role of reclaiming unused ProgramState objects. llvm-svn: 149081
* [analyzer] Make the entries in 'Environment' context-sensitive by making ↵Ted Kremenek2012-01-061-3/+3
| | | | | | | | | | | | | | | | | | entries map from (Stmt*,LocationContext*) pairs to SVals instead of Stmt* to SVals. This is needed to support basic IPA via inlining. Without this, we cannot tell if a Stmt* binding is part of the current analysis scope (StackFrameContext) or part of a parent context. This change introduces an uglification of the use of getSVal(), and thus takes two steps forward and one step back. There are also potential performance implications of enlarging the Environment. Both can be addressed going forward by refactoring the APIs and optimizing the internal representation of Environment. This patch mainly introduces the functionality upon when we want to build upon (and clean up). llvm-svn: 147688
* Rename AnalysisContext to AnalysisDeclContext. Not only is this name more ↵Ted Kremenek2011-10-241-11/+11
| | | | | | accurate, but it frees up the name AnalysisContext for other uses. llvm-svn: 142782
* [analyzer] Remove redundant state (AnalysisContext pointer for every ↵Anna Zaks2011-10-031-4/+9
| | | | | | BinaryOperator tracked) from IdempotentOperationChecker. llvm-svn: 141045
* Static Analyzer Diagnostics: Kill the addVisitorCreator(callbackTy, void*) ↵Anna Zaks2011-08-191-2/+2
| | | | | | | | | | | | API in favor of addVisitor(BugReporterVisitor*). 1) Create a header file to expose the predefined visitors. And move the parent(BugReporterVisitor) there as well. 2) Remove the registerXXXVisitor functions - the Visitor constructors/getters can be used now to create the object. One exception is registerVarDeclsLastStore(), which registers more then one visitor, so make it static member of FindLastStoreBRVisitor. 3) Modify all the checkers to use the new API. llvm-svn: 138126
* Remove EnhancedBugReport and RangedBugReport - pull all the extra ↵Anna Zaks2011-08-171-1/+1
| | | | | | functionality they provided into their parent BugReport. The only functional changes are: made getRanges() non const - it adds default range to Ranges if none are supplied, made getStmt() private, which was another FIXME. llvm-svn: 137894
* Rename GRState to ProgramState, and cleanup some code formatting along the way.Ted Kremenek2011-08-151-1/+1
| | | | llvm-svn: 137665
* Remove unused STL header includes.Jay Foad2011-04-231-1/+0
| | | | llvm-svn: 130068
* Fix another IdempotentOperationsChecker corner case when determining if an ↵Ted Kremenek2011-04-121-1/+1
| | | | | | | | active block on the worklist impacts the results of the check. llvm-svn: 129394
* Teach IdempotentOperationsChecker about paths aborted because ExprEngine ↵Ted Kremenek2011-04-021-3/+12
| | | | | | didn't know how to handle a specific Expr type. llvm-svn: 128761
* static analyzer: Rename 'BlocksAborted' to 'BlocksExhausted' to reflect that ↵Ted Kremenek2011-04-021-1/+1
| | | | | | a given CFGBlock was analyzed too many times. llvm-svn: 128760
* Rename class 'CFGReachabilityAnalysis' to 'CFGReverseBlockReachabilityAnalysis'.Ted Kremenek2011-03-191-3/+3
| | | | | | | | | This rename serves two purposes: - It reflects the actual functionality of this analysis. - We will have more than one reachability analysis. llvm-svn: 127930
* Remove bogus assertion in IdempotentOperationsChecker.Ted Kremenek2011-03-151-3/+2
| | | | llvm-svn: 127687
* Add support for the OpenCL vec_step operator, by generalising andPeter Collingbourne2011-03-111-3/+4
| | | | | | | extending the existing support for sizeof and alignof. Original patch by Guy Benyei. llvm-svn: 127475
* [analyzer] Rename CheckerV2 -> Checker.Argyrios Kyrtzidis2011-03-011-2/+2
| | | | llvm-svn: 126726
* [analyzer] Migrate IdempotentOperationChecker to CheckerV2.Argyrios Kyrtzidis2011-02-231-34/+24
| | | | llvm-svn: 126331
* Migrate CFGReachabilityAnalysis out of the IdempotentOperationsChecker and ↵Ted Kremenek2011-02-231-83/+8
| | | | | | into its own analysis file. llvm-svn: 126289
* Have IdempotentOperationsChecker pull its CFGStmtMap from AnalysisContext.Ted Kremenek2011-02-231-4/+1
| | | | llvm-svn: 126288
* [analyzer] Pass CheckerManager to the registration functions.Argyrios Kyrtzidis2011-02-171-1/+6
| | | | llvm-svn: 125777
* Change the representation of GNU ?: expressions to use a different expressionJohn McCall2011-02-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | class and to bind the shared value using OpaqueValueExpr. This fixes an unnoticed problem with deserialization of these expressions where the deserialized form would lose the vital pointer-equality trait; or rather, it fixes it because this patch also does the right thing for deserializing OVEs. Change OVEs to not be a "temporary object" in the sense that copy elision is permitted. This new representation is not totally unawkward to work with, but I think that's really part and parcel with the semantics we're modelling here. In particular, it's much easier to fix things like the copy elision bug and to make the CFG look right. I've tried to update the analyzer to deal with this in at least some obvious cases, and I think we get a much better CFG out, but the printing of OpaqueValueExprs probably needs some work. llvm-svn: 125744
* [analyzer] Use the new registration mechanism on the IdempotentOperationChecker.Argyrios Kyrtzidis2011-02-151-2/+2
| | | | llvm-svn: 125611
* IdempotentOperationChecker: don't repeatedly recompute block reachability.Ted Kremenek2011-02-151-2/+3
| | | | llvm-svn: 125548
* Remove dead code in IdempotentOperationChecker.Ted Kremenek2011-02-141-46/+0
| | | | llvm-svn: 125497
* Fix edge case where we don't cull warnings in IdempotentOperationsChecker ↵Ted Kremenek2011-02-141-1/+6
| | | | | | due to incomplete analysis of loops. llvm-svn: 125495
* Use 'BitVector' instead of SmallPtrSet<CFGBlock*> in ↵Ted Kremenek2011-02-141-53/+68
| | | | | | IdempotentOperationsChecker. No real functionality change. llvm-svn: 125494
* Teach the IdempotentOperations checker to ignore property setters.Ted Kremenek2011-02-121-2/+9
| | | | llvm-svn: 125443
* Split 'include/clang/StaticAnalyzer' into ↵Ted Kremenek2011-02-101-6/+6
| | | | | | | | 'include/clang/StaticAnalyzer/Core' and 'include/clang/StaticAnalyzer/Checkers'. This layout matches lib/StaticAnalyzer, which corresponds to two StaticAnalyzer libraries. llvm-svn: 125251
* [analyzer] lib/StaticAnalyzer/Checkers/ExprEngineExperimentalChecks.h -> ↵Argyrios Kyrtzidis2011-02-081-1/+1
| | | | | | lib/StaticAnalyzer/Checkers/ExperimentalChecks.h llvm-svn: 125122
* Rename misc. methods in ento::Worklist to startTed Kremenek2011-01-111-2/+2
| | | | | | with lowercase letter. llvm-svn: 123212
* Chris Lattner has strong opinions about directoryTed Kremenek2010-12-231-0/+834
layout. :) Rename the 'EntoSA' directories to 'StaticAnalyzer'. Internally we will still use the 'ento' namespace for the analyzer engine (unless there are further sabre rattlings...). llvm-svn: 122514
OpenPOWER on IntegriCloud