LLVM 23.0.0git
llvm::instrumentor::FunctionIO Struct Referencefinal

The instrumentation opportunity for functions. More...

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

Inheritance diagram for llvm::instrumentor::FunctionIO:
[legend]

Classes

struct  ConfigTy

Public Types

enum  ConfigKind {
  PassAddress = 0 , PassName , PassNumArguments , PassArguments ,
  ReplaceArguments , PassIsMain , PassId , NumConfig
}
Public Types inherited from llvm::instrumentor::InstrumentationOpportunity
using CallbackTy = std::function<bool(Value &)>
 An optional callback that takes the value that is about to be instrumented and can return false if it should be skipped.

Public Member Functions

 FunctionIO (InstrumentationLocation::KindTy Kind)
StringRef getName () const override
 Get the name of the instrumentation opportunity.
void init (InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB, ConfigTy *UserConfig=nullptr)
 FunctionIO {.
ValuegetNumArguments (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
ValuegetArguments (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
ValuesetArguments (Value &V, Value &NewV, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
Public Member Functions inherited from llvm::instrumentor::InstrumentationOpportunity
virtual ~InstrumentationOpportunity ()
 InstrumentationOpportunity (const InstrumentationLocation IP)
 Construct an opportunity with location IP.
virtual Valueinstrument (Value *&V, bool &Changed, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB, InstrumentationCaches &ICaches)
 }
virtual TypegetRetTy (LLVMContext &Ctx) const
 Get the return type for the instrumentation runtime function.
virtual ArrayRef< unsignedgetAllOpcodes () const
 Get all opcodes for this instrumentation opportunity.
InstrumentationLocation::KindTy getLocationKind () const
 Get the location kind of the instrumentation opportunity.
void addCommonArgs (InstrumentationConfig &IConf, LLVMContext &Ctx, bool PassId)
 }

Static Public Member Functions

static ValuegetFunctionAddress (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static ValuegetFunctionName (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static ValueisMainFunction (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static void populate (InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
Static Public Member Functions inherited from llvm::instrumentor::InstrumentationOpportunity
static ValueforceCast (Value &V, Type &Ty, InstrumentorIRBuilderTy &IIRB)
 Helpers to cast values, pass them to the runtime, and replace them.
static ValuegetValue (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static ValuereplaceValue (Value &V, Value &NewV, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static ValuegetIdPre (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
 Get the opportunity identifier for the pre and post positions.
static ValuegetIdPost (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static int32_t getIdFromEpoch (uint32_t CurrentEpoch)
 }

Public Attributes

llvm::instrumentor::FunctionIO::ConfigTy Config
Public Attributes inherited from llvm::instrumentor::InstrumentationOpportunity
InstrumentationLocation IP
 The instrumentation location of the opportunity.
SmallVector< IRTArgIRTArgs
 The list of possible arguments for the instrumentation runtime function.
bool Enabled = true
 Whether the opportunity is enabled.
StringRef Filter
 A filter expression to be matched against runtime property values.
CallbackTy CB = nullptr

Detailed Description

The instrumentation opportunity for functions.

Definition at line 621 of file Instrumentor.h.

Member Enumeration Documentation

◆ ConfigKind

Enumerator
PassAddress 
PassName 
PassNumArguments 
PassArguments 
ReplaceArguments 
PassIsMain 
PassId 
NumConfig 

Definition at line 625 of file Instrumentor.h.

Constructor & Destructor Documentation

◆ FunctionIO()

llvm::instrumentor::FunctionIO::FunctionIO ( InstrumentationLocation::KindTy Kind)
inline

Member Function Documentation

◆ getArguments()

Value * FunctionIO::getArguments ( Value & V,
Type & Ty,
InstrumentationConfig & IConf,
InstrumentorIRBuilderTy & IIRB )

Definition at line 967 of file Instrumentor.cpp.

References llvm::Function::args(), llvm::cast(), Config, createValuePack(), and llvm::make_filter_range().

Referenced by init().

◆ getFunctionAddress()

Value * FunctionIO::getFunctionAddress ( Value & V,
Type & Ty,
InstrumentationConfig & IConf,
InstrumentorIRBuilderTy & IIRB )
static

Definition at line 941 of file Instrumentor.cpp.

References llvm::cast(), llvm::Constant::getNullValue(), and llvm::Function::isIntrinsic().

Referenced by init().

◆ getFunctionName()

◆ getName()

StringRef llvm::instrumentor::FunctionIO::getName ( ) const
inlineoverridevirtual

Get the name of the instrumentation opportunity.

Implements llvm::instrumentor::InstrumentationOpportunity.

Definition at line 642 of file Instrumentor.h.

◆ getNumArguments()

Value * FunctionIO::getNumArguments ( Value & V,
Type & Ty,
InstrumentationConfig & IConf,
InstrumentorIRBuilderTy & IIRB )

◆ init()

◆ isMainFunction()

Value * FunctionIO::isMainFunction ( Value & V,
Type & Ty,
InstrumentationConfig & IConf,
InstrumentorIRBuilderTy & IIRB )
static

Definition at line 996 of file Instrumentor.cpp.

References llvm::cast(), and llvm::Value::getName().

Referenced by init().

◆ populate()

◆ setArguments()

Member Data Documentation

◆ Config

llvm::instrumentor::FunctionIO::ConfigTy llvm::instrumentor::FunctionIO::Config

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