diff options
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp b/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp index 9eb6b19ec7..c887ac86ef 100644 --- a/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp @@ -58,7 +58,7 @@ using namespace ento; static bool shouldRunOnFunctionOrMethod(const NamedDecl *ND); static bool isInitializationMethod(const ObjCMethodDecl *MD); -static bool isInitMessage(const ObjCMessageExpr *E); +static bool isInitMessage(const ObjCMessage &msg); static bool isSelfVar(SVal location, CheckerContext &C); namespace { @@ -82,7 +82,7 @@ class ObjCSelfInitChecker : public CheckerVisitor<ObjCSelfInitChecker> { public: static void *getTag() { static int tag = 0; return &tag; } - void PostVisitObjCMessageExpr(CheckerContext &C, const ObjCMessageExpr *E); + void postVisitObjCMessage(CheckerContext &C, ObjCMessage msg); void PostVisitObjCIvarRefExpr(CheckerContext &C, const ObjCIvarRefExpr *E); void PreVisitReturnStmt(CheckerContext &C, const ReturnStmt *S); void PreVisitGenericCall(CheckerContext &C, const CallExpr *CE); @@ -176,8 +176,8 @@ static void checkForInvalidSelf(const Expr *E, CheckerContext &C, C.EmitReport(report); } -void ObjCSelfInitChecker::PostVisitObjCMessageExpr(CheckerContext &C, - const ObjCMessageExpr *E) { +void ObjCSelfInitChecker::postVisitObjCMessage(CheckerContext &C, + ObjCMessage msg) { // When encountering a message that does initialization (init rule), // tag the return value so that we know later on that if self has this value // then it is properly initialized. @@ -187,10 +187,10 @@ void ObjCSelfInitChecker::PostVisitObjCMessageExpr(CheckerContext &C, C.getCurrentAnalysisContext()->getDecl()))) return; - if (isInitMessage(E)) { + if (isInitMessage(msg)) { // Tag the return value as the result of an initializer. const GRState *state = C.getState(); - SVal V = state->getSVal(E); + SVal V = state->getSVal(msg.getOriginExpr()); addSelfFlag(V, SelfFlag_InitRes, C); return; } @@ -301,6 +301,6 @@ static bool isInitializationMethod(const ObjCMethodDecl *MD) { /*ignorePrefix=*/false) == cocoa::InitRule; } -static bool isInitMessage(const ObjCMessageExpr *E) { - return cocoa::deriveNamingConvention(E->getSelector()) == cocoa::InitRule; +static bool isInitMessage(const ObjCMessage &msg) { + return cocoa::deriveNamingConvention(msg.getSelector()) == cocoa::InitRule; } |