Andrew Walbran | 3d2c197 | 2020-04-07 12:24:26 +0100 | [diff] [blame^] | 1 | //===-- llvm/Support/Signposts.h - Interval debug annotations ---*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | /// \file Some OS's provide profilers that allow applications to provide custom |
| 11 | /// annotations to the profiler. For example, on Xcode 10 and later 'signposts' |
| 12 | /// can be emitted by the application and these will be rendered to the Points |
| 13 | /// of Interest track on the instruments timeline. |
| 14 | // |
| 15 | //===----------------------------------------------------------------------===// |
| 16 | |
| 17 | #ifndef LLVM_SUPPORT_SIGNPOSTS_H |
| 18 | #define LLVM_SUPPORT_SIGNPOSTS_H |
| 19 | |
| 20 | namespace llvm { |
| 21 | class SignpostEmitterImpl; |
| 22 | class Timer; |
| 23 | |
| 24 | /// Manages the emission of signposts into the recording method supported by |
| 25 | /// the OS. |
| 26 | class SignpostEmitter { |
| 27 | SignpostEmitterImpl *Impl; |
| 28 | |
| 29 | public: |
| 30 | SignpostEmitter(); |
| 31 | ~SignpostEmitter(); |
| 32 | |
| 33 | bool isEnabled() const; |
| 34 | |
| 35 | /// Begin a signposted interval for the given timer. |
| 36 | void startTimerInterval(Timer *T); |
| 37 | /// End a signposted interval for the given timer. |
| 38 | void endTimerInterval(Timer *T); |
| 39 | }; |
| 40 | |
| 41 | } // end namespace llvm |
| 42 | |
| 43 | #endif // ifndef LLVM_SUPPORT_SIGNPOSTS_H |