summaryrefslogtreecommitdiffstats
path: root/clang/Driver
diff options
context:
space:
mode:
Diffstat (limited to 'clang/Driver')
-rw-r--r--clang/Driver/Analyses.def3
-rw-r--r--clang/Driver/AnalysisConsumer.cpp5
2 files changed, 8 insertions, 0 deletions
diff --git a/clang/Driver/Analyses.def b/clang/Driver/Analyses.def
index 623a2475d6b..841f0c1da1e 100644
--- a/clang/Driver/Analyses.def
+++ b/clang/Driver/Analyses.def
@@ -33,6 +33,9 @@ ANALYSIS(WarnObjCMethSigs, "warn-objc-methodsigs",
ANALYSIS(WarnObjCDealloc, "warn-objc-missing-dealloc",
"Warn about Objective-C classes that lack a correct implementation of -dealloc",
ObjCImplementation)
+
+ANALYSIS(WarnObjCUnusedIvars, "warn-objc-unused-ivars",
+ "Warn about private ivars that are never used", ObjCImplementation)
ANALYSIS(CheckerSimple, "checker-simple",
"Perform simple path-sensitive checks.", Code)
diff --git a/clang/Driver/AnalysisConsumer.cpp b/clang/Driver/AnalysisConsumer.cpp
index deb7a85006c..134f6d65334 100644
--- a/clang/Driver/AnalysisConsumer.cpp
+++ b/clang/Driver/AnalysisConsumer.cpp
@@ -393,6 +393,11 @@ static void ActionWarnObjCDealloc(AnalysisManager& mgr) {
mgr.getLangOptions(), BR);
}
+static void ActionWarnObjCUnusedIvars(AnalysisManager& mgr) {
+ BugReporter BR(mgr);
+ CheckObjCUnusedIvar(cast<ObjCImplementationDecl>(mgr.getCodeDecl()), BR);
+}
+
static void ActionWarnObjCMethSigs(AnalysisManager& mgr) {
BugReporter BR(mgr);
OpenPOWER on IntegriCloud