MLIR  20.0.0git
Public Member Functions | Static Public Member Functions | List of all members
mlir::TimingIdentifier Class Reference

This class represesents a uniqued string owned by a TimingManager. More...

#include "mlir/Support/Timing.h"

Public Member Functions

 TimingIdentifier (const TimingIdentifier &)=default
 
TimingIdentifieroperator= (const TimingIdentifier &other)=default
 
StringRef strref () const
 Return a StringRef for the string. More...
 
std::string str () const
 Return an std::string. More...
 
const void * getAsOpaquePointer () const
 Return the opaque pointer that corresponds to this identifier. More...
 

Static Public Member Functions

static TimingIdentifier get (StringRef str, TimingManager &tm)
 Return an identifier for the specified string. More...
 

Detailed Description

This class represesents a uniqued string owned by a TimingManager.

Most importantly, instances of this class provide a stable opaque pointer that is guaranteed to be reproduced by later interning of the same string. The TimingManager uses this mechanism to provide timers with an opaque id even when the user of the API merely provided a string as identification (instead of a pass for example).

This is a POD type with pointer size, so it should be passed around by value. The underlying data is owned by the TimingManager.

Definition at line 46 of file Timing.h.

Constructor & Destructor Documentation

◆ TimingIdentifier()

mlir::TimingIdentifier::TimingIdentifier ( const TimingIdentifier )
default

Referenced by get().

Member Function Documentation

◆ get()

TimingIdentifier TimingIdentifier::get ( StringRef  str,
TimingManager tm 
)
static

Return an identifier for the specified string.

Definition at line 83 of file Timing.cpp.

References mlir::TimingManager::impl, str(), and TimingIdentifier().

Referenced by mlir::Timer::nest().

◆ getAsOpaquePointer()

const void* mlir::TimingIdentifier::getAsOpaquePointer ( ) const
inline

Return the opaque pointer that corresponds to this identifier.

Definition at line 63 of file Timing.h.

Referenced by mlir::Timer::nest().

◆ operator=()

TimingIdentifier& mlir::TimingIdentifier::operator= ( const TimingIdentifier other)
default

◆ str()

std::string mlir::TimingIdentifier::str ( ) const
inline

Return an std::string.

Definition at line 60 of file Timing.h.

References strref().

Referenced by get().

◆ strref()

StringRef mlir::TimingIdentifier::strref ( ) const
inline

Return a StringRef for the string.

Definition at line 57 of file Timing.h.

Referenced by str().


The documentation for this class was generated from the following files: