Skip to content

Commit f7a2d70

Browse files
authored
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
1 parent 4aeb2f1 commit f7a2d70

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

llvm/include/llvm/Telemetry/Telemetry.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,6 @@ class Manager {
138138
public:
139139
virtual ~Manager() = default;
140140

141-
// Optional callback for subclasses to perform additional tasks before
142-
// dispatching to Destinations.
143-
virtual Error preDispatch(TelemetryInfo *Entry) = 0;
144-
145141
// Dispatch Telemetry data to the Destination(s).
146142
// The argument is non-const because the Manager may add or remove
147143
// data from the entry.
@@ -150,6 +146,11 @@ class Manager {
150146
// Register a Destination.
151147
void addDestination(std::unique_ptr<Destination> Destination);
152148

149+
protected:
150+
// Optional callback for subclasses to perform additional tasks before
151+
// dispatching to Destinations.
152+
virtual Error preDispatch(TelemetryInfo *Entry) {}
153+
153154
private:
154155
std::vector<std::unique_ptr<Destination>> Destinations;
155156
};

llvm/lib/Telemetry/Telemetry.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
///
9+
/// \file
10+
/// This file provides the basic framework for Telemetry.
11+
/// Refer to its documentation at llvm/docs/Telemetry.rst for more details.
12+
//===---------------------------------------------------------------------===//
13+
114
#include "llvm/Telemetry/Telemetry.h"
215

316
namespace llvm {

0 commit comments

Comments
 (0)