summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers/UndefCapturedBlockVarChecker.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2015-06-23 13:15:32 +0000
committerAaron Ballman <aaron@aaronballman.com>2015-06-23 13:15:32 +0000
commit8d3a7a56a944f6b8452cb8e21ba68a293c7f5202 (patch)
treee7f2906cae208f6db629b25f46559dddb46ff5a1 /clang/lib/StaticAnalyzer/Checkers/UndefCapturedBlockVarChecker.cpp
parent91d35a5e225c592a885ca993ce5628228ff26a49 (diff)
downloadbcm5719-llvm-8d3a7a56a944f6b8452cb8e21ba68a293c7f5202.tar.gz
bcm5719-llvm-8d3a7a56a944f6b8452cb8e21ba68a293c7f5202.zip
Clarify pointer ownership semantics by hoisting the std::unique_ptr creation to the caller instead of hiding it in emitReport. NFC.
llvm-svn: 240400
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/UndefCapturedBlockVarChecker.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/UndefCapturedBlockVarChecker.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/UndefCapturedBlockVarChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/UndefCapturedBlockVarChecker.cpp
index 8976e0a699e..c42a2b2984f 100644
--- a/clang/lib/StaticAnalyzer/Checkers/UndefCapturedBlockVarChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/UndefCapturedBlockVarChecker.cpp
@@ -89,14 +89,14 @@ UndefCapturedBlockVarChecker::checkPostStmt(const BlockExpr *BE,
os << "Variable '" << VD->getName()
<< "' is uninitialized when captured by block";
- BugReport *R = new BugReport(*BT, os.str(), N);
+ auto R = llvm::make_unique<BugReport>(*BT, os.str(), N);
if (const Expr *Ex = FindBlockDeclRefExpr(BE->getBody(), VD))
R->addRange(Ex->getSourceRange());
R->addVisitor(llvm::make_unique<FindLastStoreBRVisitor>(
*V, VR, /*EnableNullFPSuppression*/ false));
R->disablePathPruning();
// need location of block
- C.emitReport(R);
+ C.emitReport(std::move(R));
}
}
}
OpenPOWER on IntegriCloud