LLVM  14.0.0git
Signposts.h
Go to the documentation of this file.
1 //===-- llvm/Support/Signposts.h - Interval debug annotations ---*- C++ -*-===//
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 Some OS's provide profilers that allow applications to provide custom
10 /// annotations to the profiler. For example, on Xcode 10 and later 'signposts'
11 /// can be emitted by the application and these will be rendered to the Points
12 /// of Interest track on the instruments timeline.
13 //
14 //===----------------------------------------------------------------------===//
15 
16 #ifndef LLVM_SUPPORT_SIGNPOSTS_H
17 #define LLVM_SUPPORT_SIGNPOSTS_H
18 
19 #include "llvm/ADT/StringRef.h"
20 #include <memory>
21 
22 namespace llvm {
23 class SignpostEmitterImpl;
24 
25 /// Manages the emission of signposts into the recording method supported by
26 /// the OS.
28  std::unique_ptr<SignpostEmitterImpl> Impl;
29 
30 public:
33 
34  bool isEnabled() const;
35 
36  /// Begin a signposted interval for a given object.
37  void startInterval(const void *O, StringRef Name);
38  /// End a signposted interval for a given object.
39  void endInterval(const void *O, StringRef Name);
40 };
41 
42 } // end namespace llvm
43 
44 #endif // LLVM_SUPPORT_SIGNPOSTS_H
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
llvm::SignpostEmitter
Manages the emission of signposts into the recording method supported by the OS.
Definition: Signposts.h:27
StringRef.h
llvm::SignpostEmitter::~SignpostEmitter
~SignpostEmitter()
llvm::SignpostEmitter::startInterval
void startInterval(const void *O, StringRef Name)
Begin a signposted interval for a given object.
Definition: Signposts.cpp:119
llvm::SignpostEmitter::isEnabled
bool isEnabled() const
Definition: Signposts.cpp:111
llvm::RISCVFenceField::O
@ O
Definition: RISCVBaseInfo.h:197
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::SignpostEmitter::endInterval
void endInterval(const void *O, StringRef Name)
End a signposted interval for a given object.
Definition: Signposts.cpp:127
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:52
llvm::SignpostEmitter::SignpostEmitter
SignpostEmitter()
Definition: Signposts.cpp:103