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

The class that contains the configuration for the instrumentor. More...

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

Public Member Functions

virtual ~InstrumentationConfig ()
 InstrumentationConfig ()
 Construct an instrumentation configuration with the base options.
virtual void populate (InstrumentorIRBuilderTy &IIRB)
 Populate the instrumentation opportunities.
StringRef getRTName () const
 Get the runtime prefix for the instrumentation runtime functions.
std::string getRTName (StringRef Prefix, StringRef Name, StringRef Suffix1="", StringRef Suffix2="") const
 Get the instrumentation function name.
void addBaseChoice (BaseConfigurationOption *BCO)
 Add the base configuration option BCO into the list of base options.
void addChoice (InstrumentationOpportunity &IO, LLVMContext &Ctx)
 Register instrumentation opportunity IO.

Static Public Member Functions

template<typename Ty, typename... ArgsTy>
static Ty * allocate (ArgsTy &&...Args)
 Allocate an object of type Ty using a bump allocator and construct it with the Args arguments.

Public Attributes

SmallVector< BaseConfigurationOption * > BaseConfigurationOptions
 The list of enabled base configuration options.
BaseConfigurationOptionRuntimePrefix
 The base configuration options.
BaseConfigurationOptionTargetRegex
BaseConfigurationOptionHostEnabled
BaseConfigurationOptionGPUEnabled
EnumeratedArray< StringMap< InstrumentationOpportunity * >, InstrumentationLocation::KindTyIChoices
 The map registered instrumentation opportunities.
BumpPtrAllocator StringAllocator
 Utilities for allocating and building strings.
StringSaver SS

Detailed Description

The class that contains the configuration for the instrumentor.

It holds the information for each instrumented opportunity, including the base configuration options. Another class may inherit from this one to modify the default behavior.

Definition at line 335 of file Instrumentor.h.

Constructor & Destructor Documentation

◆ ~InstrumentationConfig()

virtual llvm::instrumentor::InstrumentationConfig::~InstrumentationConfig ( )
inlinevirtual

Definition at line 336 of file Instrumentor.h.

◆ InstrumentationConfig()

llvm::instrumentor::InstrumentationConfig::InstrumentationConfig ( )
inline

Member Function Documentation

◆ addBaseChoice()

void llvm::instrumentor::InstrumentationConfig::addBaseChoice ( BaseConfigurationOption * BCO)
inline

Add the base configuration option BCO into the list of base options.

Definition at line 366 of file Instrumentor.h.

References BaseConfigurationOptions.

Referenced by llvm::instrumentor::BaseConfigurationOption::createBoolOption(), and llvm::instrumentor::BaseConfigurationOption::createStringOption().

◆ addChoice()

◆ allocate()

template<typename Ty, typename... ArgsTy>
Ty * llvm::instrumentor::InstrumentationConfig::allocate ( ArgsTy &&... Args)
inlinestatic

Allocate an object of type Ty using a bump allocator and construct it with the Args arguments.

The object may not be freed manually.

Definition at line 376 of file Instrumentor.h.

References Allocator.

Referenced by llvm::instrumentor::LoadIO::populate(), and llvm::instrumentor::StoreIO::populate().

◆ getRTName() [1/2]

StringRef llvm::instrumentor::InstrumentationConfig::getRTName ( ) const
inline

Get the runtime prefix for the instrumentation runtime functions.

Definition at line 357 of file Instrumentor.h.

References RuntimePrefix.

Referenced by llvm::instrumentor::IRTCallDescription::createLLVMCall(), and getRTName().

◆ getRTName() [2/2]

std::string llvm::instrumentor::InstrumentationConfig::getRTName ( StringRef Prefix,
StringRef Name,
StringRef Suffix1 = "",
StringRef Suffix2 = "" ) const
inline

Get the instrumentation function name.

Definition at line 360 of file Instrumentor.h.

References getRTName().

◆ populate()

void InstrumentationConfig::populate ( InstrumentorIRBuilderTy & IIRB)
virtual

Populate the instrumentation opportunities.

List of all instrumentation opportunities.

Definition at line 309 of file Instrumentor.cpp.

References llvm::instrumentor::LoadIO::populate(), and llvm::instrumentor::StoreIO::populate().

Member Data Documentation

◆ BaseConfigurationOptions

SmallVector<BaseConfigurationOption *> llvm::instrumentor::InstrumentationConfig::BaseConfigurationOptions

The list of enabled base configuration options.

Definition at line 384 of file Instrumentor.h.

Referenced by addBaseChoice(), llvm::instrumentor::readConfigFromJSON(), and llvm::instrumentor::writeConfigToJSON().

◆ GPUEnabled

BaseConfigurationOption* llvm::instrumentor::InstrumentationConfig::GPUEnabled

Definition at line 390 of file Instrumentor.h.

Referenced by InstrumentationConfig().

◆ HostEnabled

BaseConfigurationOption* llvm::instrumentor::InstrumentationConfig::HostEnabled

Definition at line 389 of file Instrumentor.h.

Referenced by InstrumentationConfig().

◆ IChoices

EnumeratedArray<StringMap<InstrumentationOpportunity *>, InstrumentationLocation::KindTy> llvm::instrumentor::InstrumentationConfig::IChoices

The map registered instrumentation opportunities.

The map is indexed by the instrumentation location kind and then by the opportunity name. Notice that an instrumentation location may have more than one instrumentation opportunity registered.

Definition at line 398 of file Instrumentor.h.

Referenced by addChoice(), llvm::instrumentor::readConfigFromJSON(), and llvm::instrumentor::writeConfigToJSON().

◆ RuntimePrefix

BaseConfigurationOption* llvm::instrumentor::InstrumentationConfig::RuntimePrefix

The base configuration options.

Definition at line 387 of file Instrumentor.h.

Referenced by getRTName(), and InstrumentationConfig().

◆ SS

StringSaver llvm::instrumentor::InstrumentationConfig::SS

◆ StringAllocator

BumpPtrAllocator llvm::instrumentor::InstrumentationConfig::StringAllocator

Utilities for allocating and building strings.

{

Definition at line 402 of file Instrumentor.h.

Referenced by InstrumentationConfig().

◆ TargetRegex

BaseConfigurationOption* llvm::instrumentor::InstrumentationConfig::TargetRegex

Definition at line 388 of file Instrumentor.h.

Referenced by InstrumentationConfig().


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