LLVM 23.0.0git
llvm::instrumentor::InstrumentationLocation Struct Reference

Helper to represent an instrumentation location, which is composed of an instrumentation opportunity type and a position. More...

#include "llvm/Transforms/IPO/Instrumentor.h"

Public Types

enum  KindTy {
  MODULE_PRE , MODULE_POST , GLOBAL_PRE , GLOBAL_POST ,
  FUNCTION_PRE , FUNCTION_POST , BASIC_BLOCK_PRE , BASIC_BLOCK_POST ,
  INSTRUCTION_PRE , INSTRUCTION_POST , SPECIAL_VALUE , Last = SPECIAL_VALUE
}
 The supported location kinds, which are composed of a opportunity type and position. More...

Public Member Functions

 InstrumentationLocation (KindTy Kind)
 Construct an instrumentation location with the given kind.
KindTy getKind () const
 Return the type and position.
bool isPRE () const
 Return whether the instrumentation location is before the event occurs.

Static Public Member Functions

static StringRef getKindStr (KindTy Kind)
 Return the string representation given a location kind.
static KindTy getKindFromStr (StringRef S)
 Return the location kind described by a string.
static bool isPRE (KindTy Kind)
 Return whether a location kind is positioned before the event occurs.

Detailed Description

Helper to represent an instrumentation location, which is composed of an instrumentation opportunity type and a position.

Definition at line 165 of file Instrumentor.h.

Member Enumeration Documentation

◆ KindTy

The supported location kinds, which are composed of a opportunity type and position.

The PRE position indicates the instrumentation function call is inserted before the instrumented event occurs. The POST position indicates the instrumentation call is inserted after the event occurs. Some opportunity types may only support one position.

Enumerator
MODULE_PRE 
MODULE_POST 
GLOBAL_PRE 
GLOBAL_POST 
FUNCTION_PRE 
FUNCTION_POST 
BASIC_BLOCK_PRE 
BASIC_BLOCK_POST 
INSTRUCTION_PRE 
INSTRUCTION_POST 
SPECIAL_VALUE 
Last 

Definition at line 171 of file Instrumentor.h.

Constructor & Destructor Documentation

◆ InstrumentationLocation()

llvm::instrumentor::InstrumentationLocation::InstrumentationLocation ( KindTy Kind)
inline

Construct an instrumentation location with the given kind.

Definition at line 187 of file Instrumentor.h.

Member Function Documentation

◆ getKind()

KindTy llvm::instrumentor::InstrumentationLocation::getKind ( ) const
inline

Return the type and position.

Definition at line 190 of file Instrumentor.h.

◆ getKindFromStr()

KindTy llvm::instrumentor::InstrumentationLocation::getKindFromStr ( StringRef S)
inlinestatic

◆ getKindStr()

StringRef llvm::instrumentor::InstrumentationLocation::getKindStr ( KindTy Kind)
inlinestatic

Return the string representation given a location kind.

This is the string used in the configuration file.

Definition at line 194 of file Instrumentor.h.

References BASIC_BLOCK_POST, BASIC_BLOCK_PRE, FUNCTION_POST, FUNCTION_PRE, GLOBAL_POST, GLOBAL_PRE, INSTRUCTION_POST, INSTRUCTION_PRE, llvm_unreachable, MODULE_POST, MODULE_PRE, and SPECIAL_VALUE.

Referenced by llvm::instrumentor::writeConfigToJSON().

◆ isPRE() [1/2]

bool llvm::instrumentor::InstrumentationLocation::isPRE ( ) const
inline

Return whether the instrumentation location is before the event occurs.

Definition at line 260 of file Instrumentor.h.

References isPRE().

Referenced by llvm::instrumentor::GlobalVarIO::init(), and isPRE().

◆ isPRE() [2/2]

bool llvm::instrumentor::InstrumentationLocation::isPRE ( KindTy Kind)
inlinestatic

Return whether a location kind is positioned before the event occurs.

Definition at line 240 of file Instrumentor.h.

References BASIC_BLOCK_POST, BASIC_BLOCK_PRE, FUNCTION_POST, FUNCTION_PRE, GLOBAL_POST, GLOBAL_PRE, INSTRUCTION_POST, INSTRUCTION_PRE, llvm_unreachable, MODULE_POST, MODULE_PRE, and SPECIAL_VALUE.


The documentation for this struct was generated from the following file: