History log of /external/clang/lib/Analysis/UninitializedValues.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
eee18c38b6dd29c0e6982f5565fcbc3f76d1bf4d 19-Jul-2012 Ted Kremenek <kremenek@apple.com> Simplify UninitializedValues.cpp by removing logic to handle the previous (imprecise) representation
of '&&' and '||' in the CFG. This is no longer needed, and greatly simplifies the code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160494 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
6cfa78f6bd4e7d5e23366a0907f8f8792366bc4c 17-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> Uninitialized variables: two little changes:
* Treat compound assignment as a use, at Jordy's request.
* Always add compound assignments into the CFG, so we can correctly diagnose the use in 'return x += 1;'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160334 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
9532e0d89ca2afa556f032aa9377f6ec1d3eaa3e 17-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> -Wuninitialized: Split the classification of DeclRefExprs as initialization or
use out of TransferFunctions, and compute it in advance rather than on-the-fly.

This allows us to handle compound assignments with DeclRefExprs on the RHS
correctly, and also makes it trivial to treat const& function parameters as not
initializing the argument. The patch also makes both of those changes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160330 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
558e8872b364b43ab9f201dd6b2df9a5b74b0542 14-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13360: When deciding the earliest point which inevitably leads to an
uninitialized variable use, walk back over branches where we've reached all the
non-null successors, not just cases where we've reached all successors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160206 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
a9e8b9e3e90fcfe10a04624a89c39b63c32614d1 03-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> -Wuninitialized: assume that an __attribute__((returns_twice)) function might
initialize any variable. This is extremely conservative, but is sufficient for
now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159620 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
8f40dcc4ddbe4ef796dd1bf0696ac66d4e40e99a 17-Jun-2012 Richard Smith <richard-llvm@metafoo.co.uk> -Wuninitialized bugfix: when entering the scope of a variable with no
initializer, it is uninitialized, even if we may be coming from somewhere where
it was initialized.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158611 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
581deb3da481053c4993c7600f97acf7768caac5 06-Jun-2012 David Blaikie <dblaikie@gmail.com> Revert Decl's iterators back to pointer value_type rather than reference value_type

In addition, I've made the pointer and reference typedef 'void' rather than T*
just so they can't get misused. I would've omitted them entirely but
std::distance likes them to be there even if it doesn't use them.

This rolls back r155808 and r155869.

Review by Doug Gregor incorporating feedback from Chandler Carruth.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158104 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
2815e1a075c74143a0b60a632090ece1dffa5c7c 25-May-2012 Richard Smith <richard-llvm@metafoo.co.uk> Split a chunk of -Wconditional-uninitialized warnings out into a separate flag,
-Wsometimes-uninitialized. This detects cases where an explicitly-written branch
inevitably leads to an uninitialized variable use (so either the branch is dead
code or there is an uninitialized use bug).

This chunk of warnings tentatively lives within -Wuninitialized, in order to
give it more visibility to existing Clang users.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157458 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
818918855d84e3db1af5a0807070d4995ca2cf75 25-May-2012 Richard Smith <richard-llvm@metafoo.co.uk> Some cleanups around the uninitialized variables warning, and a FIXME. No functional change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157440 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
262bc18e32500558af7cb0afa205b34bd37bafed 30-Apr-2012 David Blaikie <dblaikie@gmail.com> Remove the ref/value inconsistency in filter_decl_iterator.

filter_decl_iterator had a weird mismatch where both op* and op-> returned T*
making it difficult to generalize this filtering behavior into a reusable
library of any kind.

This change errs on the side of value, making op-> return T* and op* return
T&.

(reviewed by Richard Smith)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155808 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
b86b8551ce619450b2eb4fc708ead08b83996da7 30-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR11926 + duplicates: Fix crash in -Wuninitialized when using a compiler like
g++4.7, which reuses stack space allocated for temporaries. CFGElement::getAs
returns a suitably-cast version of 'this'. Patch by Markus Trippelsdorf!

No test: this code has the same observable behavior as the old code when built
with most compilers, and the tests were already failing when built with a
compiler for which this produced a broken binary.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155803 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
b2c60b04a597cc5ba4154837cf8e0a155a376fd7 01-Mar-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Move llvm/ADT/SaveAndRestore.h -> llvm/Support/SaveAndRestore.h.

Needs llvm update.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151829 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
d45d361f2ce5c37824052357e2218e8a5509eba5 27-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Move "clang/Analysis/Support/SaveAndRestore.h" to "llvm/ADT/SaveAndRestore.h"
to make it more widely available.

Depends on llvm commit r151564

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151566 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
1d26f48dc2eea1c07431ca1519d7034a21b9bcff 24-Oct-2011 Ted Kremenek <kremenek@apple.com> Rename AnalysisContext to AnalysisDeclContext. Not only is this name more accurate, but it frees up the name AnalysisContext for other uses.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142782 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
9e7617220135a6f6226cf09cb242cc1b905aedb4 13-Oct-2011 Ted Kremenek <kremenek@apple.com> Tweak -Wuninitialized's handling of 'int x = x' to report that as the root cause of an uninitialized variable IFF there are other uses of that uninitialized variable. Fixes <rdar://problem/9259237>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141881 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
c5f740ecdbc21d5ba08f97b89cc05c9d4f230fda 07-Oct-2011 Ted Kremenek <kremenek@apple.com> Fix infinite loop in -Wuninitialized reported in PR 11069.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141345 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
6f27542da8843b5c1c579b86e342385bcc43d5f0 02-Sep-2011 Ted Kremenek <kremenek@apple.com> -Wuninitialized: fix insidious bug resulting from interplay of blocks and dead code. Fixes <rdar://problem/10060250>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139027 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
f1d10d939739f1a4544926d807e4f0f9fb64be61 24-Aug-2011 Ted Kremenek <kremenek@apple.com> Constify the result of CFGStmt::getStmt().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138408 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
e0e29332c89da22b6890929b97e6f568c917d85f 20-Aug-2011 Ted Kremenek <kremenek@apple.com> Remove dead code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138183 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
3060178ad9df29789505c1e6debcfc80a3a13587 18-Aug-2011 Chad Rosier <mcrosier@apple.com> Fix else style. No functionality change intended.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137896 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
9c378f705405d37f49795d5e915989de774fe11f 13-Aug-2011 Ted Kremenek <kremenek@apple.com> Cleanup various declarations of 'Stmt*' to be 'Stmt *', etc. in libAnalyzer and libStaticAnalyzer[*]. It was highly inconsistent, and very ugly to look at.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137537 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
de091aeb4658e986ed8fa5fbce7ab35ef2ae26ec 08-Aug-2011 Ted Kremenek <kremenek@apple.com> Fix another -Wuninitialized assertion failure (this one involving bit casts) resulting from the recent -Wuninitialized changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137068 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
57fb591a54eab7db65d73e77c632f047bca22c54 05-Aug-2011 Ted Kremenek <kremenek@apple.com> Fix assertion failure in -Wuninitialized involving no-op casts. Fixes PR 10577.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136939 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
5f9e272e632e951b1efe824cd16acb4d96077930 23-Jul-2011 Chris Lattner <sabre@nondot.org> remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports
them into the clang namespace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135852 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
d837c0dc361a000b951593eaaa80c46b73d15b1d 22-Jul-2011 Chandler Carruth <chandlerc@gmail.com> Move duplicate uninitialized warning suppression into the
AnalysisBasedWarnings Sema layer and out of the Analysis library itself.
This returns the uninitialized values analysis to a more pure form,
allowing its original logic to correctly detect some categories of
definitely uninitialized values. Fixes PR10358 (again).

Thanks to Ted for reviewing and updating this patch after his rewrite of
several portions of this analysis.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135748 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
dd4286b5b7b02b8bb962e4b996b8f36cb7935d4f 20-Jul-2011 Ted Kremenek <kremenek@apple.com> Fix -Wuninitialized regression involving functions invalidating parameters passed by reference.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135610 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
62d126e942f9f420c6f398d32deb914d413226a3 19-Jul-2011 Ted Kremenek <kremenek@apple.com> Fix false negative in -Wuninitialized involving a () wrapping an lvalue-to-rvalue conversion in a DeclStmt.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135525 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
d626ec404fd0f27244363200f1a85a7db219cd11 19-Jul-2011 Ted Kremenek <kremenek@apple.com> Fix assertion failure in UninitializedValues.cpp where an lvalue to rvalue conversion is wrapped in a parenthesis.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135519 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
0c8e5a0f70cbdb800d939c1807d05f380b2854d4 19-Jul-2011 Ted Kremenek <kremenek@apple.com> Reduce -Wuninitialized time by 22% (on sqlite) by removing the recursive AST crawl.

This is accomplished by forcing the needed expressions for -Wuninitialized to always be CFGElements in the CFG.
This allows us to remove a fair amount of the code for -Wuninitialized.

Some fallout:
- AnalysisBasedWarnings.cpp now specifically toggles the CFGBuilder to create a CFG that is suitable for -Wuninitialized. This
is a layering violation, since the logic for -Wuninitialized is in libAnalysis. This can be fixed with the proper refactoring.
- Some of the source locations for -Wunreachable-code warnings have shifted. While not ideal, this is okay because that analysis
already needs some serious reworking.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135480 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
8435069798b5621615f9f65c471c7e7808316b20 17-Jul-2011 Chandler Carruth <chandlerc@gmail.com> Revert r135217, which wasn't the correct fix for PR10358. With this
patch, we actually move the state-machine for the value set backwards
one step. This can pretty easily lead to infinite loops where we
continually try to propagate a bit, succeed for one iteration, but then
back up because we find an uninitialized use.

A reduced test case from PR10379 is included.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135359 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
05bcade0182524731cf4bc4984e08f63ddf62374 15-Jul-2011 Ted Kremenek <kremenek@apple.com> Fix false negative reported in PR 10358 by using 'Unknown' in -Wuninitialized to avoid cascading warnings. Patch by Kaelyn Uhrain.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135217 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
8052050c8ebfcfbbce8afed57fefc8c95fb9a333 08-Jul-2011 Chandler Carruth <chandlerc@gmail.com> Make the worklist in the uninitialized values checker actually a queue.
Previously, despite the names 'enqueue' and 'dequeue', it behaved as
a stack and visited blocks in a LIFO fashion. This interacts badly with
extremely broad CFGs *inside* of a loop (such as a large switch inside
a state machine) where every block updates a different variable.

When encountering such a CFG, the checker visited blocks in essentially
a "depth first" order due to the stack-like behavior of the work list.
Combined with each block updating a different variable, the saturation
logic of the checker caused it to re-traverse blocks [1,N-1] of the
broad CFG inside the loop after traversing block N. These re-traversals
were to propagate the variable values derived from block N. Assuming
approximately the same number of variables as inner blocks exist, the
end result is O(N^2) updates. By making this a queue, we also make the
traversal essentially "breadth-first" across each of the N inner blocks
of the loop. Then all of this state is propagated around to all N inner
blocks of the loop. The result is O(N) updates.

The truth is in the numbers:
Before, gcc.c: 96409 block visits (max: 61546, avg: 591)
After, gcc.c: 69958 block visits (max: 33090, avg: 429)
Before, PR10183: 2540494 block vists (max: 2536495, avg: 37360)
After, PR10183: 137803 block visits (max: 134406, avg: 2026)

The nearly 20x reduction in work for PR10183 corresponds to a roughly
100x speedup in compile time.

I've tested it on all the code I can get my hands on, and I've seen no
slowdowns due to this change. Where I've collected stats, the ammount of
work done is on average less. I'll also commit shortly some synthetic
test cases useful in analyzing the performance of CFG-based warnings.

Submitting this based on Doug's feedback that post-commit review should
be good. Ted, please review! Hopefully this helps compile times until
then.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134697 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
5d98994c7749312a43ce6adf45537979a98e7afd 06-Jul-2011 Chandler Carruth <chandlerc@gmail.com> Build up statistics about the work done for analysis based warnings.
Special detail is added for uninitialized variable analysis as this has
serious performance problems than need to be tracked.

Computing some of this data is expensive, for example walking the CFG to
determine its size. To avoid doing that unless the stats data is going
to be used, we thread a bit into the Sema object to track whether
detailed stats should be collected or not. This bit is used to avoid
computations whereever the computations are likely to be more expensive
than checking the state of the flag. Thus, counters are in some cases
unconditionally updated, but the more expensive (and less frequent)
aggregation steps are skipped.

With this patch, we're able to see that for 'gcc.c':
*** Analysis Based Warnings Stats:
232 functions analyzed (0 w/o CFGs).
7151 CFG blocks built.
30 average CFG blocks per function.
1167 max CFG blocks per function.
163 functions analyzed for uninitialiazed variables
640 variables analyzed.
3 average variables per function.
94 max variables per function.
96409 block visits.
591 average block visits per function.
61546 max block visits per function.

And for the reduced testcase in PR10183:
*** Analysis Based Warnings Stats:
98 functions analyzed (0 w/o CFGs).
8526 CFG blocks built.
87 average CFG blocks per function.
7277 max CFG blocks per function.
68 functions analyzed for uninitialiazed variables
1359 variables analyzed.
19 average variables per function.
1196 max variables per function.
2540494 block visits.
37360 average block visits per function.
2536495 max block visits per function.

That last number is the somewhat scary one that indicates the problem in
PR10183.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134494 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
049f6d0239e242dc338be6ac6f6c5175803d2163 31-May-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Utilize PackedVector, introduced with llvm commit r132325.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132326 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
e6c28039c63d829577a2e37170e06a1dbdf89748 11-May-2011 Ted Kremenek <kremenek@apple.com> Fix crash in -Wuninitialized when using switch statments whose condition is a logical operation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131158 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
75c4064932d481ac710a80aa88b3370ad8a6af1d 28-Apr-2011 Chandler Carruth <chandlerc@gmail.com> Silence more -Wnon-pod-memset given its current implementation. I may be
able to revert these based on a patch I'm working on, but no reason for
people to be spammed with warnings in the interim.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130394 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
efdf988611c1eb02770643cd3fabd5df2f579353 15-Apr-2011 Douglas Gregor <dgregor@apple.com> When we transform a C++ exception declaration (e.g., for template
instantiation), be sure to add the transformed declaration into the
current DeclContext. Also, remove the -Wuninitialized hack that works
around this bug. Fixes <rdar://problem/9200676>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129544 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
866849498461cf9022316034516475188b25955b 13-Apr-2011 Chandler Carruth <chandlerc@gmail.com> Teach -Wuninitialized about C++'s typeid expression, including both the
evaluated and unevaluated contexts. Add some testing of sizeof and
typeid.

Both of the typeid tests added here were triggering warnings previously.
Now the one false positive is suppressed without suppressing the warning
on actually buggy code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129431 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
a21612f95792c1ea8b4362f0861f0c724c39388e 07-Apr-2011 Ted Kremenek <kremenek@apple.com> Teach -Wuninitialized to not warn about variables declared in C++ catch statements.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129102 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
b88fb027bfe2f85da3a341f42549900bd658ac8b 05-Apr-2011 Chandler Carruth <chandlerc@gmail.com> Commit a bit of a hack to fully handle the situation where variables are
marked explicitly as uninitialized through direct self initialization:

int x = x;

With r128894 we prevented warnings about this code, and this patch
teaches the analysis engine to continue analyzing subsequent uses of
'x'. This should wrap up PR9624.

There is still an open question of whether we should suppress the
maybe-uninitialized warnings resulting from variables initialized in
this fashion. The definitely-uninitialized uses should always be warned.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128932 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
d40066b0fb883839a9100e5455e33190b9b8abac 05-Apr-2011 Ted Kremenek <kremenek@apple.com> Fix PR 9626 (duplicated self-init warnings under -Wuninitialized) with numerous CFG and UninitializedValues analysis changes:

1) Change the CFG to include the DeclStmt for conditional variables, instead of using the condition itself as a faux DeclStmt.
2) Update ExprEngine (the static analyzer) to understand (1), so not to regress.
3) Update UninitializedValues.cpp to initialize all tracked variables to Uninitialized at the start of the function/method.
4) Only use the SelfReferenceChecker (SemaDecl.cpp) on global variables, leaving the dataflow analysis to handle other cases.

The combination of (1) and (3) allows the dataflow-based -Wuninitialized to find self-init problems when the initializer
contained control-flow.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128858 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
f8adeefa9e9882bff402e092024dd457f8574673 04-Apr-2011 Ted Kremenek <kremenek@apple.com> -Wuninitialized: don't warn about uninitialized variables in unreachable code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128840 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
bc8b44c4ee7f9c4c3ad296369e72feda61bdb580 01-Apr-2011 Ted Kremenek <kremenek@apple.com> -Wuninitialized should not warn about variables captured by blocks as byref.

Note this can potentially be enhanced to detect if the __block variable
is actually written by the block, or only when the block "escapes" or
is actually used, but that requires more analysis than it is probably worth
for this simple check.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128681 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
b831c673621c5587642343cace9def134916a17b 29-Mar-2011 Ted Kremenek <kremenek@apple.com> Add workaround for Sema issue found in <rdar://problem/9188004>, which leads to an assertion failure in the uninitialized variables analysis. The problem is that Sema isn't properly registering a variable in a DeclContext (which -Wuninitialized relies on), but
my expertise on the template instantiation logic isn't good enough to fix this problem for real. This patch worksaround the
problem in -Wuninitialized, but we should fix it for real later.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128443 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
da57f3eeab7b7f7f6e6788956f0a0d9adf196a7d 26-Mar-2011 Benjamin Kramer <benny.kra@googlemail.com> Make helpers static.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128339 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
1cbc31515e9b979f55178ffd4587e8671f7ebbfa 17-Mar-2011 Ted Kremenek <kremenek@apple.com> Extend -Wuninitialized to support vector types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127794 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
4ddb3871307376d27d0f276c9da0ecce0384f01f 15-Mar-2011 Ted Kremenek <kremenek@apple.com> Appease GCC. I'm surprised Clang accepted this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127672 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
76709bf816e5e1b70b859bb607cf3ee91db12b76 15-Mar-2011 Ted Kremenek <kremenek@apple.com> Split warnings from -Wuninitialized-experimental into "must-be-initialized" and "may-be-initialized" warnings, each controlled by different flags.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127669 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
f7bafc77ba12bb1beb665243a0334cd81e024728 15-Mar-2011 Ted Kremenek <kremenek@apple.com> Split warnings from -Wuninitialized-experimental into "must-be-initialized" and "may-be-initialized" warnings, each controlled by different flags.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127666 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
496398d523de712ac1084c53a397ca3987fe43db 15-Mar-2011 Ted Kremenek <kremenek@apple.com> UninitializedValues: introduce ValueVector:reference class to forward to llvm::BitVector. No real functionality change, but this is a stepping stone to moving to tri-state logic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127665 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
afb10c4bda2ac2c268fa7e6c11141584f57de119 15-Mar-2011 Ted Kremenek <kremenek@apple.com> UninitializedValues: wrap BitVector references in a new class ValueVector. No functionality change. This defines the minimum interface that ValueVector needs to support when we no longer base it strictly on a direct interpretation of BitVector.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127664 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
136f8f24b0b6c0e57aaa4375d280d72dc5492615 15-Mar-2011 Ted Kremenek <kremenek@apple.com> Substitue term "BitVector" with "ValueVector" to prep for further revisions. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127663 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
6f34213f8d6ae8c77685b53664527e39bfaaca3b 15-Mar-2011 Ted Kremenek <kremenek@apple.com> Rename UninitializedValuesV2 to UninitializedValues.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127657 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
f3f5379f6da7f8f141a53e2945871a5aa5431e02 15-Mar-2011 Ted Kremenek <kremenek@apple.com> Remove old UninitializedValues analysis.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127656 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
56ca35d396d8692c384c785f9aeebcf22563fe1e 17-Feb-2011 John McCall <rjmccall@apple.com> Change the representation of GNU ?: expressions to use a different expression
class and to bind the shared value using OpaqueValueExpr. This fixes an
unnoticed problem with deserialization of these expressions where the
deserialized form would lose the vital pointer-equality trait; or rather,
it fixes it because this patch also does the right thing for deserializing
OVEs.

Change OVEs to not be a "temporary object" in the sense that copy elision is
permitted.

This new representation is not totally unawkward to work with, but I think
that's really part and parcel with the semantics we're modelling here. In
particular, it's much easier to fix things like the copy elision bug and to
make the CFG look right.

I've tried to update the analyzer to deal with this in at least some
obvious cases, and I think we get a much better CFG out, but the printing
of OpaqueValueExprs probably needs some work.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125744 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
7502c1d3ce8bb97bcc4f7bebef507040bd93b26f 13-Feb-2011 John McCall <rjmccall@apple.com> Give some convenient idiomatic accessors to Stmt::child_range and
Stmt::const_child_range, then make a bunch of places use them instead
of the individual iterator accessors.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125450 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
848ec83483ca4ba52ed72c7e29ebc330f8c87252 12-Feb-2011 Ted Kremenek <kremenek@apple.com> Don't report dead stores on unreachable code paths. Fixes <rdar://problem/8405222>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125415 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
b6bbcc9995186799a60ce17d0c1acff31601653a 15-Oct-2010 John McCall <rjmccall@apple.com> Death to blocks, or at least the word "block" in one particular obnoxiously
ambiguous context.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116567 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
2de56d1d0c3a504ad1529de2677628bdfbb95cd4 25-Aug-2010 John McCall <rjmccall@apple.com> GCC didn't care for my attempt at API compatibility, so brute-force everything
to the new constants.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112047 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
5ba290a12fb9390a77ea4dca3d98deb53022d182 02-Mar-2010 Ted Kremenek <kremenek@apple.com> [CFG]

After discussion with Zhongxing, don't force the initializer of DeclStmts to be
block-level expressions.

This led to some interesting fallout:

[UninitializedValues]

Always visit the initializer of DeclStmts (do not assume they are block-level expressions).

[BasicStore]

With initializers of DeclStmts no longer block-level expressions, this causes self-referencing initializers (e.g. 'int x = x') to no longer cause the initialized variable to be live before the DeclStmt. While this is correct, it caused BasicStore::RemoveDeadBindings() to prune off the values of these variables from the initial store (where they are set to uninitialized). The fix is to back-port some (and only some) of the lazy-binding logic from RegionStore to
BasicStore. Now the default values of local variables are determined lazily as opposed
to explicitly initialized.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97591 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
1309f9a3b225ea846e5822691c39a77423125505 25-Jan-2010 Ted Kremenek <kremenek@apple.com> Split libAnalysis into two libraries: libAnalysis and libChecker.

(1) libAnalysis is a generic analysis library that can be used by
Sema. It defines the CFG, basic dataflow analysis primitives, and
inexpensive flow-sensitive analyses (e.g. LiveVariables).

(2) libChecker contains the guts of the static analyzer, incuding the
path-sensitive analysis engine and domain-specific checks.

Now any clients that want to use the frontend to build their own tools
don't need to link in the entire static analyzer.

This change exposes various obvious cleanups that can be made to the
layout of files and headers in libChecker. More changes pending. :)

This change also exposed a layering violation between AnalysisContext
and MemRegion. BlockInvocationContext shouldn't explicitly know about
BlockDataRegions. For now I've removed the BlockDataRegion* from
BlockInvocationContext (removing context-sensitivity; although this
wasn't used yet). We need to have a better way to extend
BlockInvocationContext (and any LocationContext) to add
context-sensitivty.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94406 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
ba5fb5a955c896815c439289fc51c03cf0635129 28-Nov-2009 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> lib/Analysis: Remove VISIBILITY_HIDDEN from definitions in anonymous namespace

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90028 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
1eb4433ac451dc16f4133a88af2d002ac26c58ef 09-Sep-2009 Mike Stump <mrs@apple.com> Remove tabs, and whitespace cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
7e24e82a70a2c681f4291a3397bcd1e1005f251a 28-Mar-2009 Chris Lattner <sabre@nondot.org> rename some methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67923 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
500d3297d2a21edeac4d46cbcbe21bc2352c2a28 29-Jan-2009 Chris Lattner <sabre@nondot.org> move library-specific diagnostic headers into library private dirs. Reduce
redundant #includes. Patch by Anders Johnsen!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63271 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
20c6b3b85e186cd52d5d99489132d71d498159eb 27-Jan-2009 Chris Lattner <sabre@nondot.org> Split the single monolithic DiagnosticKinds.def file into one
.def file for each library. This means that adding a diagnostic
to sema doesn't require all the other libraries to be rebuilt.

Patch by Anders Johnsen!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63111 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
c2813f77bad184470f81f85f7df88b87eb1bb915 14-Nov-2008 Ted Kremenek <kremenek@apple.com> Flow-sensitive uninitialized values analysis: properly handle the 'element' expression of ObjCForCollectionStmt (can be anything).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59312 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
8d798c75b8aa8457ea06b22c6637d626ce1402de 14-Nov-2008 Ted Kremenek <kremenek@apple.com> Rename header file.
Update include files.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59284 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
bfcb712627b9346ab92880d9075896dcc7700ac2 12-Nov-2008 Ted Kremenek <kremenek@apple.com> Update CFGStmtVisitor to recognize that ObjCForCollectionStmts are special block-level "expressions".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59176 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
e219b8a9c02198b1938dfa9ed91ef9cf0e6ce4f3 11-Nov-2008 Ted Kremenek <kremenek@apple.com> Flow-sensitive uninitialized values analysis:
- Added support for ObjCForCollectionStmt
- Fixed bug where expression values would be always set to uninitialized when loops were involved


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59076 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
0518999d3adcc289997bd974dce90cc97f5c1c44 11-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Introduce a single AST node SizeOfAlignOfExpr for all sizeof and alignof expressions, both of values and types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59057 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
5d796aa7899d37d7f243fbc738d6bb8108791fbe 16-Aug-2008 Nick Lewycky <nicholas@mxc.ca> It's spelt "uninitialized".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54848 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
14f8b4ff660bcaa763974b8d0fae81857c594495 05-Aug-2008 Ted Kremenek <kremenek@apple.com> Added decl_iterator to DeclStmt to provide an abstract interface to iterate over the ScopedDecls of a DeclStmt.
Updated a few clients of DeclStmt::getNextDeclarator() to use decl_iterator instead. Will update other clients after additional testing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54368 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
5da6b2592fbf69708a7863b41d8bd76440d0f41b 17-Apr-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix MSVC compiler error: "initialization of 'VD' is skipped by 'case' label"

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49853 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
411cdee0b490f79428c9eb977f25199eb7d21cd8 16-Apr-2008 Ted Kremenek <kremenek@apple.com> Added CFGBlock::getTerminatorCondition() to get the Expr* of the condition a block's terminator.
Refactored LiveVariables to use getTerminatorCondition() in VisitTerminator().

Bug fix: CFG now computes Block-level expression numbers using information
from block terminators. This fixes <rdar://problem/5868189>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49818 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
2f868c013935791c421def45b422a6f6e79d2e4a 16-Apr-2008 Ted Kremenek <kremenek@apple.com> Simplify some code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49763 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
606ceeef820a3ecd46255d155e5d7f3aa888a04b 16-Apr-2008 Ted Kremenek <kremenek@apple.com> Change "VisitBlockVarDecl" to "VisitVarDecl". UninitializedValues now works
as before r49748 (where BlockVarDecl was removed).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49749 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
248a753f6b670692523c99afaeb8fe98f7ae3ca7 16-Apr-2008 Steve Naroff <snaroff@apple.com> Remove FileVarDecl and BlockVarDecl. They are replaced by VarDecl::isBlockVarDecl() and VarDecl::isFileVarDecl().

This is a fairly mechanical/large change. As a result, I avoided making any changes/simplifications that weren't directly related. I did break two Analysis tests. I also have a couple FIXME's in UninitializedValues.cpp. Ted, can you take a look? If the bug isn't obvious, I am happy to dig in and fix it (since I broke it).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49748 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
7deed0c65b315cac037539401c49586283158d9f 15-Apr-2008 Ted Kremenek <kremenek@apple.com> Fix bug in terminator processing for uninitialized-values: simply ignore the terminator, don't reprocess it.

LiveVariables analysis now does a flow-insensitive analysis to determine what variables have their address taken; these variables are now always treated as being live.

The DataflowSolver now uses "SetTopValue()" when getting the initial value for the entry/exit block.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49734 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
37622081d8a139a3249613acaa80106ec97261fb 15-Apr-2008 Ted Kremenek <kremenek@apple.com> Added initial support into the flow-sensitive dataflow solver to visit the Block-level expression
in a block's terminator. This expression is visited within a block, but it is accessed by the
terminator. This is important to observe because for live-variables analysis the block-level
expression is live between the terminator and where the expression occurs in the block. So far
this hasn't been an issue to not observe this because the block-level expression used in the
terminator is always the last one in the block, and we have never queried the liveness information
about this point (but before the terminator).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49709 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
5fb5c6afbb331b87c638fad42f5b37ed697e5580 22-Mar-2008 Ted Kremenek <kremenek@apple.com> Changed merge operation for uninitialized values analysis to "intersect" (previous union).

The effect is that if a variable is uninitialized along a branch (but initialized along another), at merge points it is considered uninitialized. Previously we had the opposite behavior. The new behavior is more conservative, and more in line with gcc's behavior.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48689 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp
bda0b626e74513950405c27525af87e214e605e2 16-Mar-2008 Chris Lattner <sabre@nondot.org> Make a major restructuring of the clang tree: introduce a top-level
lib dir and move all the libraries into it. This follows the main
llvm tree, and allows the libraries to be built in parallel. The
top level now enforces that all the libs are built before Driver,
but we don't care what order the libs are built in. This speeds
up parallel builds, particularly incremental ones.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48402 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/UninitializedValues.cpp