From 486754660bb926339aefcf012a3f848592babb8b Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 28 Jul 2018 11:06:01 +0000 Subject: Vendor import of clang trunk r338150: https://llvm.org/svn/llvm-project/cfe/trunk@338150 --- lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp') diff --git a/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp b/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp index 371187747f039..7d6358acbbace 100644 --- a/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp +++ b/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp @@ -436,8 +436,7 @@ void CFNumberChecker::checkPreStmt(const CallExpr *CE, return; // Get the value of the "theType" argument. - const LocationContext *LCtx = C.getLocationContext(); - SVal TheTypeVal = state->getSVal(CE->getArg(1), LCtx); + SVal TheTypeVal = C.getSVal(CE->getArg(1)); // FIXME: We really should allow ranges of valid theType values, and // bifurcate the state appropriately. @@ -457,7 +456,7 @@ void CFNumberChecker::checkPreStmt(const CallExpr *CE, // Look at the value of the integer being passed by reference. Essentially // we want to catch cases where the value passed in is not equal to the // size of the type being created. - SVal TheValueExpr = state->getSVal(CE->getArg(2), LCtx); + SVal TheValueExpr = C.getSVal(CE->getArg(2)); // FIXME: Eventually we should handle arbitrary locations. We can do this // by having an enhanced memory model that does low-level typing. @@ -571,7 +570,7 @@ void CFRetainReleaseChecker::checkPreStmt(const CallExpr *CE, // Get the argument's value. const Expr *Arg = CE->getArg(0); - SVal ArgVal = state->getSVal(Arg, C.getLocationContext()); + SVal ArgVal = C.getSVal(Arg); Optional DefArgVal = ArgVal.getAs(); if (!DefArgVal) return; @@ -977,8 +976,7 @@ assumeCollectionNonEmpty(CheckerContext &C, ProgramStateRef State, if (!State) return nullptr; - SymbolRef CollectionS = - State->getSVal(FCS->getCollection(), C.getLocationContext()).getAsSymbol(); + SymbolRef CollectionS = C.getSVal(FCS->getCollection()).getAsSymbol(); return assumeCollectionNonEmpty(C, State, CollectionS, Assumption); } @@ -1166,7 +1164,7 @@ void ObjCLoopChecker::checkDeadSymbols(SymbolReaper &SymReaper, namespace { /// \class ObjCNonNilReturnValueChecker -/// \brief The checker restricts the return values of APIs known to +/// The checker restricts the return values of APIs known to /// never (or almost never) return 'nil'. class ObjCNonNilReturnValueChecker : public CheckergetSVal(NonNullExpr, C.getLocationContext()); + SVal Val = C.getSVal(NonNullExpr); if (Optional DV = Val.getAs()) return State->assume(*DV, true); return State; -- cgit v1.3