From 8d3a7a56a944f6b8452cb8e21ba68a293c7f5202 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Tue, 23 Jun 2015 13:15:32 +0000 Subject: Clarify pointer ownership semantics by hoisting the std::unique_ptr creation to the caller instead of hiding it in emitReport. NFC. llvm-svn: 240400 --- clang/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'clang/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp') diff --git a/clang/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp index cb5b01009f1..557439b2888 100644 --- a/clang/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp @@ -76,11 +76,10 @@ void ArrayBoundChecker::checkLocation(SVal l, bool isLoad, const Stmt* LoadS, // reference is outside the range. // Generate a report for this bug. - BugReport *report = - new BugReport(*BT, BT->getDescription(), N); + auto report = llvm::make_unique(*BT, BT->getDescription(), N); report->addRange(LoadS->getSourceRange()); - C.emitReport(report); + C.emitReport(std::move(report)); return; } -- cgit v1.2.3