[llvm] 51c9109 - Reapply "Make llvm::telemetry::Manager::preDispatch protected. (#127114) (#127431)

via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 17 17:59:15 PST 2025


Author: Vy Nguyen
Date: 2025-02-17T20:59:12-05:00
New Revision: 51c91095ab5b1f8f0d65e6fbd551e8b991866b3f

URL: https://github.com/llvm/llvm-project/commit/51c91095ab5b1f8f0d65e6fbd551e8b991866b3f
DIFF: https://github.com/llvm/llvm-project/commit/51c91095ab5b1f8f0d65e6fbd551e8b991866b3f.diff

LOG: Reapply "Make llvm::telemetry::Manager::preDispatch protected.  (#127114) (#127431)

This reverts commit 66465c3b0ab1b32403ad5a1c3114174d87830f54.

New change: added missing return statement.

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..42319f3ef51f2 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..d86ad9c1c37bb 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 {
@@ -22,5 +35,7 @@ void Manager::addDestination(std::unique_ptr<Destination> Dest) {
   Destinations.push_back(std::move(Dest));
 }
 
+Error Manager::preDispatch(TelemetryInfo *Entry) { return Error::success(); }
+
 } // namespace telemetry
 } // namespace llvm


        


More information about the llvm-commits mailing list