Граф коммитов

15 Коммитов

Автор SHA1 Сообщение Дата
Chris Lattner 311ff02fae Add a new Rewriter::getRangeSize method.
Rename SourceRange::Begin()/End() to getBegin()/getEnd() for
consistency with other code.
Start building the rewriter towards handling @encode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43047 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-16 22:36:42 +00:00
Ted Kremenek 11e7218db5 Migrated LiveVariables and UninitializedVariables to now use the
tracked BlkExpr information now maintained by the CFG class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42498 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-01 20:33:52 +00:00
Ted Kremenek c6a1fafe42 DeadStores no longer reports warnings for stores to non-local variables.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42447 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-28 20:48:41 +00:00
Ted Kremenek f63aa45ca9 Significant cleanups and bug-fixes to LiveVariables. Uses new refactored
ExprDeclBitVector class for defining dataflow state.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42446 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-28 20:38:59 +00:00
Ted Kremenek 4cd8b3cd4f Removed "EverKilled" class in DeadStores checker; it is no longer used.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42301 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-25 17:47:04 +00:00
Ted Kremenek fdd225ed6f Further refactored DataflowSolver. Now most code for the solver is shared
between forward and backward analyses, with trait classes being used
to implement the key differences in operations/functionality.

Converted the LiveVariables analysis to use the generic DataflowSolver.  This,
along with removing some extra functionality that was not needed, reduced
the code for LiveVariables by over half.

Modified Driver code to handle the updated interface to LiveVariables.

Modified the DeadStores checker to handle the update interface to
LiveVariables.

Updated DataflowValues (generic ADT to store dataflow values) to also
store values for blocks.  This is used by DeadStores.  Updated some comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42293 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-25 04:31:27 +00:00
Chris Lattner c0508f9fe3 switch the various CFG-based stuff over to using ASTConsumer interface,
this eliminates their dependence on the preprocessor and eliminates some
duplicated code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41993 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-15 23:21:08 +00:00
Chris Lattner b800dc2d5e make the sourcemgr available through ASTContext.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41906 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-13 01:14:03 +00:00
Ted Kremenek ce1cab9fc0 For looking at "dead stores" in declarations, we now check to see
if the assigned value is a constant expression, e.g.:

int x = 0;

We then check to see if "x" is ever reassigned later.  If so, we don't
emit a warning.  This is because programmers frequently use defensive
programming to make sure a variable has a defined value.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41853 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-11 17:24:14 +00:00
Ted Kremenek a596533c98 Fixed potential NULL dereference when iterating over a chain of Decls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41848 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-11 17:00:40 +00:00
Gabor Greif 8467583c27 get rid of ugly "warning: no newline at end of file"
warnings that some compilers diagnose


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41847 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-11 15:32:40 +00:00
Ted Kremenek c0576ca6c6 Fixed LiveVariables to no longer track the liveness of function pointers
that refer to direct function calls.

Modified interface of LiveVariables to only track liveness of VarDecls.
This cleans up a bunch of edge cases, and removed the bug just mentioned.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41797 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-10 17:36:42 +00:00
Ted Kremenek b00c95eab9 Renaming of the LiveVariablesAuditor interface. Changed "Auditor" and
"Audit" to "Observer" and "Observe"


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41794 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-10 15:56:38 +00:00
Ted Kremenek 83522a31ae Added more checking in "dead stores" for values that are initialized
but never used.

Fix a bug in LiveVariables where uses on the LHS of self-assign
operators (e.g +=, *=, etc) would not be properly recorded in the
liveness state of the variable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41757 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-06 23:39:53 +00:00
Ted Kremenek 1ed6d2e4fd Forgot to check in the actual "dead stores" checker in the last commit!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41755 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-06 23:01:46 +00:00