[llvm] f7a2d70 - Make llvm::telemetry::Manager::preDispatch protected. (#127114)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 14 19:12:07 PST 2025
Author: Vy Nguyen
Date: 2025-02-14T22:12:04-05:00
New Revision: f7a2d70bd91094e7a85f7e189602c826a3eeb6cd
URL: https://github.com/llvm/llvm-project/commit/f7a2d70bd91094e7a85f7e189602c826a3eeb6cd
DIFF: https://github.com/llvm/llvm-project/commit/f7a2d70bd91094e7a85f7e189602c826a3eeb6cd.diff
LOG: Make llvm::telemetry::Manager::preDispatch protected. (#127114)
The method was meant to be overriden by subclasses only.
It should not be called directly by users
Added:
Modified:
llvm/include/llvm/Telemetry/Telemetry.h
llvm/lib/Telemetry/Telemetry.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/Telemetry/Telemetry.h b/llvm/include/llvm/Telemetry/Telemetry.h
index 344a49df5cbf0..8efea645ab51c 100644
--- a/llvm/include/llvm/Telemetry/Telemetry.h
+++ b/llvm/include/llvm/Telemetry/Telemetry.h
@@ -138,10 +138,6 @@ class Manager {
public:
virtual ~Manager() = default;
- // Optional callback for subclasses to perform additional tasks before
- // dispatching to Destinations.
- virtual Error preDispatch(TelemetryInfo *Entry) = 0;
-
// Dispatch Telemetry data to the Destination(s).
// The argument is non-const because the Manager may add or remove
// data from the entry.
@@ -150,6 +146,11 @@ class Manager {
// Register a Destination.
void addDestination(std::unique_ptr<Destination> Destination);
+protected:
+ // Optional callback for subclasses to perform additional tasks before
+ // dispatching to Destinations.
+ virtual Error preDispatch(TelemetryInfo *Entry) {}
+
private:
std::vector<std::unique_ptr<Destination>> Destinations;
};
diff --git a/llvm/lib/Telemetry/Telemetry.cpp b/llvm/lib/Telemetry/Telemetry.cpp
index 9e13d08334e3b..badb07bff5477 100644
--- a/llvm/lib/Telemetry/Telemetry.cpp
+++ b/llvm/lib/Telemetry/Telemetry.cpp
@@ -1,3 +1,16 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// This file provides the basic framework for Telemetry.
+/// Refer to its documentation at llvm/docs/Telemetry.rst for more details.
+//===---------------------------------------------------------------------===//
+
#include "llvm/Telemetry/Telemetry.h"
namespace llvm {
More information about the llvm-commits
mailing list