aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis
AgeCommit message (Collapse)Author
2010-09-13Remove from the CFG the half-implemented support for scoping information. ↵Ted Kremenek
We decided that scope information doesn't belong in the CFG at all, since it is a lexical construct. Patch by Marcin Świderski! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113798 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10CMake: Update to use standard CMake dependency tracking facilities insteadMichael J. Spencer
of whatever we were using before... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113631 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10Add ObjCAtSynchronizedStmt to the CFG and add GRExprEngine support (PreVisit ↵Ted Kremenek
for checkers). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113572 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09Clean up CMake dependenciesDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113489 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09Remove stray ';' and convert tabs to spaces.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113466 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09Enhance -Wunreachable-code to not consider the 'default:' branch of a switch ↵Ted Kremenek
statement live if a switch on an enum value has explicit 'case:' statements for each enum value. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113451 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09Add 'filtered_pred_iterator' and 'filtered_succ_iterator' to CFGBlock. This ↵Ted Kremenek
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113449 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06FinishBlock() is essentially doing nothing except returning '!badCFG'.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113149 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06Simplify CFG construction: bail out early when we have a bad CFG.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113148 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31Improve CFG printing support for CXXOperatorCallExpr and CXXBindTemporaryExpr.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112619 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31Explicitly handle CXXOperatorCallExpr when building CFGs. We should treat ↵Ted Kremenek
it the same as CallExprs. Fixes: <rdar://problem/8375510> [Boost] CFGBuilder crash in Boost.Graph git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112618 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31Revert my lame attempt at appeasing the CFGBuilderDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112580 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31Teach the CFGBuilder not do die on CXXBindTemporaryExpr, ↵Douglas Gregor
CXXOperatorCallExpr. Fixes a Boost.Graph crasher. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112578 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-28Delete the relaxedLiveness object in the dtor of AnalysisContext.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112380 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-28Explicitly handle CXXExprWithTemporaries during CFG construction by just ↵Ted Kremenek
visiting the subexpression. While we don't do anything intelligent right now, this obviates a bogus -Wunreahable-code warning reported in PR 6130. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112334 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-27Add alternate version of LiveVariables analysis that does not kill liveness ↵Tom Care
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112306 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25Add missing null checks in PseudoConstantAnalysisTom Care
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112100 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25Improved the handling of blocks and block variables in PseudoConstantAnalysisTom Care
- 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112098 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25GCC didn't care for my attempt at API compatibility, so brute-force everythingJohn McCall
to the new constants. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112047 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24Fix printf format string checking for '%lc' (which expects a wint_t or ↵Ted Kremenek
compatible argument). Fixes PR 7981. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111978 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24Improvements to IdempotentOperationChecker and its use of PseudoConstantAnalysisTom Care
- 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111965 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23Several small changes to PseudoConstantAnalysis and the way ↵Tom Care
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111832 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-22Detabify.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111768 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18Added psuedo-constant analysis and integrated it into the false positive ↵Tom Care
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111426 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17Fix horrible CFG bug caused by a series of NullStmts appearing at the ↵Ted Kremenek
beginning of a do...while loop. This would cause the body of the DoStmt to be disconnected from the preceding code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111283 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17CFGBuilder: don't create the empty "loop back" block for DoStmts if the loop ↵Ted Kremenek
edge can never be taken. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111282 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11Fix a bug where child statements could not be identified as being in a ↵Tom Care
CFGBlock in CFGStmtMap::getBlock. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110881 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05Remove bonehead redeclaration.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110288 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04Fix CFGBuilder to not blow out the stack when processing deeply nested ↵Ted Kremenek
CaseStmts. Fixes <rdar://problem/8268753>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110286 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04Add CFGStmtMap, which defines a mapping from Stmt* to CFGBlock*. The ↵Ted Kremenek
immediate intended use is in the unreachable code analysis. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110230 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03Add -cc1 option '-unoptimized-cfg' to toggle using a CFG (for static ↵Ted Kremenek
analysis) that doesn't prune CFG edges. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110087 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02Add 'AnalysisContext::getUnoptimizedCFG()' to allow clients to get access to ↵Ted Kremenek
the original CFG without any edges pruned out because of trivially solvable conditions (e.g., 'if (0)'). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110085 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27Revert r109428 "Hoist argument type checking into CheckFormatHandler. This ↵Michael J. Spencer
is prep for scanf format" Got errors about ASTContext being undefined with Visual Studio 2010. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109491 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-26Fix namespace polution.Dan Gohman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109440 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-26Hoist argument type checking into CheckFormatHandler. This is prep for ↵Ted Kremenek
scanf format string argument type checking. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109428 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22Make a bunch of new data structures for the new analysisZhongxing Xu
engine of the new translation unit. State marshal is there but no real work is done. End nodes are passed back. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109105 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20Hookup checking for invalid length modifiers in scanf format strings.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108907 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20Move 'hasValidLengthModifier' from PrintfFormatSpecifier to FormatSpecifier.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108906 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20Cleanup whitespace in switch statement. No functionality change.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108905 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20Add 'ConversionSpecifier' root class in 'analyze_format_string' namespace andTed Kremenek
derived 'PrintfConversionSpecifier' from this class. We will do the same for 'ScanfConversionSpecifier'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108903 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20Rename 'UnicodeStrArg' to 'SArg'.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108901 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20Rename 'ConsumedSoFarArg' -> 'nArg' and 'OutIntPtrArg' to 'nArg' (scanf and ↵Ted Kremenek
printf checking). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108900 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20Rename 'VoidPtrArg' to 'pArg' in printf/scanf checking.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108899 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20Rename 'CStrArg' to 'sArg' for printf checking to match with the analagous ↵Ted Kremenek
enum for scanf checking. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108898 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20Rename analyze_printf::ConversionSpecifier::IntAsCharArg to 'cArg' to matchTed Kremenek
analagous enum in analyze_scanf. This is prep for refactoring the logic for handling ConversionSpecifiers for both scanf and printf. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108897 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19Add missing conversion specifier parsing for 'u', 'x', 'o', and 's'. Fixes ↵Ted Kremenek
<rdar://problem/8204052>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108742 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19Reapply r108617.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108668 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-18BUILD_ARCHIVE is the default for libraries, no need to set it.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108633 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-17Revert r108617, it broke the build.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108621 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-17Prepare the analyzer for the callee in another translation unit:Zhongxing Xu
Let AnalysisContext contain a TranslationUnit. Let CallEnter refer to an AnalysisContext instead of a FunctionDecl. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108617 91177308-0d34-0410-b5e6-96231b3b80d8