LLVM 24.0.0git
llvm::instrumentor::CastIO Struct Referencefinal

The instrumentation opportunity for type cast instructions. More...

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

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

Public Types

enum  ConfigKind {
  PassInput , PassInputTypeId , PassInputSubTypeId , PassInputSize ,
  PassResult , ReplaceResult , PassResultTypeId , PassResultSubTypeId ,
  PassResultSize , PassOpcode , PassId , NumConfig
}
using ConfigTy = BaseConfigTy<ConfigKind>
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

 CastIO (InstrumentationLocation::KindTy Kind)
StringRef getName () const override
 Get the name of the instruction.
LLVM_ABI void init (InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB, ConfigTy *UserConfig=nullptr)
 CastIO {.
Public Member Functions inherited from llvm::instrumentor::InstructionIO< Instruction::PtrToInt, Instruction::IntToPtr, Instruction::Trunc, Instruction::ZExt, Instruction::SExt, Instruction::FPToUI, Instruction::FPToSI, Instruction::UIToFP, Instruction::SIToFP, Instruction::FPTrunc, Instruction::FPExt, Instruction::AddrSpaceCast, Instruction::BitCast >
virtual ~InstructionIO ()
 InstructionIO (InstrumentationLocation::KindTy Kind)
 Construct an instruction opportunity.
ArrayRef< unsigned > getAllOpcodes () const override
 Get all opcodes for this instrumentation opportunity (override).
Public Member Functions inherited from llvm::instrumentor::BaseInstructionIO
virtual ~BaseInstructionIO ()
 BaseInstructionIO (InstrumentationLocation::KindTy Kind)
Public Member Functions inherited from llvm::instrumentor::InstrumentationOpportunity
virtual ~InstrumentationOpportunity ()
 InstrumentationOpportunity (const InstrumentationLocation IP)
 Construct an opportunity with location IP.
virtual Value * instrument (Value *&V, bool &Changed, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB, InstrumentationCaches &ICaches)
 }
virtual Type * getRetTy (LLVMContext &Ctx) const
 Get the return type for the instrumentation runtime function.
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 LLVM_ABI Value * getInput (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static LLVM_ABI Value * getInputTypeId (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static LLVM_ABI Value * getInputSubTypeId (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static LLVM_ABI Value * getInputSize (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static LLVM_ABI Value * getResultTypeId (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static LLVM_ABI Value * getResultSubTypeId (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static LLVM_ABI Value * getResultSize (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static void populate (InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
Static Public Member Functions inherited from llvm::instrumentor::InstructionIO< Instruction::PtrToInt, Instruction::IntToPtr, Instruction::Trunc, Instruction::ZExt, Instruction::SExt, Instruction::FPToUI, Instruction::FPToSI, Instruction::UIToFP, Instruction::SIToFP, Instruction::FPTrunc, Instruction::FPExt, Instruction::AddrSpaceCast, Instruction::BitCast >
static constexpr size_t getNumOpcodes ()
 Get the number of opcodes.
Static Public Member Functions inherited from llvm::instrumentor::BaseInstructionIO
static LLVM_ABI Value * getOpcode (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static LLVM_ABI Value * getTypeSize (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static LLVM_ABI Value * getLeftOperand (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static LLVM_ABI Value * getRightOperand (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static LLVM_ABI Value * getTypeId (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static LLVM_ABI Value * getSubTypeId (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
Static Public Member Functions inherited from llvm::instrumentor::InstrumentationOpportunity
static LLVM_ABI Value * forceCast (Value &V, Type &Ty, InstrumentorIRBuilderTy &IIRB)
 Helpers to cast values, pass them to the runtime, and replace them.
static Value * getValue (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static LLVM_ABI Value * replaceValue (Value &V, Value &NewV, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static LLVM_ABI Value * getIdPre (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
 Get the opportunity identifier for the pre and post positions.
static LLVM_ABI Value * getIdPost (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static int32_t getIdFromEpoch (uint32_t CurrentEpoch)
 }

Public Attributes

ConfigTy Config
Public Attributes inherited from llvm::instrumentor::InstrumentationOpportunity
InstrumentationLocation IP
 The instrumentation location of the opportunity.
SmallVector< IRTArg > IRTArgs
 The list of possible arguments for the instrumentation runtime function.
StringMap< int32_t > FlagNames
 Flag names and their integer bitmask values.
bool Enabled = true
 Whether the opportunity is enabled.
StringRef Filter
 A filter expression to be matched against runtime property values.
CallbackTy CB = nullptr

Additional Inherited Members

Static Public Attributes inherited from llvm::instrumentor::InstructionIO< Instruction::PtrToInt, Instruction::IntToPtr, Instruction::Trunc, Instruction::ZExt, Instruction::SExt, Instruction::FPToUI, Instruction::FPToSI, Instruction::UIToFP, Instruction::SIToFP, Instruction::FPTrunc, Instruction::FPExt, Instruction::AddrSpaceCast, Instruction::BitCast >
static constexpr std::array< unsigned, sizeof...(Opcodes)> OpcodesArray

Detailed Description

The instrumentation opportunity for type cast instructions.

This includes PtrToInt, IntToPtr, Trunc, ZExt, SExt, FPToUI, FPToSI, UIToFP, SIToFP, FPTrunc, FPExt, AddrSpaceCast, and BitCast.

Definition at line 1125 of file Instrumentor.h.

Member Typedef Documentation

◆ ConfigTy

Member Enumeration Documentation

◆ ConfigKind

Enumerator
PassInput 
PassInputTypeId 
PassInputSubTypeId 
PassInputSize 
PassResult 
ReplaceResult 
PassResultTypeId 
PassResultSubTypeId 
PassResultSize 
PassOpcode 
PassId 
NumConfig 

Definition at line 1134 of file Instrumentor.h.

Constructor & Destructor Documentation

◆ CastIO()

Member Function Documentation

◆ getInput()

Value * CastIO::getInput ( Value & V,
Type & Ty,
InstrumentationConfig & IConf,
InstrumentorIRBuilderTy & IIRB )
static

Definition at line 1814 of file Instrumentor.cpp.

References llvm::cast().

Referenced by init().

◆ getInputSize()

Value * CastIO::getInputSize ( Value & V,
Type & Ty,
InstrumentationConfig & IConf,
InstrumentorIRBuilderTy & IIRB )
static

Definition at line 1833 of file Instrumentor.cpp.

References llvm::cast(), and DL.

Referenced by init().

◆ getInputSubTypeId()

Value * CastIO::getInputSubTypeId ( Value & V,
Type & Ty,
InstrumentationConfig & IConf,
InstrumentorIRBuilderTy & IIRB )
static

Definition at line 1826 of file Instrumentor.cpp.

References llvm::cast().

Referenced by init().

◆ getInputTypeId()

Value * CastIO::getInputTypeId ( Value & V,
Type & Ty,
InstrumentationConfig & IConf,
InstrumentorIRBuilderTy & IIRB )
static

Definition at line 1820 of file Instrumentor.cpp.

References llvm::cast().

Referenced by init().

◆ getName()

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

Get the name of the instruction.

For single-opcode IOs, this defaults to the opcode name. For multi-opcode IOs, getName() MUST be overridden to provide an explicit name identifying the whole group of opcodes.

Reimplemented from llvm::instrumentor::InstructionIO< Instruction::PtrToInt, Instruction::IntToPtr, Instruction::Trunc, Instruction::ZExt, Instruction::SExt, Instruction::FPToUI, Instruction::FPToSI, Instruction::UIToFP, Instruction::SIToFP, Instruction::FPTrunc, Instruction::FPExt, Instruction::AddrSpaceCast, Instruction::BitCast >.

Definition at line 1152 of file Instrumentor.h.

◆ getResultSize()

Value * CastIO::getResultSize ( Value & V,
Type & Ty,
InstrumentationConfig & IConf,
InstrumentorIRBuilderTy & IIRB )
static

Definition at line 1853 of file Instrumentor.cpp.

References llvm::cast(), and DL.

Referenced by init().

◆ getResultSubTypeId()

Value * CastIO::getResultSubTypeId ( Value & V,
Type & Ty,
InstrumentationConfig & IConf,
InstrumentorIRBuilderTy & IIRB )
static

Definition at line 1846 of file Instrumentor.cpp.

References llvm::cast().

Referenced by init().

◆ getResultTypeId()

Value * CastIO::getResultTypeId ( Value & V,
Type & Ty,
InstrumentationConfig & IConf,
InstrumentorIRBuilderTy & IIRB )
static

Definition at line 1840 of file Instrumentor.cpp.

References llvm::cast().

Referenced by init().

◆ init()

◆ populate()

Member Data Documentation

◆ Config

ConfigTy llvm::instrumentor::CastIO::Config

Definition at line 1150 of file Instrumentor.h.

Referenced by init().


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