|
LLVM 23.0.0git
|
Helper to represent an instrumentation runtime function that is related to an instrumentation opportunity. More...
#include "llvm/Transforms/IPO/Instrumentor.h"
Public Member Functions | |
| IRTCallDescription (InstrumentationOpportunity &IO, Type *RetTy=nullptr) | |
Construct an instrumentation function description linked to the IO instrumentation opportunity and RetTy return type. | |
| FunctionType * | createLLVMSignature (InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB, const DataLayout &DL, bool ForceIndirection) |
| Create the type of the instrumentation function. | |
| CallInst * | createLLVMCall (Value *&V, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB, const DataLayout &DL, InstrumentationCaches &ICaches) |
| Create a call instruction that calls to the instrumentation function and passes the corresponding arguments. | |
| bool | isReplacable (IRTArg &IRTA) const |
Return whether the IRTA argument can be replaced. | |
| bool | isPotentiallyIndirect (IRTArg &IRTA) const |
| Return whether the function may have any indirect argument. | |
Public Attributes | |
| bool | RequiresIndirection = false |
| Whether the function requires indirection in some argument. | |
| bool | MightRequireIndirection = false |
| Whether any argument may require indirection. | |
| unsigned | NumReplaceableArgs = 0 |
| The number of arguments that can be replaced. | |
| InstrumentationOpportunity & | IO |
| The instrumentation opportunity which it is linked to. | |
| Type * | RetTy = nullptr |
| The return type of the instrumentation function. | |
Helper to represent an instrumentation runtime function that is related to an instrumentation opportunity.
Definition at line 103 of file Instrumentor.h.
| IRTCallDescription::IRTCallDescription | ( | InstrumentationOpportunity & | IO, |
| Type * | RetTy = nullptr ) |
Construct an instrumentation function description linked to the IO instrumentation opportunity and RetTy return type.
Definition at line 371 of file Instrumentor.cpp.
References if(), IO, MightRequireIndirection, NumReplaceableArgs, RequiresIndirection, and RetTy.
| CallInst * IRTCallDescription::createLLVMCall | ( | Value *& | V, |
| InstrumentationConfig & | IConf, | ||
| InstrumentorIRBuilderTy & | IIRB, | ||
| const DataLayout & | DL, | ||
| InstrumentationCaches & | ICaches ) |
Create a call instruction that calls to the instrumentation function and passes the corresponding arguments.
Definition at line 413 of file Instrumentor.cpp.
References assert(), createLLVMSignature(), llvm::instrumentor::InstrumentorIRBuilderTy::Ctx, llvm::LLVMContext::diagnose(), llvm::instrumentor::InstrumentationCaches::DirectArgCache, DL, llvm::DS_Warning, llvm::instrumentor::InstrumentorIRBuilderTy::Epoch, llvm::Attribute::get(), llvm::instrumentor::InstrumentorIRBuilderTy::getAlloca(), llvm::Constant::getNullValue(), llvm::instrumentor::InstrumentationConfig::getRTName(), llvm::GlobalValue::getType(), I, llvm::instrumentor::IRTArg::INDIRECT_HAS_SIZE, llvm::instrumentor::InstrumentationCaches::IndirectArgCache, llvm::SmallVectorImpl< T >::insert(), IO, llvm::instrumentor::InstrumentorIRBuilderTy::IRB, isPotentiallyIndirect(), isReplacable(), llvm::Offset, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::instrumentor::IRTArg::REPLACABLE_CUSTOM, and RequiresIndirection.
Referenced by llvm::instrumentor::InstrumentationOpportunity::instrument().
| FunctionType * IRTCallDescription::createLLVMSignature | ( | InstrumentationConfig & | IConf, |
| InstrumentorIRBuilderTy & | IIRB, | ||
| const DataLayout & | DL, | ||
| bool | ForceIndirection ) |
Create the type of the instrumentation function.
Definition at line 384 of file Instrumentor.cpp.
References assert(), DL, llvm::FunctionType::get(), llvm::instrumentor::IRTArg::INDIRECT_HAS_SIZE, llvm::instrumentor::InstrumentorIRBuilderTy::Int32Ty, IO, isPotentiallyIndirect(), MightRequireIndirection, NumReplaceableArgs, llvm::instrumentor::InstrumentorIRBuilderTy::PtrTy, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::instrumentor::IRTArg::REPLACABLE, RequiresIndirection, RetTy, and llvm::instrumentor::InstrumentorIRBuilderTy::VoidTy.
Referenced by createLLVMCall().
Return whether the function may have any indirect argument.
Definition at line 126 of file Instrumentor.h.
References llvm::instrumentor::IRTArg::Flags, NumReplaceableArgs, llvm::instrumentor::IRTArg::POTENTIALLY_INDIRECT, and llvm::instrumentor::IRTArg::REPLACABLE.
Referenced by createLLVMCall(), and createLLVMSignature().
Return whether the IRTA argument can be replaced.
Definition at line 121 of file Instrumentor.h.
References llvm::instrumentor::IRTArg::Flags, llvm::instrumentor::IRTArg::REPLACABLE, and llvm::instrumentor::IRTArg::REPLACABLE_CUSTOM.
Referenced by createLLVMCall().
| InstrumentationOpportunity& llvm::instrumentor::IRTCallDescription::IO |
The instrumentation opportunity which it is linked to.
Definition at line 141 of file Instrumentor.h.
Referenced by createLLVMCall(), createLLVMSignature(), and IRTCallDescription().
| bool llvm::instrumentor::IRTCallDescription::MightRequireIndirection = false |
Whether any argument may require indirection.
Definition at line 135 of file Instrumentor.h.
Referenced by createLLVMSignature(), and IRTCallDescription().
| unsigned llvm::instrumentor::IRTCallDescription::NumReplaceableArgs = 0 |
The number of arguments that can be replaced.
Definition at line 138 of file Instrumentor.h.
Referenced by createLLVMSignature(), IRTCallDescription(), and isPotentiallyIndirect().
| bool llvm::instrumentor::IRTCallDescription::RequiresIndirection = false |
Whether the function requires indirection in some argument.
Definition at line 132 of file Instrumentor.h.
Referenced by createLLVMCall(), createLLVMSignature(), and IRTCallDescription().
| Type* llvm::instrumentor::IRTCallDescription::RetTy = nullptr |
The return type of the instrumentation function.
Definition at line 144 of file Instrumentor.h.
Referenced by createLLVMSignature(), and IRTCallDescription().