diff options
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers')
3 files changed, 20 insertions, 20 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.cpp index 87c1ad9edb8..a9b6d6839d9 100644 --- a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.cpp @@ -299,12 +299,12 @@ void RetainCountChecker::processObjCLiterals(CheckerContext &C, } // Return the object as autoreleased. - // RetEffect RE = RetEffect::MakeNotOwned(RetEffect::ObjC); + // RetEffect RE = RetEffect::MakeNotOwned(ObjKind::ObjC); if (SymbolRef sym = state->getSVal(Ex, pred->getLocationContext()).getAsSymbol()) { QualType ResultTy = Ex->getType(); state = setRefBinding(state, sym, - RefVal::makeNotOwned(RetEffect::ObjC, ResultTy)); + RefVal::makeNotOwned(ObjKind::ObjC, ResultTy)); } C.addTransition(state); @@ -330,7 +330,7 @@ void RetainCountChecker::checkPostStmt(const ObjCBoxedExpr *Ex, if (SymbolRef Sym = Pred->getSVal(Ex).getAsSymbol()) { QualType ResultTy = Ex->getType(); State = setRefBinding(State, Sym, - RefVal::makeNotOwned(RetEffect::ObjC, ResultTy)); + RefVal::makeNotOwned(ObjKind::ObjC, ResultTy)); } C.addTransition(State); @@ -351,11 +351,11 @@ void RetainCountChecker::checkPostStmt(const ObjCIvarRefExpr *IRE, // forgiving about what the surrounding code is allowed to do. QualType Ty = Sym->getType(); - RetEffect::ObjKind Kind; + ObjKind Kind; if (Ty->isObjCRetainableType()) - Kind = RetEffect::ObjC; + Kind = ObjKind::ObjC; else if (coreFoundation::isCFObjectRef(Ty)) - Kind = RetEffect::CF; + Kind = ObjKind::CF; else return; @@ -514,7 +514,7 @@ static bool isPointerToObject(QualType QT) { /// OSObjects are escaped when passed to void * / etc. static bool shouldEscapeArgumentOnCall(const CallEvent &CE, unsigned ArgIdx, const RefVal *TrackedValue) { - if (TrackedValue->getObjKind() != RetEffect::OS) + if (TrackedValue->getObjKind() != ObjKind::OS) return false; if (ArgIdx >= CE.parameters().size()) return false; @@ -583,7 +583,7 @@ static ProgramStateRef updateOutParameter(ProgramStateRef State, switch (Effect) { case UnretainedOutParameter: State = setRefBinding(State, Pointee, - RefVal::makeNotOwned(RetEffect::CF, PointeeTy)); + RefVal::makeNotOwned(ObjKind::CF, PointeeTy)); break; case RetainedOutParameter: // Do nothing. Retained out parameters will either point to a +1 reference @@ -1407,11 +1407,11 @@ void RetainCountChecker::checkBeginFunction(CheckerContext &Ctx) const { const ArgEffect *AE = CalleeSideArgEffects.lookup(idx); if (AE && *AE == DecRef && isISLObjectRef(Ty)) { state = setRefBinding( - state, Sym, RefVal::makeOwned(RetEffect::ObjKind::Generalized, Ty)); + state, Sym, RefVal::makeOwned(ObjKind::Generalized, Ty)); } else if (isISLObjectRef(Ty)) { state = setRefBinding( state, Sym, - RefVal::makeNotOwned(RetEffect::ObjKind::Generalized, Ty)); + RefVal::makeNotOwned(ObjKind::Generalized, Ty)); } } diff --git a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.h b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.h index 151aa49ed4a..d8bbe6fcdd4 100644 --- a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.h +++ b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.h @@ -94,7 +94,7 @@ private: /// The kind of object being tracked (CF or ObjC or OSObject), if known. /// - /// See the RetEffect::ObjKind enum for possible values. + /// See the ObjKind enum for possible values. unsigned RawObjectKind : 3; /// True if the current state and/or retain count may turn out to not be the @@ -108,7 +108,7 @@ private: /// them. unsigned RawIvarAccessHistory : 2; - RefVal(Kind k, RetEffect::ObjKind o, unsigned cnt, unsigned acnt, QualType t, + RefVal(Kind k, ObjKind o, unsigned cnt, unsigned acnt, QualType t, IvarAccessHistory IvarAccess) : Cnt(cnt), ACnt(acnt), T(t), RawKind(static_cast<unsigned>(k)), RawObjectKind(static_cast<unsigned>(o)), @@ -121,8 +121,8 @@ private: public: Kind getKind() const { return static_cast<Kind>(RawKind); } - RetEffect::ObjKind getObjKind() const { - return static_cast<RetEffect::ObjKind>(RawObjectKind); + ObjKind getObjKind() const { + return static_cast<ObjKind>(RawObjectKind); } unsigned getCount() const { return Cnt; } @@ -170,7 +170,7 @@ public: /// current function, at least partially. /// /// Most commonly, this is an owned object with a retain count of +1. - static RefVal makeOwned(RetEffect::ObjKind o, QualType t) { + static RefVal makeOwned(ObjKind o, QualType t) { return RefVal(Owned, o, /*Count=*/1, 0, t, IvarAccessHistory::None); } @@ -178,7 +178,7 @@ public: /// the current function. /// /// Most commonly, this is an unowned object with a retain count of +0. - static RefVal makeNotOwned(RetEffect::ObjKind o, QualType t) { + static RefVal makeNotOwned(ObjKind o, QualType t) { return RefVal(NotOwned, o, /*Count=*/0, 0, t, IvarAccessHistory::None); } diff --git a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp index 74dd1e149ef..44cb7553c0d 100644 --- a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp @@ -156,17 +156,17 @@ static void generateDiagnosticsForCallLike(ProgramStateRef CurrSt, } } - if (CurrV.getObjKind() == RetEffect::CF) { + if (CurrV.getObjKind() == ObjKind::CF) { os << " returns a Core Foundation object of type " << Sym->getType().getAsString() << " with a "; - } else if (CurrV.getObjKind() == RetEffect::OS) { + } else if (CurrV.getObjKind() == ObjKind::OS) { os << " returns an OSObject of type " << getPrettyTypeName(Sym->getType()) << " with a "; - } else if (CurrV.getObjKind() == RetEffect::Generalized) { + } else if (CurrV.getObjKind() == ObjKind::Generalized) { os << " returns an object of type " << Sym->getType().getAsString() << " with a "; } else { - assert(CurrV.getObjKind() == RetEffect::ObjC); + assert(CurrV.getObjKind() == ObjKind::ObjC); QualType T = Sym->getType(); if (!isa<ObjCObjectPointerType>(T)) { os << " returns an Objective-C object with a "; |

