diff --git a/llvm/lib/Support/Signposts.cpp b/llvm/lib/Support/Signposts.cpp --- a/llvm/lib/Support/Signposts.cpp +++ b/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>; + using LogPtrTy = std::unique_ptr; 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())