|
LLVM 23.0.0git
|
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 |
| EnumeratedArray< MapVector< StringRef, InstrumentationOpportunity * >, InstrumentationLocation::KindTy > | IChoices |
| The map registered instrumentation opportunities. | |
| BumpPtrAllocator | StringAllocator |
| Utilities for allocating and building strings. | |
| StringSaver | SS |
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 334 of file Instrumentor.h.
|
inlinevirtual |
Definition at line 335 of file Instrumentor.h.
|
inline |
Construct an instrumentation configuration with the base options.
Definition at line 338 of file Instrumentor.h.
References SS, and StringAllocator.
|
inline |
Add the base configuration option BCO into the list of base options.
Definition at line 386 of file Instrumentor.h.
References BaseConfigurationOptions.
Referenced by llvm::instrumentor::BaseConfigurationOption::createBoolOption(), and llvm::instrumentor::BaseConfigurationOption::createStringOption().
| void InstrumentationConfig::addChoice | ( | InstrumentationOpportunity & | IO, |
| LLVMContext & | Ctx ) |
Register instrumentation opportunity IO.
Definition at line 561 of file Instrumentor.cpp.
References llvm::DS_Warning, llvm::instrumentor::InstrumentationOpportunity::getLocationKind(), llvm::instrumentor::InstrumentationOpportunity::getName(), and IChoices.
Referenced by llvm::instrumentor::AllocaIO::init(), llvm::instrumentor::BasePointerIO::init(), llvm::instrumentor::CastIO::init(), llvm::instrumentor::FunctionIO::init(), llvm::instrumentor::GlobalVarIO::init(), llvm::instrumentor::LoadIO::init(), llvm::instrumentor::ModuleIO::init(), llvm::instrumentor::NumericIO::init(), llvm::instrumentor::StoreIO::init(), and llvm::instrumentor::UnreachableIO::init().
|
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 396 of file Instrumentor.h.
References Allocator.
Referenced by llvm::instrumentor::AllocaIO::populate(), llvm::instrumentor::BasePointerIO::populate(), llvm::instrumentor::CastIO::populate(), llvm::instrumentor::FunctionIO::populate(), llvm::instrumentor::GlobalVarIO::populate(), llvm::instrumentor::LoadIO::populate(), llvm::instrumentor::ModuleIO::populate(), llvm::instrumentor::NumericIO::populate(), llvm::instrumentor::StoreIO::populate(), and llvm::instrumentor::UnreachableIO::populate().
| Value * InstrumentationConfig::getBasePointerInfo | ( | Value & | V, |
| InstrumentorIRBuilderTy & | IIRB ) |
Return the base pointer info for V.
Definition at line 575 of file Instrumentor.cpp.
References BasePointerInfoMap, Changed, llvm::instrumentor::InstrumentorIRBuilderTy::Ctx, llvm::LLVMContext::diagnose(), llvm::DS_Warning, llvm::dyn_cast(), llvm::Constant::getNullValue(), llvm::getUnderlyingObjectAggressive(), IChoices, llvm::instrumentor::InstrumentorIRBuilderTy::IRB, llvm::isa(), LLVM_DEBUG, llvm_unreachable, llvm::instrumentor::InstrumentorIRBuilderTy::returnAllocas(), llvm::instrumentor::InstrumentationLocation::SPECIAL_VALUE, and UnderlyingObjsMap.
Referenced by llvm::instrumentor::LoadIO::getBasePointerInfo(), and llvm::instrumentor::StoreIO::getBasePointerInfo().
|
inline |
Definition at line 418 of file Instrumentor.h.
References llvm::ConstantExpr::getAddrSpaceCast(), getRTName(), GlobalStringsMap, llvm::instrumentor::InstrumentorIRBuilderTy::IRB, and SS.
Referenced by llvm::instrumentor::FunctionIO::getFunctionName(), llvm::instrumentor::ModuleIO::getModuleName(), llvm::instrumentor::GlobalVarIO::getSymbolName(), and llvm::instrumentor::ModuleIO::getTargetTriple().
|
inline |
Get the runtime prefix for the instrumentation runtime functions.
Definition at line 377 of file Instrumentor.h.
References RuntimePrefix.
Referenced by llvm::instrumentor::IRTCallDescription::createCSignature(), llvm::instrumentor::IRTCallDescription::createLLVMCall(), createValuePack(), getGlobalString(), getRTName(), llvm::instrumentor::printRuntimeHeader(), llvm::instrumentor::printRuntimeStub(), and llvm::instrumentor::GlobalVarIO::setAddress().
|
inline |
Get the instrumentation function name.
Definition at line 380 of file Instrumentor.h.
References getRTName().
|
inline |
Initialize the config to a clean base state without loosing cached values that can be reused across configurations.
Definition at line 342 of file Instrumentor.h.
References BaseConfigurationOptions, llvm::instrumentor::BaseConfigurationOption::createBoolOption(), llvm::instrumentor::BaseConfigurationOption::createStringOption(), DemangleFunctionNames, FunctionRegex, GPUEnabled, HostEnabled, IChoices, populate(), RuntimePrefix, RuntimeStubsFile, and TargetRegex.
|
virtual |
Populate the instrumentation opportunities.
List of all instrumentation opportunities.
Definition at line 547 of file Instrumentor.cpp.
References llvm::instrumentor::AllocaIO::populate(), llvm::instrumentor::BasePointerIO::populate(), llvm::instrumentor::CastIO::populate(), llvm::instrumentor::FunctionIO::populate(), llvm::instrumentor::GlobalVarIO::populate(), llvm::instrumentor::LoadIO::populate(), llvm::instrumentor::ModuleIO::populate(), llvm::instrumentor::NumericIO::populate(), llvm::instrumentor::StoreIO::populate(), and llvm::instrumentor::UnreachableIO::populate().
Referenced by init().
| SmallVector<BaseConfigurationOption *> llvm::instrumentor::InstrumentationConfig::BaseConfigurationOptions |
The list of enabled base configuration options.
Definition at line 431 of file Instrumentor.h.
Referenced by addBaseChoice(), init(), llvm::instrumentor::readConfigFromJSON(), and llvm::instrumentor::writeConfigToJSON().
| 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 407 of file Instrumentor.h.
Referenced by getBasePointerInfo().
| DenseMap<Constant *, GlobalVariable *> llvm::instrumentor::InstrumentationConfig::ConstantGlobalsCache |
Mapping from constants to globals with the constant as initializer.
Definition at line 416 of file Instrumentor.h.
Referenced by createValuePack().
| std::unique_ptr<BaseConfigurationOption> llvm::instrumentor::InstrumentationConfig::DemangleFunctionNames |
Definition at line 436 of file Instrumentor.h.
Referenced by llvm::instrumentor::FunctionIO::getFunctionName(), and init().
| std::unique_ptr<BaseConfigurationOption> llvm::instrumentor::InstrumentationConfig::FunctionRegex |
Definition at line 438 of file Instrumentor.h.
Referenced by init().
Mapping to remember global strings passed to the runtime.
Definition at line 413 of file Instrumentor.h.
Referenced by getGlobalString().
| std::unique_ptr<BaseConfigurationOption> llvm::instrumentor::InstrumentationConfig::GPUEnabled |
Definition at line 440 of file Instrumentor.h.
Referenced by init().
| std::unique_ptr<BaseConfigurationOption> llvm::instrumentor::InstrumentationConfig::HostEnabled |
Definition at line 439 of file Instrumentor.h.
Referenced by init().
| 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 448 of file Instrumentor.h.
Referenced by addChoice(), getBasePointerInfo(), init(), llvm::instrumentor::printRuntimeStub(), llvm::instrumentor::readConfigFromJSON(), and llvm::instrumentor::writeConfigToJSON().
| std::unique_ptr<BaseConfigurationOption> llvm::instrumentor::InstrumentationConfig::RuntimePrefix |
The base configuration options.
Definition at line 434 of file Instrumentor.h.
Referenced by getRTName(), and init().
| std::unique_ptr<BaseConfigurationOption> llvm::instrumentor::InstrumentationConfig::RuntimeStubsFile |
Definition at line 435 of file Instrumentor.h.
Referenced by init().
| StringSaver llvm::instrumentor::InstrumentationConfig::SS |
Definition at line 453 of file Instrumentor.h.
Referenced by getGlobalString(), InstrumentationConfig(), and llvm::instrumentor::readConfigFromJSON().
| BumpPtrAllocator llvm::instrumentor::InstrumentationConfig::StringAllocator |
Utilities for allocating and building strings.
{
Definition at line 452 of file Instrumentor.h.
Referenced by InstrumentationConfig().
| std::unique_ptr<BaseConfigurationOption> llvm::instrumentor::InstrumentationConfig::TargetRegex |
Definition at line 437 of file Instrumentor.h.
Referenced by init().
Map to remember underlying objects for pointers.
Definition at line 404 of file Instrumentor.h.
Referenced by getBasePointerInfo().