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
This commit is contained in:
Vy Nguyen 2025-02-14 22:12:04 -05:00 committed by GitHub
parent 4aeb2f1c79
commit f7a2d70bd9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 4 deletions

View File

@ -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 @@ public:
// 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;
};

View File

@ -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 {