[PATCH] D100154: Support: Avoid unnecessary std::function for SignpostEmitterImpl::SignpostLog
Duncan P. N. Exon Smith via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 8 16:35:10 PDT 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG9be43874343b: Support: Avoid unnecessary std::function for SignpostEmitterImpl::SignpostLog (authored by dexonsmith).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D100154/new/
https://reviews.llvm.org/D100154
Files:
llvm/lib/Support/Signposts.cpp
Index: llvm/lib/Support/Signposts.cpp
===================================================================
--- llvm/lib/Support/Signposts.cpp
+++ llvm/lib/Support/Signposts.cpp
@@ -29,15 +29,17 @@
*X = os_log_create("org.llvm.signposts", OS_LOG_CATEGORY_POINTS_OF_INTEREST);
return X;
}
-void LogDeleter(os_log_t *X) {
- os_release(*X);
- delete X;
-}
+struct LogDeleter {
+ void operator()(os_log_t *X) const {
+ os_release(*X);
+ delete X;
+ }
+};
} // end anonymous namespace
namespace llvm {
class SignpostEmitterImpl {
- using LogPtrTy = std::unique_ptr<os_log_t, std::function<void(os_log_t *)>>;
+ using LogPtrTy = std::unique_ptr<os_log_t, LogDeleter>;
using LogTy = LogPtrTy::element_type;
LogPtrTy SignpostLog;
@@ -59,7 +61,7 @@
}
public:
- SignpostEmitterImpl() : SignpostLog(LogCreator(), LogDeleter) {}
+ SignpostEmitterImpl() : SignpostLog(LogCreator()) {}
bool isEnabled() const {
if (SIGNPOSTS_AVAILABLE())
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100154.336267.patch
Type: text/x-patch
Size: 972 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210408/e99d9c7c/attachment.bin>
More information about the llvm-commits
mailing list