1284194Sdelphij//===-- llvm/Support/Signposts.h - Interval debug annotations ---*- C++ -*-===// 2284194Sdelphij// 3284194Sdelphij// The LLVM Compiler Infrastructure 4284194Sdelphij// 5284194Sdelphij// This file is distributed under the University of Illinois Open Source 6284194Sdelphij// License. See LICENSE.TXT for details. 7284194Sdelphij// 8284194Sdelphij//===----------------------------------------------------------------------===// 9284194Sdelphij// 10284194Sdelphij/// \file Some OS's provide profilers that allow applications to provide custom 11284194Sdelphij/// annotations to the profiler. For example, on Xcode 10 and later 'signposts' 12284194Sdelphij/// can be emitted by the application and these will be rendered to the Points 13284194Sdelphij/// of Interest track on the instruments timeline. 14284194Sdelphij// 15284194Sdelphij//===----------------------------------------------------------------------===// 16284194Sdelphij 17284194Sdelphij#ifndef LLVM_SUPPORT_SIGNPOSTS_H 18284194Sdelphij#define LLVM_SUPPORT_SIGNPOSTS_H 19284194Sdelphij 20284194Sdelphijnamespace llvm { 21284194Sdelphijclass SignpostEmitterImpl; 22284194Sdelphijclass Timer; 23284194Sdelphij 24284194Sdelphij/// Manages the emission of signposts into the recording method supported by 25284194Sdelphij/// the OS. 26284194Sdelphijclass SignpostEmitter { 27284194Sdelphij SignpostEmitterImpl *Impl; 28284194Sdelphij 29284194Sdelphijpublic: 30284194Sdelphij SignpostEmitter(); 31284194Sdelphij ~SignpostEmitter(); 32284194Sdelphij 33284194Sdelphij bool isEnabled() const; 34284194Sdelphij 35284194Sdelphij /// Begin a signposted interval for the given timer. 36284194Sdelphij void startTimerInterval(Timer *T); 37284194Sdelphij /// End a signposted interval for the given timer. 38284194Sdelphij void endTimerInterval(Timer *T); 39284194Sdelphij}; 40284194Sdelphij 41} // end namespace llvm 42 43#endif // ifndef LLVM_SUPPORT_SIGNPOSTS_H 44