diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2021-04-08 16:04:55 -0700 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2021-04-08 16:31:59 -0700 |
commit | 022ccedde8877e877b45e49641544b5e4fff0b42 (patch) | |
tree | 17f70b14fe6c895f6ec5f6ba375f4aef3e2862a5 /llvm/lib/Support/Signposts.cpp | |
parent | 429088b9e214b2f39f6063a6b3639560fc7db47b (diff) | |
download | llvm-022ccedde8877e877b45e49641544b5e4fff0b42.zip llvm-022ccedde8877e877b45e49641544b5e4fff0b42.tar.gz llvm-022ccedde8877e877b45e49641544b5e4fff0b42.tar.bz2 |
Support: Use std::unique_ptr for SignpostEmitter::Impl, NFC
Replace some manual memory management with std::unique_ptr.
Differential Revision: https://reviews.llvm.org/D100151
Diffstat (limited to 'llvm/lib/Support/Signposts.cpp')
-rw-r--r-- | llvm/lib/Support/Signposts.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/llvm/lib/Support/Signposts.cpp b/llvm/lib/Support/Signposts.cpp index eefd61f4..c85bab4 100644 --- a/llvm/lib/Support/Signposts.cpp +++ b/llvm/lib/Support/Signposts.cpp @@ -98,17 +98,11 @@ public: SignpostEmitter::SignpostEmitter() { #if HAVE_ANY_SIGNPOST_IMPL - Impl = new SignpostEmitterImpl(); -#else // if HAVE_ANY_SIGNPOST_IMPL - Impl = nullptr; + Impl = std::make_unique<SignpostEmitterImpl>(); #endif // if !HAVE_ANY_SIGNPOST_IMPL } -SignpostEmitter::~SignpostEmitter() { -#if HAVE_ANY_SIGNPOST_IMPL - delete Impl; -#endif // if HAVE_ANY_SIGNPOST_IMPL -} +SignpostEmitter::~SignpostEmitter() = default; bool SignpostEmitter::isEnabled() const { #if HAVE_ANY_SIGNPOST_IMPL |