summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis
Commit message (Collapse)AuthorAgeFilesLines
...
* Added two new command line arguments:Marcin Swiderski2010-09-301-1/+6
| | | | | | | -cfg-add-implicit-dtors - sets CFG::BuildOptions::AddImplicitDtors for AnalysisCosumer to true, -cfg-add-initializers - sets CFG::BuildOptions::AddInitializers for AnalysisCosumer to true. llvm-svn: 115142
* In preparation for adding generation of destructors for objects with ↵Marcin Swiderski2010-09-251-43/+166
| | | | | | | | | | automatic storage added: - LocalScope class with iterator used to pointing into it, - fat doxygen comment for LocalScope indended usage, - BlockScopePosPair class used for storing jump targets/sources (for: goto, break, continue), that replaces raw CFGBlock pointer used earlier for this purpose. llvm-svn: 114790
* Added:Marcin Swiderski2010-09-211-47/+109
| | | | | | | | - definitions of interfaces for CFGInitializer and CFGAutomaticObjDtor, - support for above classes to print_elem function (renamed print_stmt), - support for VarDecls in StmtPrinterHelper. llvm-svn: 114403
* Tidy up.Zhongxing Xu2010-09-161-5/+4
| | | | llvm-svn: 114062
* Introduce new CFGElement hierarchy to support C++ CFG, based on Marcin's patchZhongxing Xu2010-09-163-19/+38
| | | | | | and discussions with Ted and Jordy. llvm-svn: 114056
* Relax assertion in CFG builder when processing ForStmts. This fixes an ↵Ted Kremenek2010-09-151-1/+2
| | | | | | | | assertion failure on code containing GNU statement expressions reported in PR 8141. llvm-svn: 113953
* Add CFG::BuildOptions class to pass in CFG builder options under on ↵Ted Kremenek2010-09-142-21/+17
| | | | | | parameter. Patch by Marcin Świderski! llvm-svn: 113898
* Fix CFGBuilder crash reported in PR 8141.Ted Kremenek2010-09-141-2/+6
| | | | llvm-svn: 113826
* Revert "CMake: Update to use standard CMake dependency tracking facilities ↵Michael J. Spencer2010-09-131-13/+4
| | | | | | | | | | | | | instead" This reverts commit r113631 Conflicts: CMakeLists.txt lib/CodeGen/CMakeLists.txt llvm-svn: 113817
* Remove from the CFG the half-implemented support for scoping information. ↵Ted Kremenek2010-09-131-42/+4
| | | | | | | | We decided that scope information doesn't belong in the CFG at all, since it is a lexical construct. Patch by Marcin Świderski! llvm-svn: 113798
* CMake: Update to use standard CMake dependency tracking facilities insteadMichael J. Spencer2010-09-101-4/+13
| | | | | | of whatever we were using before... llvm-svn: 113631
* Add ObjCAtSynchronizedStmt to the CFG and add GRExprEngine support (PreVisit ↵Ted Kremenek2010-09-101-0/+4
| | | | | | for checkers). llvm-svn: 113572
* Clean up CMake dependenciesDouglas Gregor2010-09-091-0/+2
| | | | llvm-svn: 113489
* Remove stray ';' and convert tabs to spaces.Ted Kremenek2010-09-091-5/+5
| | | | llvm-svn: 113466
* Enhance -Wunreachable-code to not consider the 'default:' branch of a switch ↵Ted Kremenek2010-09-091-5/+11
| | | | | | | | statement live if a switch on an enum value has explicit 'case:' statements for each enum value. llvm-svn: 113451
* Add 'filtered_pred_iterator' and 'filtered_succ_iterator' to CFGBlock. This ↵Ted Kremenek2010-09-091-0/+23
| | | | | | | | | allows a client to selectively walk successors/predecessors based on commonly used filters. For starters, add a filter to ignore 'default:' cases for SwitchStmts when all enum values are covered by CaseStmts. llvm-svn: 113449
* FinishBlock() is essentially doing nothing except returning '!badCFG'.Zhongxing Xu2010-09-061-55/+42
| | | | llvm-svn: 113149
* Simplify CFG construction: bail out early when we have a bad CFG.Zhongxing Xu2010-09-061-36/+32
| | | | llvm-svn: 113148
* Improve CFG printing support for CXXOperatorCallExpr and CXXBindTemporaryExpr.Ted Kremenek2010-08-311-5/+15
| | | | llvm-svn: 112619
* Explicitly handle CXXOperatorCallExpr when building CFGs. We should treat ↵Ted Kremenek2010-08-311-1/+2
| | | | | | | it the same as CallExprs. Fixes: <rdar://problem/8375510> [Boost] CFGBuilder crash in Boost.Graph llvm-svn: 112618
* Revert my lame attempt at appeasing the CFGBuilderDouglas Gregor2010-08-311-7/+0
| | | | llvm-svn: 112580
* Teach the CFGBuilder not do die on CXXBindTemporaryExpr, ↵Douglas Gregor2010-08-311-0/+7
| | | | | | CXXOperatorCallExpr. Fixes a Boost.Graph crasher. llvm-svn: 112578
* Delete the relaxedLiveness object in the dtor of AnalysisContext.Ted Kremenek2010-08-281-0/+1
| | | | llvm-svn: 112380
* Explicitly handle CXXExprWithTemporaries during CFG construction by just ↵Ted Kremenek2010-08-281-0/+6
| | | | | | visiting the subexpression. While we don't do anything intelligent right now, this obviates a bogus -Wunreahable-code warning reported in PR 6130. llvm-svn: 112334
* Add alternate version of LiveVariables analysis that does not kill liveness ↵Tom Care2010-08-272-6/+22
| | | | | | | | | at assignments. This 'relaxed' liveness is useful in path sensitive analysis for situations where the resulting extended liveness allows us to find some bugs. - Added killAtAssign flag to LiveVariables - Added relaxed LiveVariables to AnalysisContext with an accessor llvm-svn: 112306
* 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-255-30/+30
| | | | | | to the new constants. llvm-svn: 112047
* Fix printf format string checking for '%lc' (which expects a wint_t or ↵Ted Kremenek2010-08-242-0/+29
| | | | | | compatible argument). Fixes PR 7981. llvm-svn: 111978
* 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-233-14/+68
| | | | | | | | | | | | 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
* Detabify.Eli Friedman2010-08-221-1/+1
| | | | llvm-svn: 111768
* Added psuedo-constant analysis and integrated it into the false positive ↵Tom Care2010-08-183-0/+128
| | | | | | | | | | | | | reduction stage in IdempotentOperationChecker. - Renamed IdempotentOperationChecker::isConstant to isConstantOrPseudoConstant to better reflect the function - Changed IdempotentOperationChecker::PreVisitBinaryOperator to only run 'CanVary' once on undefined assumptions - Created new PsuedoConstantAnalysis class and added it to AnalysisContext - Changed IdempotentOperationChecker to exploit the new analysis - Updated tests with psuedo-constants - Added check to IdempotentOperationChecker to see if a Decl is const qualified llvm-svn: 111426
* Fix horrible CFG bug caused by a series of NullStmts appearing at the ↵Ted Kremenek2010-08-171-1/+4
| | | | | | | | beginning of a do...while loop. This would cause the body of the DoStmt to be disconnected from the preceding code. llvm-svn: 111283
* CFGBuilder: don't create the empty "loop back" block for DoStmts if the loop ↵Ted Kremenek2010-08-171-12/+16
| | | | | | edge can never be taken. llvm-svn: 111282
* Fix a bug where child statements could not be identified as being in a ↵Tom Care2010-08-111-1/+1
| | | | | | CFGBlock in CFGStmtMap::getBlock. llvm-svn: 110881
* Remove bonehead redeclaration.Ted Kremenek2010-08-051-1/+1
| | | | llvm-svn: 110288
* Fix CFGBuilder to not blow out the stack when processing deeply nested ↵Ted Kremenek2010-08-041-5/+32
| | | | | | CaseStmts. Fixes <rdar://problem/8268753>. llvm-svn: 110286
* Add CFGStmtMap, which defines a mapping from Stmt* to CFGBlock*. The ↵Ted Kremenek2010-08-042-0/+89
| | | | | | immediate intended use is in the unreachable code analysis. llvm-svn: 110230
* Add -cc1 option '-unoptimized-cfg' to toggle using a CFG (for static ↵Ted Kremenek2010-08-031-1/+4
| | | | | | analysis) that doesn't prune CFG edges. llvm-svn: 110087
* Add 'AnalysisContext::getUnoptimizedCFG()' to allow clients to get access to ↵Ted Kremenek2010-08-022-21/+46
| | | | | | | | the original CFG without any edges pruned out because of trivially solvable conditions (e.g., 'if (0)'). llvm-svn: 110085
* Revert r109428 "Hoist argument type checking into CheckFormatHandler. This ↵Michael J. Spencer2010-07-272-9/+1
| | | | | | | | is prep for scanf format" Got errors about ASTContext being undefined with Visual Studio 2010. llvm-svn: 109491
* Fix namespace polution.Dan Gohman2010-07-262-1/+3
| | | | llvm-svn: 109440
* Hoist argument type checking into CheckFormatHandler. This is prep for ↵Ted Kremenek2010-07-262-1/+9
| | | | | | | | scanf format string argument type checking. llvm-svn: 109428
* Make a bunch of new data structures for the new analysisZhongxing Xu2010-07-221-1/+1
| | | | | | | engine of the new translation unit. State marshal is there but no real work is done. End nodes are passed back. llvm-svn: 109105
* Hookup checking for invalid length modifiers in scanf format strings.Ted Kremenek2010-07-201-21/+23
| | | | llvm-svn: 108907
* Move 'hasValidLengthModifier' from PrintfFormatSpecifier to FormatSpecifier.Ted Kremenek2010-07-202-70/+75
| | | | llvm-svn: 108906
* Cleanup whitespace in switch statement. No functionality change.Ted Kremenek2010-07-201-6/+7
| | | | llvm-svn: 108905
* Add 'ConversionSpecifier' root class in 'analyze_format_string' namespace andTed Kremenek2010-07-202-29/+32
| | | | | | | derived 'PrintfConversionSpecifier' from this class. We will do the same for 'ScanfConversionSpecifier'. llvm-svn: 108903
* Rename 'UnicodeStrArg' to 'SArg'.Ted Kremenek2010-07-201-3/+3
| | | | llvm-svn: 108901
OpenPOWER on IntegriCloud