[llvm] 0780722 - Revert "Support: Use std::unique_ptr for SignpostEmitter::Impl, NFC"

Duncan P. N. Exon Smith via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 8 16:39:02 PDT 2021


Author: Duncan P. N. Exon Smith
Date: 2021-04-08T16:38:47-07:00
New Revision: 078072285d3fbdaa94f9a91140eb5c1223b548af

URL: https://github.com/llvm/llvm-project/commit/078072285d3fbdaa94f9a91140eb5c1223b548af
DIFF: https://github.com/llvm/llvm-project/commit/078072285d3fbdaa94f9a91140eb5c1223b548af.diff

LOG: Revert "Support: Use std::unique_ptr for SignpostEmitter::Impl, NFC"

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Support/Signposts.h b/llvm/include/llvm/Support/Signposts.h
index d31f3c1e6eb5..22b04893394e 100644
--- a/llvm/include/llvm/Support/Signposts.h
+++ b/llvm/include/llvm/Support/Signposts.h
@@ -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();

diff  --git a/llvm/lib/Support/Signposts.cpp b/llvm/lib/Support/Signposts.cpp
index 586f1db50759..b277bb02e03a 100644
--- a/llvm/lib/Support/Signposts.cpp
+++ b/llvm/lib/Support/Signposts.cpp
@@ -100,11 +100,17 @@ class SignpostEmitterImpl {
 
 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


        


More information about the llvm-commits mailing list