LLVM 24.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.
void init (InstrumentorIRBuilderTy &IIRB)
 Initialize the config to a clean base state without loosing cached values that can be reused across configurations.
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.
Value * getBasePointerInfo (Value &V, InstrumentorIRBuilderTy &IIRB)
 Return the base pointer info for V.
Constant * getGlobalString (StringRef S, InstrumentorIRBuilderTy &IIRB)

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

DenseMap< Value *, Value * > UnderlyingObjsMap
 Map to remember underlying objects for pointers.
DenseMap< std::pair< Value *, Function * >, Value * > BasePointerInfoMap
 Map to remember base pointer info for values in a specific function.
DenseMap< StringRef, Constant * > GlobalStringsMap
 Mapping to remember global strings passed to the runtime.
DenseMap< Constant *, GlobalVariable * > ConstantGlobalsCache
 Mapping from constants to globals with the constant as initializer.
SmallVector< BaseConfigurationOption * > BaseConfigurationOptions
 The list of enabled base configuration options.
std::unique_ptr< BaseConfigurationOption > RuntimePrefix
 The base configuration options.
std::unique_ptr< BaseConfigurationOption > RuntimeStubsFile
std::unique_ptr< BaseConfigurationOption > DemangleFunctionNames
std::unique_ptr< BaseConfigurationOption > TargetRegex
std::unique_ptr< BaseConfigurationOption > FunctionRegex
std::unique_ptr< BaseConfigurationOption > HostEnabled
std::unique_ptr< BaseConfigurationOption > GPUEnabled
std::unique_ptr< BaseConfigurationOption > RuntimeBitcodes
std::unique_ptr< BaseConfigurationOption > InlineRuntimeEagerly
EnumeratedArray< MapVector< StringRef, InstrumentationOpportunity * >, InstrumentationLocation::KindTy > IChoices
 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 361 of file Instrumentor.h.

Constructor & Destructor Documentation

◆ ~InstrumentationConfig()

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

Definition at line 362 of file Instrumentor.h.

◆ InstrumentationConfig()

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

Construct an instrumentation configuration with the base options.

Definition at line 365 of file Instrumentor.h.

References SS, and StringAllocator.

Member Function Documentation

◆ addBaseChoice()

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

◆ addChoice()

◆ allocate()

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

◆ getBasePointerInfo()

◆ getGlobalString()

◆ getRTName() [1/2]

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

◆ 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 411 of file Instrumentor.h.

References getRTName().

◆ init()

◆ populate()

Member Data Documentation

◆ BaseConfigurationOptions

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

The list of enabled base configuration options.

Definition at line 462 of file Instrumentor.h.

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

◆ BasePointerInfoMap

DenseMap<std::pair<Value *, Function *>, Value *> llvm::instrumentor::InstrumentationConfig::BasePointerInfoMap

Map to remember base pointer info for values in a specific function.

Definition at line 438 of file Instrumentor.h.

Referenced by getBasePointerInfo().

◆ ConstantGlobalsCache

DenseMap<Constant *, GlobalVariable *> llvm::instrumentor::InstrumentationConfig::ConstantGlobalsCache

Mapping from constants to globals with the constant as initializer.

Definition at line 447 of file Instrumentor.h.

Referenced by createValuePack().

◆ DemangleFunctionNames

std::unique_ptr<BaseConfigurationOption> llvm::instrumentor::InstrumentationConfig::DemangleFunctionNames

Definition at line 467 of file Instrumentor.h.

Referenced by llvm::instrumentor::FunctionIO::getFunctionName(), and init().

◆ FunctionRegex

std::unique_ptr<BaseConfigurationOption> llvm::instrumentor::InstrumentationConfig::FunctionRegex

Definition at line 469 of file Instrumentor.h.

Referenced by init().

◆ GlobalStringsMap

DenseMap<StringRef, Constant *> llvm::instrumentor::InstrumentationConfig::GlobalStringsMap

Mapping to remember global strings passed to the runtime.

Definition at line 444 of file Instrumentor.h.

Referenced by getGlobalString().

◆ GPUEnabled

std::unique_ptr<BaseConfigurationOption> llvm::instrumentor::InstrumentationConfig::GPUEnabled

Definition at line 471 of file Instrumentor.h.

Referenced by init().

◆ HostEnabled

std::unique_ptr<BaseConfigurationOption> llvm::instrumentor::InstrumentationConfig::HostEnabled

Definition at line 470 of file Instrumentor.h.

Referenced by init().

◆ IChoices

EnumeratedArray<MapVector<StringRef, 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 481 of file Instrumentor.h.

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

◆ InlineRuntimeEagerly

std::unique_ptr<BaseConfigurationOption> llvm::instrumentor::InstrumentationConfig::InlineRuntimeEagerly

Definition at line 473 of file Instrumentor.h.

Referenced by init().

◆ RuntimeBitcodes

std::unique_ptr<BaseConfigurationOption> llvm::instrumentor::InstrumentationConfig::RuntimeBitcodes

Definition at line 472 of file Instrumentor.h.

Referenced by init().

◆ RuntimePrefix

std::unique_ptr<BaseConfigurationOption> llvm::instrumentor::InstrumentationConfig::RuntimePrefix

The base configuration options.

Definition at line 465 of file Instrumentor.h.

Referenced by getRTName(), and init().

◆ RuntimeStubsFile

std::unique_ptr<BaseConfigurationOption> llvm::instrumentor::InstrumentationConfig::RuntimeStubsFile

Definition at line 466 of file Instrumentor.h.

Referenced by init().

◆ SS

StringSaver llvm::instrumentor::InstrumentationConfig::SS

◆ StringAllocator

BumpPtrAllocator llvm::instrumentor::InstrumentationConfig::StringAllocator

Utilities for allocating and building strings.

{

Definition at line 485 of file Instrumentor.h.

Referenced by InstrumentationConfig().

◆ TargetRegex

std::unique_ptr<BaseConfigurationOption> llvm::instrumentor::InstrumentationConfig::TargetRegex

Definition at line 468 of file Instrumentor.h.

Referenced by init().

◆ UnderlyingObjsMap

DenseMap<Value *, Value *> llvm::instrumentor::InstrumentationConfig::UnderlyingObjsMap

Map to remember underlying objects for pointers.

Definition at line 435 of file Instrumentor.h.

Referenced by getBasePointerInfo().


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