aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-03-02 01:50:55 +0000
committerJohn McCall <rjmccall@apple.com>2011-03-02 01:50:55 +0000
commit85f3d76c0ecfdefcf83ea44a57b7a16119c8a045 (patch)
tree17c4f0f29745d2882c474b044579594bf16a9002 /lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp
parentfa0b409ef81f1f70edfa72857c4e211ff50998d5 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126817 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp')
-rw-r--r--lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp b/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp
index cb591ac73a..617121ff0f 100644
--- a/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp
+++ b/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;
}
//===----------------------------------------------------------------------===//