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

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

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

Public Types

enum  ConfigKind {
  PassAddress = 0 , ReplaceAddress , PassAS , PassDeclaredSize ,
  PassAlignment , PassName , PassInitialValue , PassIsConstant ,
  PassIsDefinition , 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

 GlobalVarIO (bool IsPRE)
StringRef getName () const override
 Get the name of the instrumentation opportunity.
void init (InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB, ConfigTy *UserConfig=nullptr)
Public Member Functions inherited from llvm::instrumentor::InstrumentationOpportunity
virtual ~InstrumentationOpportunity ()
 InstrumentationOpportunity (const InstrumentationLocation IP)
 Construct an opportunity with location IP.
virtual Valueinstrument (Value *&V, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB, InstrumentationCaches &ICaches)
 }
virtual TypegetRetTy (LLVMContext &Ctx) const
 Get the return type for the instrumentation runtime function.
unsigned getOpcode () const
 Get the opcode of the instruction 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 ValuegetAddress (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static ValuesetAddress (Value &V, Value &NewV, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static ValuegetAS (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static ValuegetDeclaredSize (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static ValuegetAlignment (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static ValuegetSymbolName (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static ValuegetInitialValue (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static ValueisConstant (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static ValueisDefinition (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

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

Definition at line 748 of file Instrumentor.h.

Member Typedef Documentation

◆ ConfigTy

Member Enumeration Documentation

◆ ConfigKind

Enumerator
PassAddress 
ReplaceAddress 
PassAS 
PassDeclaredSize 
PassAlignment 
PassName 
PassInitialValue 
PassIsConstant 
PassIsDefinition 
PassId 
NumConfig 

Definition at line 754 of file Instrumentor.h.

Constructor & Destructor Documentation

◆ GlobalVarIO()

llvm::instrumentor::GlobalVarIO::GlobalVarIO ( bool IsPRE)
inline

Member Function Documentation

◆ getAddress()

◆ getAlignment()

Value * GlobalVarIO::getAlignment ( Value & V,
Type & Ty,
InstrumentationConfig & IConf,
InstrumentorIRBuilderTy & IIRB )
static

Definition at line 1419 of file Instrumentor.cpp.

References llvm::cast(), and llvm::GlobalVariable::getAlignment().

Referenced by init().

◆ getAS()

Value * GlobalVarIO::getAS ( Value & V,
Type & Ty,
InstrumentationConfig & IConf,
InstrumentorIRBuilderTy & IIRB )
static

Definition at line 1414 of file Instrumentor.cpp.

References llvm::cast(), and llvm::GlobalValue::getAddressSpace().

Referenced by init().

◆ getDeclaredSize()

Value * GlobalVarIO::getDeclaredSize ( Value & V,
Type & Ty,
InstrumentationConfig & IConf,
InstrumentorIRBuilderTy & IIRB )
static

◆ getInitialValue()

Value * GlobalVarIO::getInitialValue ( Value & V,
Type & Ty,
InstrumentationConfig & IConf,
InstrumentorIRBuilderTy & IIRB )
static

◆ getName()

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

Get the name of the instrumentation opportunity.

Implements llvm::instrumentor::InstrumentationOpportunity.

Definition at line 771 of file Instrumentor.h.

◆ getSymbolName()

Value * GlobalVarIO::getSymbolName ( Value & V,
Type & Ty,
InstrumentationConfig & IConf,
InstrumentorIRBuilderTy & IIRB )
static

◆ init()

◆ isConstant()

Value * GlobalVarIO::isConstant ( Value & V,
Type & Ty,
InstrumentationConfig & IConf,
InstrumentorIRBuilderTy & IIRB )
static

Definition at line 1445 of file Instrumentor.cpp.

References llvm::cast(), and llvm::GlobalVariable::isConstant().

Referenced by init().

◆ isDefinition()

Value * GlobalVarIO::isDefinition ( Value & V,
Type & Ty,
InstrumentationConfig & IConf,
InstrumentorIRBuilderTy & IIRB )
static

Definition at line 1450 of file Instrumentor.cpp.

References llvm::cast(), and llvm::GlobalValue::isDeclaration().

Referenced by init().

◆ populate()

void llvm::instrumentor::GlobalVarIO::populate ( InstrumentationConfig & IConf,
InstrumentorIRBuilderTy & IIRB )
inlinestatic

◆ setAddress()

Member Data Documentation

◆ Config

ConfigTy llvm::instrumentor::GlobalVarIO::Config

Definition at line 769 of file Instrumentor.h.

Referenced by init().


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