summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/PseudoConstantAnalysis.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.Galina Kistanova2017-06-031-0/+1
| | | | llvm-svn: 304641
* Avoid overly large SmallPtrSet/SmallSetMatthias Braun2016-01-301-3/+1
| | | | | | | | | These sets perform linear searching in small mode so it is never a good idea to use SmallSize/N bigger than 32. Differential Revision: http://reviews.llvm.org/D16705 llvm-svn: 259284
* Switch users of the 'for (StmtRange range = stmt->children(); range; ↵Benjamin Kramer2015-07-021-3/+3
| | | | | | | | | ++range)‘ pattern to range for loops. The pattern was born out of the lack of range-based for loops in C++98 and is somewhat obscure. No functionality change intended. llvm-svn: 241300
* [C++11] Use 'nullptr'. Analysis edition.Craig Topper2014-05-201-1/+1
| | | | llvm-svn: 209191
* [C++11] Replacing DeclStmt iterators decl_begin() and decl_end() with ↵Aaron Ballman2014-03-141-3/+2
| | | | | | iterator_range decls(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203947
* Drop the ASTContext.h include from Stmt.h and fix up transitive users.Benjamin Kramer2012-07-041-0/+1
| | | | | | | | | | | | | | This required moving the ctors for IntegerLiteral and FloatingLiteral out of line which shouldn't change anything as they are usually called through Create methods that are already out of line. ASTContext::Deallocate has been a nop for a long time, drop it from ASTVector and make it independent from ASTContext.h Pass the StorageAllocator directly to AccessedEntity so it doesn't need to have a definition of ASTContext around. llvm-svn: 159718
* Remove BlockDeclRefExpr and introduce a bit on DeclRefExpr toJohn McCall2012-03-101-15/+2
| | | | | | | | 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
* Cleanup various declarations of 'Stmt*' to be 'Stmt *', etc. in libAnalyzer ↵Ted Kremenek2011-08-121-1/+1
| | | | | | and libStaticAnalyzer[*]. It was highly inconsistent, and very ugly to look at. llvm-svn: 137537
* Give some convenient idiomatic accessors to Stmt::child_range andJohn McCall2011-02-131-2/+1
| | | | | | | Stmt::const_child_range, then make a bunch of places use them instead of the individual iterator accessors. llvm-svn: 125450
* Start migration of static analyzer to using theTed Kremenek2010-12-161-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add missing null checks in PseudoConstantAnalysisTom Care2010-08-251-1/+4
| | | | llvm-svn: 112100
* Improved the handling of blocks and block variables in PseudoConstantAnalysisTom Care2010-08-251-30/+47
| | | | | | | | | | - Removed the assumption that __block vars are all non-constant - Simplified some repetitive code in RunAnalysis - Added block walking support - Code/comments cleanup - Separated out test for block pseudoconstants llvm-svn: 112098
* GCC didn't care for my attempt at API compatibility, so brute-force everythingJohn McCall2010-08-251-15/+15
| | | | | | to the new constants. llvm-svn: 112047
* Improvements to IdempotentOperationChecker and its use of PseudoConstantAnalysisTom Care2010-08-241-8/+53
| | | | | | | | | | | | - Added wasReferenced function to PseudoConstantAnalysis to determine if a variable was ever referenced in a function (outside of a self-assignment) - BlockDeclRefExpr referenced variables are now explicitly added to the non-constant list - Remove unnecessary ignore of implicit casts - Generalized parameter self-assign detection to detect deliberate self-assigns of variables to avoid unused variable warnings - Updated test cases with deliberate self-assignments - Fixed bug with C++ references and pseudoconstants - Added test case for C++ references and pseudoconstants llvm-svn: 111965
* Several small changes to PseudoConstantAnalysis and the way ↵Tom Care2010-08-231-0/+173
IdempotentOperationChecker uses it. - Psuedo -> Pseudo (doh...) - C++ reference support - Added pseudoconstant test case for __block vars - Separated out static local checking from pseudoconstant analysis and generalized to non-local checking - Added missing test cases for storage false positives llvm-svn: 111832
OpenPOWER on IntegriCloud