diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-01-26 01:26:41 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-01-26 01:26:41 +0000 |
commit | 4717f163eb3578f5bada399dd6ced1c62847bfe4 (patch) | |
tree | 430e783d0590b1fc883b966ad1eab6c92c41521a /lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp | |
parent | d0fbadd012ba0a3a23af7af56837b7ef9b0637ac (diff) |
[analyzer] Improve the diagnostic for the self-init checker. Suggestion by Ted!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124263 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp b/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp index b62d2309fc..2eceb9caa3 100644 --- a/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp @@ -102,8 +102,8 @@ namespace { class InitSelfBug : public BugType { const std::string desc; public: - InitSelfBug() : BugType("missing \"self = [{initializer}]\"", - "missing \"self = [{initializer}]\"") {} + InitSelfBug() : BugType("missing \"self = [(super or self) init...]\"", + "missing \"self = [(super or self) init...]\"") {} }; } // end anonymous namespace @@ -209,7 +209,8 @@ void ObjCSelfInitChecker::PostVisitObjCIvarRefExpr(CheckerContext &C, return; checkForInvalidSelf(E->getBase(), C, - "Using an ivar before setting 'self' to the result of an initializer"); + "Instance variable used before setting 'self' to the result of " + "'[(super or self) init...]'"); } void ObjCSelfInitChecker::PreVisitReturnStmt(CheckerContext &C, @@ -220,7 +221,8 @@ void ObjCSelfInitChecker::PreVisitReturnStmt(CheckerContext &C, return; checkForInvalidSelf(S->getRetValue(), C, - "Returning 'self' before setting it to the result of an initializer"); + "Returning 'self' before setting it to the result of " + "'[(super or self) init...]'"); } // When a call receives a reference to 'self', [Pre/Post]VisitGenericCall pass |