aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/AnalysisBasedWarnings.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-07-22 05:27:52 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-07-22 05:27:52 +0000
commitd837c0dc361a000b951593eaaa80c46b73d15b1d (patch)
treeffc7bdba6c1a388c41ac76f918663173ffa12f7d /lib/Sema/AnalysisBasedWarnings.cpp
parentba3dd902d1cde09776a50c1adf2cd40bf0a15a7f (diff)
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
Diffstat (limited to 'lib/Sema/AnalysisBasedWarnings.cpp')
-rw-r--r--lib/Sema/AnalysisBasedWarnings.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/Sema/AnalysisBasedWarnings.cpp b/lib/Sema/AnalysisBasedWarnings.cpp
index 06e42b7728..3dae7b4d7e 100644
--- a/lib/Sema/AnalysisBasedWarnings.cpp
+++ b/lib/Sema/AnalysisBasedWarnings.cpp
@@ -560,8 +560,6 @@ public:
const VarDecl *vd = i->first;
UsesVec *vec = i->second;
- bool fixitIssued = false;
-
// Sort the uses by their SourceLocations. While not strictly
// guaranteed to produce them in line/column order, this will provide
// a stable ordering.
@@ -573,11 +571,11 @@ public:
/*isAlwaysUninit=*/vi->second))
continue;
- // Suggest a fixit hint the first time we diagnose a use of a variable.
- if (!fixitIssued) {
- SuggestInitializationFixit(S, vd);
- fixitIssued = true;
- }
+ SuggestInitializationFixit(S, vd);
+
+ // Skip further diagnostics for this variable. We try to warn only on
+ // the first point at which a variable is used uninitialized.
+ break;
}
delete vec;