Revert "Support: Use std::unique_ptr for SignpostEmitter::Impl, NFC"
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Thu, 8 Apr 2021 23:36:42 +0000 (16:36 -0700)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Thu, 8 Apr 2021 23:38:47 +0000 (16:38 -0700)
This reverts commit 022ccedde8877e877b45e49641544b5e4fff0b42. Looks like
some hosts need a definition of SignpostEmitterImpl to put it in a
unique_ptr:
https://lab.llvm.org/buildbot/#/builders/92/builds/7733

llvm/include/llvm/Support/Signposts.h
llvm/lib/Support/Signposts.cpp

index d31f3c1..22b0489 100644 (file)
@@ -18,7 +18,6 @@
 #define LLVM_SUPPORT_SIGNPOSTS_H
 
 #include "llvm/ADT/StringRef.h"
-#include <memory>
 
 namespace llvm {
 class SignpostEmitterImpl;
@@ -26,7 +25,8 @@ class SignpostEmitterImpl;
 /// Manages the emission of signposts into the recording method supported by
 /// the OS.
 class SignpostEmitter {
-  std::unique_ptr<SignpostEmitterImpl> Impl;
+  /// Not using std::unique_ptr since some hosts need a definition.
+  SignpostEmitterImpl *Impl;
 
 public:
   SignpostEmitter();
index 586f1db..b277bb0 100644 (file)
@@ -100,11 +100,17 @@ public:
 
 SignpostEmitter::SignpostEmitter() {
 #if HAVE_ANY_SIGNPOST_IMPL
-  Impl = std::make_unique<SignpostEmitterImpl>();
+  Impl = new SignpostEmitterImpl();
+#else  // if HAVE_ANY_SIGNPOST_IMPL
+  Impl = nullptr;
 #endif // if !HAVE_ANY_SIGNPOST_IMPL
 }
 
-SignpostEmitter::~SignpostEmitter() = default;
+SignpostEmitter::~SignpostEmitter() {
+#if HAVE_ANY_SIGNPOST_IMPL
+  delete Impl;
+#endif // if HAVE_ANY_SIGNPOST_IMPL
+}
 
 bool SignpostEmitter::isEnabled() const {
 #if HAVE_ANY_SIGNPOST_IMPL