diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2015-06-23 13:15:32 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2015-06-23 13:15:32 +0000 |
commit | 8d3a7a56a944f6b8452cb8e21ba68a293c7f5202 (patch) | |
tree | e7f2906cae208f6db629b25f46559dddb46ff5a1 /clang/lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp | |
parent | 91d35a5e225c592a885ca993ce5628228ff26a49 (diff) | |
download | bcm5719-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/FixedAddressChecker.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp index 60bb03654f5..48d6bd4b37e 100644 --- a/clang/lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp @@ -57,9 +57,9 @@ void FixedAddressChecker::checkPreStmt(const BinaryOperator *B, "Using a fixed address is not portable because that " "address will probably not be valid in all " "environments or platforms.")); - BugReport *R = new BugReport(*BT, BT->getDescription(), N); + auto R = llvm::make_unique<BugReport>(*BT, BT->getDescription(), N); R->addRange(B->getRHS()->getSourceRange()); - C.emitReport(R); + C.emitReport(std::move(R)); } } |