that they conform(in type, name and numbers) to those declared in @interface.
Test case highlights kind of checking we do here.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42360 91177308-0d34-0410-b5e6-96231b3b80d8
code that uses the solver to reflect the new location.
Created "FlowSensitive" subdirectory in include/clang/Analysis to hold
header files relating to flow-sensitive analyses. Moved
"DataflowValues.h" into this subdirectory.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42320 91177308-0d34-0410-b5e6-96231b3b80d8
semantic checks for class and protocol declarations. Test cases are good indications of kind of
checking being done in this patch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42311 91177308-0d34-0410-b5e6-96231b3b80d8
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
is persistent. Adds/removals to a PersistentMap do not result in
a map being modified, but a new map being created. This will be useful
for path-sensitive analyses.
The current implementation mainly makes copies to implement this
functionality. If the map turns out to be extensively used, this
implementation will be replaced with a more efficient one that uses
data sharing (see comments in PersistentMap.h for more information).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42290 91177308-0d34-0410-b5e6-96231b3b80d8
counted objects that maintain their own internal reference count.
This smart pointer implementation is compatible with LLVM-style
down-casting (see in llvm: include/llvm/Support/Casting.h).
Implemented "RefCounted", a base class that objects that wish to be
managed using IntrusiveSPtrs can subclass.
Reference counted objects are being targeted for use in path-sensitive
dataflow analyses where managing many live objects becomes difficult.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42260 91177308-0d34-0410-b5e6-96231b3b80d8
1. Handles saving and checking on protocols used in an @interface declaration
2. Checks and saves class's super class.
3. Adds semantic check to category declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42218 91177308-0d34-0410-b5e6-96231b3b80d8
"Visitors" is more general than "CFGVisitors", as we aren't just using
visitation useful for CFG analysis.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42174 91177308-0d34-0410-b5e6-96231b3b80d8
1. Detect used of undeclared/forward declared super class.
2. Detect duplicate definition of a class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42168 91177308-0d34-0410-b5e6-96231b3b80d8
of parsing the GraphTraits templates if they don't need that functionality.
Defined nodes_iterator for GraphTraits<Stmt*> to be based on llvm::df_iterator.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42150 91177308-0d34-0410-b5e6-96231b3b80d8
The extended functionality of these visitors is that they automatically visit all statements in
an AST (no explicit recursion is required from subclasses), and the for the latter, decls are visited
as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42144 91177308-0d34-0410-b5e6-96231b3b80d8
Rationale:
We currently have a separate table to unique ObjC selectors. Since I don't need all the instance data in IdentifierInfo, I thought this would save space (and make more sense conceptually).
It turns out the cost of having duplicate entries for unary selectors (i.e. names without colons) outweighs the cost difference between the IdentifierInfo & SelectorInfo structures. Here is the data:
Two tables:
*** Selector/Identifier Stats:
# Selectors/Identifiers: 51635
Bytes allocated: 1999824
One table:
*** Identifier Table Stats:
# Identifiers: 49500
Bytes allocated: 1990316
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42139 91177308-0d34-0410-b5e6-96231b3b80d8
to specify how two dataflow values should be compared for equality. The default
is to use std::equal_to.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42115 91177308-0d34-0410-b5e6-96231b3b80d8
of visiting all block-level statements in a CFG.
Tightened implementation of UninitializedValues.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42106 91177308-0d34-0410-b5e6-96231b3b80d8
with CFG *edges* instead of blocks. This will fascilitate dataflow
analyses that are sensitive to block terminators, and also simplifies
some reasoning.
Updated UninitializedValues to comply to this new interface.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42099 91177308-0d34-0410-b5e6-96231b3b80d8
- Removed helper ObjcGetSelectorInfo(), moving the code directly into ObjcBuildMethodDeclaration().
- Many refinements to ParseObjCMessageExpression().
- Add ActOnMessageExpression().
Next step, finish the message actions and (finally) create/instantiate an ObjcMessageExpr AST.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42050 91177308-0d34-0410-b5e6-96231b3b80d8
mechanism can be implemented simply by affixing the Observer to an
analysis meta data, so it doesn't need to be a required type. This
also permits analyses not to implement an Observer if it doesn't make
sense.
Changed "DataflowValues::MetaDataTy" to
"DataflowValues::AnalysisDataTy" to reflect that the type
enscapsulated the data associated with analyzing a given CFG.
Changed CFGStmtVisitor::BlockStmt_VisitImplicitControlFlowStmt(Stmt*)
to ...VisitImplicitControlFlowExpr(Expr*). The type narrowing is more
precise and more useful to clients.
Added CFGStmtVisitor::BlockStmt_VisitExpr to reflect the visitation of
expressions at the block statement level. This captures all implicit
control-flow statements as well as other expressions that are hoisted
to the block level (such as conditions for terminators and function
calls). This is especially useful for dataflow analysis.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42034 91177308-0d34-0410-b5e6-96231b3b80d8
- Add SelectorInfo/SelectorTable classes, modeled after IdentifierInfo/IdentifierTable.
- Add SelectorTable instance to ASTContext, created lazily through ASTContext::getSelectorInfo().
- Add SelectorInfo slot to ObjcMethodDecl.
- Add helper function to derive a SelectorInfo from ObjcKeywordInfo.
Misc: Got the Decl stats stuff up and running again...it was missing support for ObjC AST's.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42023 91177308-0d34-0410-b5e6-96231b3b80d8