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

22 Коммитов

Автор SHA1 Сообщение Дата
Ted Kremenek bffaa83147 Modified LiveVariables to perform all of its base initialization in the ctor,
and now we require a FunctionDecl* object so that we can also keep track of
all of the ParmDecls.

Modified clients of LiveVariables to conform to the new interface.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46490 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-29 05:13:23 +00:00
Ted Kremenek 79649dfed2 Added support to dataflow solver to (when requested) also record dataflow
values for the block-level expressions.

Modified 'LiveVariables' to provide the option to clients to record
liveness information for block-level expressions (using the above feature).

Modified 'DeadStores' to conform to the new interface of 'LiveVariables'.

Modified 'GRConstants' to compute liveness information for block-level
expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46137 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-17 18:25:22 +00:00
Ted Kremenek c2b51d8cf3 Added VISIBILITY_HIDDEN to classes/structs in anonymous namespaces.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45750 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-08 18:19:08 +00:00
Chris Lattner 0bc735ffcf Don't attribute in file headers anymore. See llvmdev for the
discussion of this change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45410 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-29 19:59:25 +00:00
Ted Kremenek cf6e41baf2 Directory restructing of Analysis files.
Created include/clang/Analysis/Analyses directory.
  - Moved LiveVariables.h and UninitializedValues.h into this dir.
  
Moved ExprDeclBitVector.h into Analysis/Support.

Updated all clients who use these headers to reflect the new paths.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45292 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-21 21:42:19 +00:00
Ted Kremenek 9c728dc4d8 TargetInfo no longer includes a reference to SourceManager.
Moved all clients of Diagnostics to use FullSourceLoc instead of SourceLocation.
Added many utility methods to FullSourceLoc to provide shorthand for:

    FullLoc.getManager().someMethod(FullLoc.getLocation());
    
instead we have:

    FullLoc.someMethod();
    
Modified TextDiagnostics (and related classes) to use this short-hand.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44957 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12 22:39:36 +00:00
Ted Kremenek 7a9d49fd2b Mega-patch: ripped SourceManager out of Diagnostic/DiagnosticClient. Now
SourceManager is passed by reference, allowing the SourceManager to be
associated with a specific translation unit, and not the entire execution
of the driver.

Modified all users of Diagnostics to comply with this new interface.

Integrated SourceManager as a member variable of TargetInfo. TargetInfo will
eventually be associated with a single translation unit (just like
SourceManager).

Made the SourceManager reference in ASTContext private. Provided accessor
getSourceManager() for clients to use instead. Modified clients to comply with
new interface.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44878 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11 21:27:55 +00:00
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