Index: clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.cpp +++ clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.cpp @@ -1059,8 +1059,7 @@ if (N) { const LangOptions &LOpts = C.getASTContext().getLangOpts(); auto R = llvm::make_unique( - *getLeakAtReturnBug(LOpts), LOpts, SummaryLog, N, Sym, C, - IncludeAllocationLine); + *getLeakAtReturnBug(LOpts), LOpts, SummaryLog, N, Sym, C); C.emitReport(std::move(R)); } return N; @@ -1346,7 +1345,7 @@ assert(BT && "BugType not initialized."); Ctx.emitReport(llvm::make_unique( - *BT, LOpts, SummaryLog, N, *I, Ctx, IncludeAllocationLine)); + *BT, LOpts, SummaryLog, N, *I, Ctx)); } } @@ -1508,8 +1507,6 @@ AnalyzerOptions &Options = Mgr.getAnalyzerOptions(); - Chk->IncludeAllocationLine = Options.getCheckerBooleanOption( - "leak-diagnostics-reference-allocation", false, Chk); Chk->ShouldCheckOSObjectRetainCount = Options.getCheckerBooleanOption( "CheckOSObject", true, Chk); } Index: clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.h =================================================================== --- clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.h +++ clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.h @@ -71,13 +71,12 @@ // Finds the location where a leak warning for 'sym' should be raised. void deriveAllocLocation(CheckerContext &Ctx, SymbolRef sym); // Produces description of a leak warning which is printed on the console. - void createDescription(CheckerContext &Ctx, bool IncludeAllocationLine); + void createDescription(CheckerContext &Ctx); public: CFRefLeakReport(CFRefBug &D, const LangOptions &LOpts, const SummaryLogTy &Log, ExplodedNode *n, SymbolRef sym, - CheckerContext &Ctx, - bool IncludeAllocationLine); + CheckerContext &Ctx); PathDiagnosticLocation getLocation(const SourceManager &SM) const override { assert(Location.isValid()); Index: clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp =================================================================== --- clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp +++ clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp @@ -634,8 +634,7 @@ UniqueingDecl = AllocNode->getLocationContext()->getDecl(); } -void CFRefLeakReport::createDescription(CheckerContext &Ctx, - bool IncludeAllocationLine) { +void CFRefLeakReport::createDescription(CheckerContext &Ctx) { assert(Location.isValid() && UniqueingDecl && UniqueingLocation.isValid()); Description.clear(); llvm::raw_string_ostream os(Description); @@ -644,10 +643,6 @@ Optional RegionDescription = describeRegion(AllocBinding); if (RegionDescription) { os << " stored into '" << *RegionDescription << '\''; - if (IncludeAllocationLine) { - FullSourceLoc SL(AllocStmt->getBeginLoc(), Ctx.getSourceManager()); - os << " (allocated on line " << SL.getSpellingLineNumber() << ")"; - } } else { // If we can't figure out the name, just supply the type information. @@ -658,15 +653,14 @@ CFRefLeakReport::CFRefLeakReport(CFRefBug &D, const LangOptions &LOpts, const SummaryLogTy &Log, ExplodedNode *n, SymbolRef sym, - CheckerContext &Ctx, - bool IncludeAllocationLine) + CheckerContext &Ctx) : CFRefReport(D, LOpts, Log, n, sym, false) { deriveAllocLocation(Ctx, sym); if (!AllocBinding) deriveParamLocation(Ctx, sym); - createDescription(Ctx, IncludeAllocationLine); + createDescription(Ctx); addVisitor(llvm::make_unique(sym, Log)); }