Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:44:34

0001 //===-- llvm/Support/Signposts.h - Interval debug annotations ---*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 /// \file Some OS's provide profilers that allow applications to provide custom
0010 /// annotations to the profiler. For example, on Xcode 10 and later 'signposts'
0011 /// can be emitted by the application and these will be rendered to the Points
0012 /// of Interest track on the instruments timeline.
0013 //
0014 //===----------------------------------------------------------------------===//
0015 
0016 #ifndef LLVM_SUPPORT_SIGNPOSTS_H
0017 #define LLVM_SUPPORT_SIGNPOSTS_H
0018 
0019 #include <memory>
0020 
0021 namespace llvm {
0022 class SignpostEmitterImpl;
0023 class StringRef;
0024 
0025 /// Manages the emission of signposts into the recording method supported by
0026 /// the OS.
0027 class SignpostEmitter {
0028   std::unique_ptr<SignpostEmitterImpl> Impl;
0029 
0030 public:
0031   SignpostEmitter();
0032   ~SignpostEmitter();
0033 
0034   bool isEnabled() const;
0035 
0036   /// Begin a signposted interval for a given object.
0037   void startInterval(const void *O, StringRef Name);
0038   /// End a signposted interval for a given object.
0039   void endInterval(const void *O, StringRef Name);
0040 };
0041 
0042 } // end namespace llvm
0043 
0044 #endif // LLVM_SUPPORT_SIGNPOSTS_H