diff options
author | John McCall <rjmccall@apple.com> | 2011-03-02 01:50:55 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-03-02 01:50:55 +0000 |
commit | b4526252db52ddbb931c0ea09a1f3dba3b5ce3f9 (patch) | |
tree | 8f9cd2793db72bf31d5bc6dbba25e5c16aeb54d2 /clang/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp | |
parent | 846ded2e53c77b43aae86a6ed60772ae46647e63 (diff) | |
download | bcm5719-llvm-b4526252db52ddbb931c0ea09a1f3dba3b5ce3f9.tar.gz bcm5719-llvm-b4526252db52ddbb931c0ea09a1f3dba3b5ce3f9.zip |
Move some of the logic about classifying Objective-C methods into
conventional categories into Basic and AST. Update the self-init checker
to use this logic; CFRefCountChecker is complicated enough that I didn't
want to touch it.
llvm-svn: 126817
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp index cb591ac73a7..617121ff0f5 100644 --- a/clang/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp @@ -52,7 +52,6 @@ #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h" #include "clang/StaticAnalyzer/Core/PathSensitive/GRStateTrait.h" #include "clang/StaticAnalyzer/Core/BugReporter/BugType.h" -#include "clang/Analysis/DomainSpecific/CocoaConventions.h" #include "clang/AST/ParentMap.h" using namespace clang; @@ -347,15 +346,11 @@ static bool isSelfVar(SVal location, CheckerContext &C) { } static bool isInitializationMethod(const ObjCMethodDecl *MD) { - // Init methods with prefix like '-(id)_init' are private and the requirements - // are less strict so we don't check those. - return MD->isInstanceMethod() && - cocoa::deriveNamingConvention(MD->getSelector(), - /*ignorePrefix=*/false) == cocoa::InitRule; + return MD->getMethodFamily() == OMF_init; } static bool isInitMessage(const ObjCMessage &msg) { - return cocoa::deriveNamingConvention(msg.getSelector()) == cocoa::InitRule; + return msg.getMethodFamily() == OMF_init; } //===----------------------------------------------------------------------===// |