taintness across expressions.
Made "smart-culling" of taint propagation (for error reporting)
correctly handle conditional expressions and a few other edge cases.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42421 91177308-0d34-0410-b5e6-96231b3b80d8
values associated with ScopedDecls and CFGBlock-level Exprs. This is the common
boilerplate needed by UninitializedValues and LiveVariables.
Refactored UninitializedValues to use ExprDeclBitVector.
Shortened the string diagnostic for UninitializedValues.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42408 91177308-0d34-0410-b5e6-96231b3b80d8
#1: It is cleaner. I never "liked" storing keyword selectors (i.e. foo:bar:baz) in the IdentifierTable.
#2: It is more space efficient. Since Cocoa keyword selectors can be quite long, this technique is space saving. For Cocoa.h, pulling the keyword selectors out saves ~180k. The cost of the SelectorInfo data is ~100k. Saves ~80k, or 43%.
#3: It results in many API simplifications. Here are some highlights:
- Removed 3 actions (ActOnKeywordMessage, ActOnUnaryMessage, & one flavor of ObjcBuildMethodDeclaration that was specific to unary messages).
- Removed 3 funky structs from DeclSpec.h (ObjcKeywordMessage, ObjcKeywordDecl, and ObjcKeywordInfo).
- Removed 2 ivars and 2 constructors from ObjCMessageExpr (fyi, this space savings has not been measured).
I am happy with the way it turned out (though it took a bit more hacking than I expected). Given the central role of selectors in ObjC, making sure this is "right" will pay dividends later.
Thanks to Chris for talking this through with me and suggesting this approach.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42395 91177308-0d34-0410-b5e6-96231b3b80d8
BUG 1)
CFG failed to build for empty functions, or functions containing only
NullStmts or empty compound statements.
We now handle such cases, although now we cannot test for CFG
construction failure by asserting that the last block constructed is
not NULL (since it now may be).
BUG 2)
CFG construction segfaulted on some cases when walking the AST and not
taking into account that some children of a statement may be NULL.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42370 91177308-0d34-0410-b5e6-96231b3b80d8
using "-parse-ast -verify".
Updated all test cases (using a sed script) that invoked -parse-ast-check to
now use -parse-ast -verify.
Fixed a bug where using "-verify" instead of "-parse-ast-check" would not
correctly create the DiagClient needed to accumulate diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42365 91177308-0d34-0410-b5e6-96231b3b80d8
declaration. This is because this option is logically tightly connected
to the actions defined in ProgAction.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42364 91177308-0d34-0410-b5e6-96231b3b80d8
ASTConsumer can also be verified using the diagnostics checker. From
the command line, users may activate diagnostic checking using the
"-verify" option. For example, "clang -verify -warn-dead-stores"
checks if the warnings flagged by the dead store checker match those
in the comments.
Note that we still have the option "-parse-ast-check" for backwards
comptability with existing test cases. This option is now equivalent to
"-parse-ast -verify".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42362 91177308-0d34-0410-b5e6-96231b3b80d8
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
"CheckDiagnostics" (used for -parse-ast-check) to check the
diagnostics of any ASTConsumer.
Reimplemented CheckDiagnostics to use CheckASTConsumer instead.
Added driver option -warn-dead-stores-check, which checks the
diagnostics generated by the DeadStores checker. This is implemented
using CheckASTConsumer.111
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42310 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
integer constant expressions. The only questionable
thing is that we now reject:
void foo() {
switch (1) {
case (int)1.0e10000:
;
}
}
with:
t.c:5:13: error: case label does not reduce to an integer constant
case (int)1.0e10000:
~~~~~^~~~~~~~~
GCC accepts this, emitting the pedwarn:
t.c:5: warning: floating constant exceeds range of 'double'
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42238 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