LLVM API Documentation

Classes | Public Member Functions | Protected Attributes
llvm::CCState Class Reference

#include <CallingConvLower.h>

Collaboration diagram for llvm::CCState:
Collaboration graph
[legend]

List of all members.

Classes

struct  ByValInfo

Public Member Functions

 CCState (CallingConv::ID CC, bool isVarArg, MachineFunction &MF, SmallVectorImpl< CCValAssign > &locs, LLVMContext &C)
void addLoc (const CCValAssign &V)
LLVMContextgetContext () const
MachineFunctiongetMachineFunction () const
CallingConv::ID getCallingConv () const
bool isVarArg () const
unsigned getNextStackOffset () const
bool isAllocated (unsigned Reg) const
void AnalyzeFormalArguments (const SmallVectorImpl< ISD::InputArg > &Ins, CCAssignFn Fn)
void AnalyzeReturn (const SmallVectorImpl< ISD::OutputArg > &Outs, CCAssignFn Fn)
bool CheckReturn (const SmallVectorImpl< ISD::OutputArg > &ArgsFlags, CCAssignFn Fn)
void AnalyzeCallOperands (const SmallVectorImpl< ISD::OutputArg > &Outs, CCAssignFn Fn)
void AnalyzeCallOperands (SmallVectorImpl< MVT > &ArgVTs, SmallVectorImpl< ISD::ArgFlagsTy > &Flags, CCAssignFn Fn)
void AnalyzeCallResult (const SmallVectorImpl< ISD::InputArg > &Ins, CCAssignFn Fn)
void AnalyzeCallResult (MVT VT, CCAssignFn Fn)
unsigned getFirstUnallocated (const MCPhysReg *Regs, unsigned NumRegs) const
unsigned AllocateReg (unsigned Reg)
unsigned AllocateReg (unsigned Reg, unsigned ShadowReg)
 Version of AllocateReg with extra register to be shadowed.
unsigned AllocateReg (const MCPhysReg *Regs, unsigned NumRegs)
unsigned AllocateRegBlock (const uint16_t *Regs, unsigned NumRegs, unsigned RegsRequired)
unsigned AllocateReg (const MCPhysReg *Regs, const MCPhysReg *ShadowRegs, unsigned NumRegs)
 Version of AllocateReg with list of registers to be shadowed.
unsigned AllocateStack (unsigned Size, unsigned Align)
unsigned AllocateStack (unsigned Size, unsigned Align, unsigned ShadowReg)
 Version of AllocateStack with extra register to be shadowed.
unsigned AllocateStack (unsigned Size, unsigned Align, const MCPhysReg *ShadowRegs, unsigned NumShadowRegs)
void HandleByVal (unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, int MinSize, int MinAlign, ISD::ArgFlagsTy ArgFlags)
unsigned getInRegsParamsCount () const
unsigned getInRegsParamsProceed () const
void getInRegsParamInfo (unsigned InRegsParamRecordIndex, unsigned &BeginReg, unsigned &EndReg) const
void addInRegsParamInfo (unsigned RegBegin, unsigned RegEnd)
bool nextInRegsParam ()
void clearByValRegsInfo ()
void rewindByValRegsInfo ()
ParmContext getCallOrPrologue () const
SmallVectorImpl
< llvm::CCValAssign > & 
getPendingLocs ()

Protected Attributes

ParmContext CallOrPrologue

Detailed Description

CCState - This class holds information needed while lowering arguments and return values. It captures which registers are already assigned and which stack slots are used. It provides accessors to allocate these values.

Definition at line 172 of file CallingConvLower.h.


Constructor & Destructor Documentation

CCState::CCState ( CallingConv::ID  CC,
bool  isVarArg,
MachineFunction MF,
SmallVectorImpl< CCValAssign > &  locs,
LLVMContext C 
)

Member Function Documentation

void llvm::CCState::addInRegsParamInfo ( unsigned  RegBegin,
unsigned  RegEnd 
) [inline]
void llvm::CCState::addLoc ( const CCValAssign V) [inline]

AllocateReg - Attempt to allocate one register. If it is not available, return zero. Otherwise, return the register, marking it and any aliases as allocated.

Definition at line 307 of file CallingConvLower.h.

References isAllocated().

Referenced by AnalyzeArguments(), llvm::CC_ARM_AAPCS_Custom_HA(), CC_Hexagon32(), CC_Hexagon64(), CC_MipsO32(), llvm::CC_PPC32_SVR4_Custom_AlignArgRegs(), llvm::CC_PPC32_SVR4_Custom_AlignFPArgRegs(), CC_Sparc_Assign_f64(), llvm::f64AssignAAPCS(), llvm::f64AssignAPCS(), llvm::f64RetAssign(), RetCC_Hexagon32(), and RetCC_Hexagon64().

unsigned llvm::CCState::AllocateReg ( unsigned  Reg,
unsigned  ShadowReg 
) [inline]

Version of AllocateReg with extra register to be shadowed.

Definition at line 314 of file CallingConvLower.h.

References isAllocated().

unsigned llvm::CCState::AllocateReg ( const MCPhysReg Regs,
unsigned  NumRegs 
) [inline]

AllocateReg - Attempt to allocate one of the specified registers. If none are available, return zero. Otherwise, return the first one available, marking it and any aliases as allocated.

Definition at line 324 of file CallingConvLower.h.

References getFirstUnallocated().

unsigned llvm::CCState::AllocateReg ( const MCPhysReg Regs,
const MCPhysReg ShadowRegs,
unsigned  NumRegs 
) [inline]

Version of AllocateReg with list of registers to be shadowed.

Definition at line 361 of file CallingConvLower.h.

References getFirstUnallocated().

unsigned llvm::CCState::AllocateRegBlock ( const uint16_t *  Regs,
unsigned  NumRegs,
unsigned  RegsRequired 
) [inline]

AllocateRegBlock - Attempt to allocate a block of RegsRequired consecutive registers. If this is not possible, return zero. Otherwise, return the first register of the block that were allocated, marking the entire block as allocated.

Definition at line 338 of file CallingConvLower.h.

References isAllocated().

Referenced by llvm::CC_ARM_AAPCS_Custom_HA().

unsigned llvm::CCState::AllocateStack ( unsigned  Size,
unsigned  Align 
) [inline]
unsigned llvm::CCState::AllocateStack ( unsigned  Size,
unsigned  Align,
unsigned  ShadowReg 
) [inline]

Version of AllocateStack with extra register to be shadowed.

Definition at line 386 of file CallingConvLower.h.

References AllocateStack().

unsigned llvm::CCState::AllocateStack ( unsigned  Size,
unsigned  Align,
const MCPhysReg ShadowRegs,
unsigned  NumShadowRegs 
) [inline]

Version of AllocateStack with list of extra registers to be shadowed. Note that, unlike AllocateReg, this shadows ALL of the shadow registers.

Definition at line 393 of file CallingConvLower.h.

References AllocateStack().

AnalyzeCallOperands - Analyze the outgoing arguments to a call, incorporating info about the passed values into this state.

Definition at line 119 of file CallingConvLower.cpp.

References llvm::dbgs(), llvm::CCValAssign::Full, llvm::EVT::getEVTString(), llvm_unreachable, and llvm::SmallVectorTemplateCommon< T, typename >::size().

Referenced by AnalyzeVarArgs(), llvm::SystemZTargetLowering::LowerCall(), llvm::SparcTargetLowering::LowerCall_32(), and llvm::SparcTargetLowering::LowerCall_64().

AnalyzeCallOperands - Same as above except it takes vectors of types and argument flags.

Definition at line 137 of file CallingConvLower.cpp.

References llvm::dbgs(), llvm::CCValAssign::Full, llvm::EVT::getEVTString(), llvm_unreachable, and llvm::SmallVectorTemplateCommon< T >::size().

AnalyzeCallResult - Analyze the return values of a call, incorporating info about the passed values into this state.

Definition at line 156 of file CallingConvLower.cpp.

References llvm::dbgs(), llvm::CCValAssign::Full, llvm::EVT::getEVTString(), llvm_unreachable, and llvm::SmallVectorTemplateCommon< T, typename >::size().

Referenced by AnalyzeRetResult(), llvm::SystemZTargetLowering::LowerCall(), llvm::SparcTargetLowering::LowerCall_32(), and llvm::HexagonTargetLowering::LowerCallResult().

void CCState::AnalyzeCallResult ( MVT  VT,
CCAssignFn  Fn 
)

AnalyzeCallResult - Same as above except it's specialized for calls which produce a single value.

Definition at line 173 of file CallingConvLower.cpp.

References llvm::dbgs(), llvm::CCValAssign::Full, llvm::EVT::getEVTString(), and llvm_unreachable.

CheckReturn - Analyze the return values of a function, returning true if the return can be performed without sret-demotion, and false otherwise.

Definition at line 87 of file CallingConvLower.cpp.

References llvm::CCValAssign::Full, and llvm::SmallVectorTemplateCommon< T, typename >::size().

Definition at line 442 of file CallingConvLower.h.

References llvm::SmallVectorImpl< T >::clear().

Referenced by CCState().

Definition at line 248 of file CallingConvLower.h.

Definition at line 452 of file CallingConvLower.h.

References CallOrPrologue.

Definition at line 246 of file CallingConvLower.h.

unsigned llvm::CCState::getFirstUnallocated ( const MCPhysReg Regs,
unsigned  NumRegs 
) const [inline]

getFirstUnallocated - Return the first unallocated register in the set, or NumRegs if they are all allocated.

Definition at line 297 of file CallingConvLower.h.

References isAllocated().

Referenced by AllocateReg(), CC_MipsO32(), llvm::CC_PPC32_SVR4_Custom_AlignArgRegs(), and llvm::CC_PPC32_SVR4_Custom_AlignFPArgRegs().

void llvm::CCState::getInRegsParamInfo ( unsigned  InRegsParamRecordIndex,
unsigned BeginReg,
unsigned EndReg 
) const [inline]

Definition at line 412 of file CallingConvLower.h.

Definition at line 247 of file CallingConvLower.h.

Definition at line 251 of file CallingConvLower.h.

Definition at line 455 of file CallingConvLower.h.

Referenced by llvm::CC_ARM_AAPCS_Custom_HA().

void CCState::HandleByVal ( unsigned  ValNo,
MVT  ValVT,
MVT  LocVT,
CCValAssign::LocInfo  LocInfo,
int  MinSize,
int  MinAlign,
ISD::ArgFlagsTy  ArgFlags 
)
bool llvm::CCState::isAllocated ( unsigned  Reg) const [inline]

isAllocated - Return true if the specified register (or an alias) is allocated.

Definition at line 255 of file CallingConvLower.h.

Referenced by AllocateReg(), AllocateRegBlock(), and getFirstUnallocated().

bool llvm::CCState::isVarArg ( ) const [inline]

Definition at line 249 of file CallingConvLower.h.

Referenced by AnalyzeArguments(), and CC_MipsO32().

Definition at line 448 of file CallingConvLower.h.


Member Data Documentation

Definition at line 236 of file CallingConvLower.h.

Referenced by getCallOrPrologue().


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