LLVM  14.0.0git
Public Member Functions | Public Attributes | List of all members
llvm::CallLowering::ValueAssigner Struct Reference

Argument handling is mostly uniform between the four places that make these decisions: function formal arguments, call instruction args, call instruction returns and function returns. More...

#include "llvm/CodeGen/GlobalISel/CallLowering.h"

Inheritance diagram for llvm::CallLowering::ValueAssigner:
Inheritance graph
[legend]
Collaboration diagram for llvm::CallLowering::ValueAssigner:
Collaboration graph
[legend]

Public Member Functions

 ValueAssigner (bool IsIncoming, CCAssignFn *AssignFn_, CCAssignFn *AssignFnVarArg_=nullptr)
 
virtual ~ValueAssigner ()=default
 
bool isIncomingArgumentHandler () const
 Returns true if the handler is dealing with incoming arguments, i.e. More...
 
virtual bool assignArg (unsigned ValNo, EVT OrigVT, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, const ArgInfo &Info, ISD::ArgFlagsTy Flags, CCState &State)
 Wrap call to (typically tablegenerated CCAssignFn). More...
 
CCAssignFngetAssignFn (bool IsVarArg) const
 Select the appropriate assignment function depending on whether this is a variadic call. More...
 

Public Attributes

CCAssignFnAssignFn
 Assignment function to use for a general call. More...
 
CCAssignFnAssignFnVarArg
 Assignment function to use for a variadic call. More...
 
uint64_t StackOffset = 0
 Stack offset for next argument. More...
 

Detailed Description

Argument handling is mostly uniform between the four places that make these decisions: function formal arguments, call instruction args, call instruction returns and function returns.

However, once a decision has been made on where an argument should go, exactly what happens can vary slightly. This class abstracts the differences.

ValueAssigner should not depend on any specific function state, and only determine the types and locations for arguments.

Definition at line 157 of file CallLowering.h.

Constructor & Destructor Documentation

◆ ValueAssigner()

llvm::CallLowering::ValueAssigner::ValueAssigner ( bool  IsIncoming,
CCAssignFn AssignFn_,
CCAssignFn AssignFnVarArg_ = nullptr 
)
inline

Definition at line 158 of file CallLowering.h.

References AssignFn, and AssignFnVarArg.

◆ ~ValueAssigner()

virtual llvm::CallLowering::ValueAssigner::~ValueAssigner ( )
virtualdefault

Member Function Documentation

◆ assignArg()

virtual bool llvm::CallLowering::ValueAssigner::assignArg ( unsigned  ValNo,
EVT  OrigVT,
MVT  ValVT,
MVT  LocVT,
CCValAssign::LocInfo  LocInfo,
const ArgInfo Info,
ISD::ArgFlagsTy  Flags,
CCState State 
)
inlinevirtual

Wrap call to (typically tablegenerated CCAssignFn).

This may be overridden to track additional state information as arguments are assigned or apply target specific hacks around the legacy infrastructure.

Reimplemented in MipsIncomingValueAssigner, and MipsOutgoingValueAssigner.

Definition at line 181 of file CallLowering.h.

References getAssignFn(), llvm::CCState::getNextStackOffset(), and llvm::CCState::isVarArg().

Referenced by MipsOutgoingValueAssigner::assignArg(), MipsIncomingValueAssigner::assignArg(), and llvm::CallLowering::determineAssignments().

◆ getAssignFn()

CCAssignFn* llvm::CallLowering::ValueAssigner::getAssignFn ( bool  IsVarArg) const
inline

Select the appropriate assignment function depending on whether this is a variadic call.

Definition at line 204 of file CallLowering.h.

References AssignFn, and AssignFnVarArg.

Referenced by assignArg().

◆ isIncomingArgumentHandler()

bool llvm::CallLowering::ValueAssigner::isIncomingArgumentHandler ( ) const
inline

Returns true if the handler is dealing with incoming arguments, i.e.

those that move values from some physical location to vregs.

Definition at line 173 of file CallLowering.h.

Member Data Documentation

◆ AssignFn

CCAssignFn* llvm::CallLowering::ValueAssigner::AssignFn

Assignment function to use for a general call.

Definition at line 192 of file CallLowering.h.

Referenced by getAssignFn(), and ValueAssigner().

◆ AssignFnVarArg

CCAssignFn* llvm::CallLowering::ValueAssigner::AssignFnVarArg

Assignment function to use for a variadic call.

This is usually the same as AssignFn on most targets.

Definition at line 196 of file CallLowering.h.

Referenced by getAssignFn(), and ValueAssigner().

◆ StackOffset

uint64_t llvm::CallLowering::ValueAssigner::StackOffset = 0

Stack offset for next argument.

At the end of argument evaluation, this is typically the total stack size.

Definition at line 200 of file CallLowering.h.

Referenced by llvm::ARMCallLowering::lowerCall(), and llvm::AMDGPUCallLowering::lowerFormalArguments().


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