|
LLVM 23.0.0git
|
Classes | |
| struct | AllocaIO |
| The instrumentation opportunity for alloca instructions. More... | |
| struct | BaseConfigTy |
Boolean option bitset with a compile-time number of bits to store as many options as the enumeration type EnumTy defines. More... | |
| struct | BaseConfigurationOption |
| An option for the base configuration. More... | |
| struct | FunctionIO |
| The instrumentation opportunity for functions. More... | |
| struct | GlobalVarIO |
| struct | InstructionIO |
| The base instrumentation opportunity class for instruction opportunities. More... | |
| struct | InstrumentationCaches |
| Helper that represent the caches for instrumentation call arguments. More... | |
| struct | InstrumentationConfig |
| The class that contains the configuration for the instrumentor. More... | |
| struct | InstrumentationLocation |
| Helper to represent an instrumentation location, which is composed of an instrumentation opportunity type and a position. More... | |
| struct | InstrumentationOpportunity |
| Base class for instrumentation opportunities. More... | |
| struct | InstrumentorIRBuilderTy |
| An IR builder augmented with extra information for the instrumentor pass. More... | |
| struct | IRTArg |
| } More... | |
| struct | IRTCallDescription |
| Helper to represent an instrumentation runtime function that is related to an instrumentation opportunity. More... | |
| struct | LoadIO |
| The instrumentation opportunity for load instructions. More... | |
| struct | ModuleIO |
| struct | StoreIO |
| The instrumentation opportunity for store instructions. More... | |
| struct | UnreachableIO |
Typedefs | |
| using | GetterCallbackTy |
| Callback type for getting/setting a value for a instrumented opportunity. | |
| using | SetterCallbackTy |
Functions | |
| void | writeConfigToJSON (InstrumentationConfig &IConf, StringRef OutputFile, LLVMContext &Ctx) |
Write the configuration in /p IConf to the file with path OutputFile. | |
| bool | readConfigFromJSON (InstrumentationConfig &IConf, StringRef InputFile, LLVMContext &Ctx, vfs::FileSystem &FS) |
Read the configuration from the file with path InputFile into /p IConf. | |
| bool | readConfigPathsFile (StringRef InputFile, cl::list< std::string > &Configs, LLVMContext &Ctx, vfs::FileSystem &FS) |
Read the configuration paths from the file with path InputFile into Configs. | |
| void | printRuntimeStub (const InstrumentationConfig &IConf, StringRef StubRuntimeName, LLVMContext &Ctx) |
| Print a runtime stub file with the implementation of the instrumentation runtime functions corresponding to the instrumentation opportunities enabled. | |
| LLVM_ABI bool | evaluateFilter (Value &V, InstrumentationOpportunity &IO, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB) |
| Evaluate the filter expression against the current instrumentation opportunity. | |
| static std::pair< std::string, std::string > | getAsCType (Type *Ty, unsigned Flags) |
Get the string representation of an argument with type Ty. | |
| static std::string | getPrintfFormatString (Type *Ty, unsigned Flags) |
Get the string representation of the C printf format of an argument with type Ty. | |
Callback type for getting/setting a value for a instrumented opportunity.
{
Definition at line 50 of file Instrumentor.h.
Definition at line 52 of file Instrumentor.h.
| bool llvm::instrumentor::evaluateFilter | ( | Value & | V, |
| InstrumentationOpportunity & | IO, | ||
| InstrumentationConfig & | IConf, | ||
| InstrumentorIRBuilderTy & | IIRB ) |
Evaluate the filter expression against the current instrumentation opportunity.
Returns true if the filter passes (or is empty), false otherwise. Dynamic values (non-constants) are assumed to pass.
Definition at line 413 of file InstrumentorUtils.cpp.
References llvm::instrumentor::InstrumentorIRBuilderTy::Ctx, llvm::LLVMContext::diagnose(), llvm::DS_Error, llvm::dyn_cast(), llvm::StringRef::empty(), llvm::instrumentor::InstrumentationOpportunity::Filter, llvm::instrumentor::InstrumentationOpportunity::getName(), llvm::Value::getType(), llvm::instrumentor::InstrumentationOpportunity::IRTArgs, llvm::isa(), llvm::Type::isPointerTy(), llvm::instrumentor::IRTArg::STRING, and llvm::toString().
Referenced by llvm::instrumentor::InstrumentationOpportunity::instrument().
|
static |
Get the string representation of an argument with type Ty.
Two strings are returned: one for direct arguments and another for indirect arguments. The flags in Flags describe the properties of the argument. See IRTArg::IRArgFlagTy.
Definition at line 32 of file InstrumentorStubPrinter.cpp.
References llvm::instrumentor::IRTArg::STRING.
Referenced by llvm::instrumentor::IRTCallDescription::createCSignature().
Get the string representation of the C printf format of an argument with type Ty.
The flags in Flags describe the properties of the argument. See IRTArg::IRArgFlagTy.
Definition at line 53 of file InstrumentorStubPrinter.cpp.
References assert(), and llvm::instrumentor::IRTArg::STRING.
Referenced by llvm::instrumentor::IRTCallDescription::createCBodies().
| void llvm::instrumentor::printRuntimeStub | ( | const InstrumentationConfig & | IConf, |
| StringRef | StubRuntimeName, | ||
| LLVMContext & | Ctx ) |
Print a runtime stub file with the implementation of the instrumentation runtime functions corresponding to the instrumentation opportunities enabled.
Definition at line 174 of file InstrumentorStubPrinter.cpp.
References _, llvm::instrumentor::IRTCallDescription::createCBodies(), llvm::instrumentor::IRTCallDescription::createCSignature(), llvm::StringRef::empty(), and llvm::instrumentor::InstrumentationConfig::IChoices.
| bool llvm::instrumentor::readConfigFromJSON | ( | InstrumentationConfig & | IConf, |
| StringRef | InputFile, | ||
| LLVMContext & | Ctx, | ||
| vfs::FileSystem & | FS ) |
Read the configuration from the file with path InputFile into /p IConf.
Definition at line 115 of file InstrumentorConfigFile.cpp.
References llvm::instrumentor::InstrumentationConfig::BaseConfigurationOptions, llvm::instrumentor::BaseConfigurationOption::BOOLEAN, llvm::SmallPtrSetImpl< PtrType >::count(), llvm::DS_Warning, llvm::StringRef::empty(), llvm::StringRef::ends_with(), llvm::instrumentor::IRTArg::Flags, llvm::instrumentor::InstrumentationLocation::getKindFromStr(), llvm::instrumentor::InstrumentationConfig::IChoices, llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::StringMap< ValueTy, AllocatorTy >::lookup(), llvm::json::parse(), ReplaceMap, llvm::StringSaver::save(), llvm::setupMemoryBuffer(), llvm::instrumentor::InstrumentationConfig::SS, llvm::Twine::str(), llvm::instrumentor::BaseConfigurationOption::STRING, and llvm::toString().
| bool llvm::instrumentor::readConfigPathsFile | ( | StringRef | InputFile, |
| cl::list< std::string > & | Configs, | ||
| LLVMContext & | Ctx, | ||
| vfs::FileSystem & | FS ) |
Read the configuration paths from the file with path InputFile into Configs.
Definition at line 246 of file InstrumentorConfigFile.cpp.
References llvm::sys::path::append(), llvm::SmallString< InternalLen >::c_str(), llvm::StringRef::detectEOL(), llvm::DS_Warning, llvm::StringRef::empty(), llvm::sys::path::is_absolute(), llvm::sys::path::parent_path(), llvm::cl::list_storage< DataType, bool >::push_back(), llvm::setupMemoryBuffer(), llvm::StringRef::split(), llvm::toString(), and llvm::StringRef::trim().
| void llvm::instrumentor::writeConfigToJSON | ( | InstrumentationConfig & | IConf, |
| StringRef | OutputFile, | ||
| LLVMContext & | Ctx ) |
Write the configuration in /p IConf to the file with path OutputFile.
Definition at line 43 of file InstrumentorConfigFile.cpp.
References llvm::json::OStream::attribute(), llvm::json::OStream::attributeBegin(), llvm::json::OStream::attributeEnd(), llvm::instrumentor::InstrumentationConfig::BaseConfigurationOptions, llvm::instrumentor::BaseConfigurationOption::BOOLEAN, llvm::DS_Warning, llvm::StringRef::empty(), llvm::instrumentor::InstrumentationLocation::getKindStr(), llvm::instrumentor::InstrumentationConfig::IChoices, llvm::instrumentor::InstrumentationLocation::Last, llvm::json::OStream::objectBegin(), llvm::json::OStream::objectEnd(), llvm::instrumentor::IRTArg::REPLACABLE, llvm::instrumentor::IRTArg::REPLACABLE_CUSTOM, and llvm::instrumentor::BaseConfigurationOption::STRING.