aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/Signposts.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Support/Signposts.cpp')
-rw-r--r--llvm/lib/Support/Signposts.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/llvm/lib/Support/Signposts.cpp b/llvm/lib/Support/Signposts.cpp
index b277bb0..9d1fded 100644
--- a/llvm/lib/Support/Signposts.cpp
+++ b/llvm/lib/Support/Signposts.cpp
@@ -96,21 +96,18 @@ public:
#define HAVE_ANY_SIGNPOST_IMPL 1
#else
#define HAVE_ANY_SIGNPOST_IMPL 0
+
+/// Definition necessary for use of std::unique_ptr.
+class SignpostEmitterImpl {};
#endif
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