aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis
AgeCommit message (Collapse)Author
2010-10-24- Fixed subexpressions evaluation order for binary operators to match order ↵Marcin Swiderski
in code generated with the compiler, - Fixed test cases for unreachable code warnings produced by Sema. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117220 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-21Previously, the printf warnings would say your arguments type was 'int' when ↵Ted Kremenek
it was really a 'char' or a 'short'. This fixes that and allows the hints to suggest 'h' modifiers for small ints. Patch by Justin Bogner! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116996 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-15Death to blocks, or at least the word "block" in one particular obnoxiouslyJohn McCall
ambiguous context. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116567 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05* Simplify codeZhongxing Xu
* Fix dump() to make it consistent with the test case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115609 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05Added support for base and member destructors in destructor.Marcin Swiderski
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115592 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-04Added support for C++ initializers in CFG.Marcin Swiderski
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115493 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01Now the whether adding implicit dtors is controlled by cmd option.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115275 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01The return value is never used.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115272 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01Use default augument.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115271 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01Simplify interface for addLocalScopeForStmt().Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115270 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01The old logic would add non-struct and non C++ struct variables to the localZhongxing Xu
scope. Now we only add C++ struct with non-trivial destructor variables to the local scope. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115269 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01Added generating CFGAutomaticObjDtors for exception variable in catch statement.Marcin Swiderski
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115266 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01Added generating CFGAutomaticObjDtors for init statement, condition variable ↵Marcin Swiderski
and implicit scope in for statement. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115265 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01dded generating CFGAutomaticObjDtors for condition variable and implicit ↵Marcin Swiderski
scopes in switch statement. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115264 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01Added generating CFGAutomaticObjDtors for condition variable and implicit ↵Marcin Swiderski
scopes in while and do statements. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115262 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01Added generating CFGAutomaticObjDtors for condition variable and implicit ↵Marcin Swiderski
scopes in if statement. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115256 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01Fixed checking for trivial destructor in ↵Marcin Swiderski
CFGBuilder::addLocalScopeForVarDecl. Checked type does not have to represent C++ class. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115254 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01Added:Marcin Swiderski
- Adding LocalScope for CompoundStmt, - Adding CFGAutomaticObjDtors for end of scope, return, goto, break, continue, - Regression tests for above cases. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115252 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30Added methods for adding LocalScopes and CFGAutomaticObjDtors.Marcin Swiderski
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115237 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30Added methods for inserting CFGAutomaticObjDtors to CFGBlocks,Marcin Swiderski
Fixed some misspells in comments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115236 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30Added:Marcin Swiderski
- post-increament, distance and bool conversion methods to LocalScope::const_iterator, - adding VarDecl to LocalScope. Fixed some misspells in comments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115227 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30Added two new command line arguments:Marcin Swiderski
-cfg-add-implicit-dtors - sets CFG::BuildOptions::AddImplicitDtors for AnalysisCosumer to true, -cfg-add-initializers - sets CFG::BuildOptions::AddInitializers for AnalysisCosumer to true. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115142 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-25In preparation for adding generation of destructors for objects with ↵Marcin Swiderski
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114790 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21Added:Marcin Swiderski
- definitions of interfaces for CFGInitializer and CFGAutomaticObjDtor, - support for above classes to print_elem function (renamed print_stmt), - support for VarDecls in StmtPrinterHelper. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114403 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16Tidy up.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114062 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16Introduce new CFGElement hierarchy to support C++ CFG, based on Marcin's patchZhongxing Xu
and discussions with Ted and Jordy. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114056 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15Relax assertion in CFG builder when processing ForStmts. This fixes an ↵Ted Kremenek
assertion failure on code containing GNU statement expressions reported in PR 8141. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113953 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-14Add CFG::BuildOptions class to pass in CFG builder options under on ↵Ted Kremenek
parameter. Patch by Marcin Świderski! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113898 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-14Fix CFGBuilder crash reported in PR 8141.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113826 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13Revert "CMake: Update to use standard CMake dependency tracking facilities ↵Michael J. Spencer
instead" This reverts commit r113631 Conflicts: CMakeLists.txt lib/CodeGen/CMakeLists.txt git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113817 91177308-0d34-0410-b5e6-96231b3b80d8
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