LLVM 20.0.0git
Public Types | Public Member Functions | Friends | List of all members
llvm::Attributor::ArgumentReplacementInfo Struct Reference

Helper struct used in the communication between an abstract attribute (AA) that wants to change the signature of a function and the Attributor which applies the changes. More...

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

Public Types

using CalleeRepairCBTy = std::function< void(const ArgumentReplacementInfo &, Function &, Function::arg_iterator)>
 Callee repair callback type.
 
using ACSRepairCBTy = std::function< void(const ArgumentReplacementInfo &, AbstractCallSite, SmallVectorImpl< Value * > &)>
 Abstract call site (ACS) repair callback type.
 

Public Member Functions

AttributorgetAttributor () const
 Simple getters, see the corresponding members for details.
 
const FunctiongetReplacedFn () const
 
const ArgumentgetReplacedArg () const
 
unsigned getNumReplacementArgs () const
 
const SmallVectorImpl< Type * > & getReplacementTypes () const
 

Friends

struct Attributor
 Allow access to the private members from the Attributor.
 

Detailed Description

Helper struct used in the communication between an abstract attribute (AA) that wants to change the signature of a function and the Attributor which applies the changes.

The struct is partially initialized with the information from the AA (see the constructor). All other members are provided by the Attributor prior to invoking any callbacks.

Definition at line 2212 of file Attributor.h.

Member Typedef Documentation

◆ ACSRepairCBTy

Abstract call site (ACS) repair callback type.

The abstract call site repair callback is invoked once on every abstract call site of the replaced function (

See also
ReplacedFn). The callback needs to provide the operands for the call to the new replacement function. The number and type of the operands appended to the provided vector (second argument) is defined by the number and types determined through the replacement type vector (
ReplacementTypes). The first argument is the ArgumentReplacementInfo object registered with the Attributor through the registerFunctionSignatureRewrite call.

Definition at line 2233 of file Attributor.h.

◆ CalleeRepairCBTy

Callee repair callback type.

The function repair callback is invoked once to rewire the replacement arguments in the body of the new function. The argument replacement info is passed, as build from the registerFunctionSignatureRewrite call, as well as the replacement function and an iteratore to the first replacement argument.

Definition at line 2220 of file Attributor.h.

Member Function Documentation

◆ getAttributor()

Attributor & llvm::Attributor::ArgumentReplacementInfo::getAttributor ( ) const
inline

Simple getters, see the corresponding members for details.

{

Definition at line 2240 of file Attributor.h.

◆ getNumReplacementArgs()

unsigned llvm::Attributor::ArgumentReplacementInfo::getNumReplacementArgs ( ) const
inline

Definition at line 2243 of file Attributor.h.

◆ getReplacedArg()

const Argument & llvm::Attributor::ArgumentReplacementInfo::getReplacedArg ( ) const
inline

Definition at line 2242 of file Attributor.h.

◆ getReplacedFn()

const Function & llvm::Attributor::ArgumentReplacementInfo::getReplacedFn ( ) const
inline

Definition at line 2241 of file Attributor.h.

◆ getReplacementTypes()

const SmallVectorImpl< Type * > & llvm::Attributor::ArgumentReplacementInfo::getReplacementTypes ( ) const
inline

Definition at line 2244 of file Attributor.h.

Friends And Related Function Documentation

◆ Attributor

friend struct Attributor
friend

Allow access to the private members from the Attributor.

Definition at line 2282 of file Attributor.h.


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