]> granicus.if.org Git - clang/commit
Fix PR 9626 (duplicated self-init warnings under -Wuninitialized) with numerous CFG...
authorTed Kremenek <kremenek@apple.com>
Mon, 4 Apr 2011 23:29:12 +0000 (23:29 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 4 Apr 2011 23:29:12 +0000 (23:29 +0000)
commitd40066b0fb883839a9100e5455e33190b9b8abac
tree124f08f735101c427e0c9a852b248584814c7022
parentab868e2b409e73516dd83c44e1a32c122c460757
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
include/clang/AST/Stmt.h
include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
lib/Analysis/CFG.cpp
lib/Analysis/UninitializedValues.cpp
lib/Sema/AnalysisBasedWarnings.cpp
lib/Sema/SemaDecl.cpp
lib/StaticAnalyzer/Core/ExprEngine.cpp
test/Analysis/auto-obj-dtors-cfg-output.cpp
test/Sema/uninit-variables.c
test/SemaCXX/uninitialized.cpp