summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-01-26 01:26:41 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-01-26 01:26:41 +0000
commit8781b7ddedb59a5710ce4a83c50601f6982190d0 (patch)
tree757f69e03bf65ae5bb7e02ec93173dcc20ee102a /clang/lib/StaticAnalyzer
parentf6aaf3110392c7d50cf88391ec115aca1331bf68 (diff)
downloadbcm5719-llvm-8781b7ddedb59a5710ce4a83c50601f6982190d0.tar.gz
bcm5719-llvm-8781b7ddedb59a5710ce4a83c50601f6982190d0.zip
[analyzer] Improve the diagnostic for the self-init checker. Suggestion by Ted!
llvm-svn: 124263
Diffstat (limited to 'clang/lib/StaticAnalyzer')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp
index b62d2309fce..2eceb9caa32 100644
--- a/clang/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp
+++ b/clang/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
OpenPOWER on IntegriCloud