From: George Karpenkov Date: Thu, 10 Jan 2019 18:28:10 +0000 (+0000) Subject: [analyzer] [hotfix] Fix the tests X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7697c704e135cefdc7f19ba5d6d4749944669be2;p=clang [analyzer] [hotfix] Fix the tests The error must have crept during the cherry-pick. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@350870 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp b/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp index b4f58b55a3..4309603862 100644 --- a/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp +++ b/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp @@ -156,23 +156,25 @@ static void generateDiagnosticsForCallLike(ProgramStateRef CurrSt, } } + os << " returns "; + if (CurrV.getObjKind() == ObjKind::CF) { - os << " a Core Foundation object of type '" + os << "a Core Foundation object of type '" << Sym->getType().getAsString() << "' with a "; } else if (CurrV.getObjKind() == ObjKind::OS) { - os << " an OSObject of type '" << getPrettyTypeName(Sym->getType()) + os << "an OSObject of type '" << getPrettyTypeName(Sym->getType()) << "' with a "; } else if (CurrV.getObjKind() == ObjKind::Generalized) { - os << " an object of type '" << Sym->getType().getAsString() + os << "an object of type '" << Sym->getType().getAsString() << "' with a "; } else { assert(CurrV.getObjKind() == ObjKind::ObjC); QualType T = Sym->getType(); if (!isa(T)) { - os << " returns an Objective-C object with a "; + os << "an Objective-C object with a "; } else { const ObjCObjectPointerType *PT = cast(T); - os << " returns an instance of " << PT->getPointeeType().getAsString() + os << "an instance of " << PT->getPointeeType().getAsString() << " with a "; } }