LLVM API Documentation

llvm::CCState Class Reference

#include <CallingConvLower.h>

Collaboration diagram for llvm::CCState:
[legend]

List of all members.

Public Member Functions

 CCState (unsigned CC, bool isVarArg, const TargetMachine &TM, SmallVector< CCValAssign, 16 > &locs)
void addLoc (const CCValAssign &V)
const TargetMachine & getTarget () const
unsigned getCallingConv () const
bool isVarArg () const
unsigned getNextStackOffset () const
bool isAllocated (unsigned Reg) const
void AnalyzeFormalArguments (SDNode *TheArgs, CCAssignFn Fn)
void AnalyzeReturn (SDNode *TheRet, CCAssignFn Fn)
void AnalyzeCallOperands (CallSDNode *TheCall, CCAssignFn Fn)
void AnalyzeCallOperands (SmallVectorImpl< MVT > &ArgVTs, SmallVectorImpl< ISD::ArgFlagsTy > &Flags, CCAssignFn Fn)
void AnalyzeCallResult (CallSDNode *TheCall, CCAssignFn Fn)
void AnalyzeCallResult (MVT VT, CCAssignFn Fn)
unsigned getFirstUnallocated (const unsigned *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 unsigned *Regs, unsigned NumRegs)
unsigned AllocateReg (const unsigned *Regs, const unsigned *ShadowRegs, unsigned NumRegs)
 Version of AllocateReg with list of registers to be shadowed.
unsigned AllocateStack (unsigned Size, unsigned Align)
void HandleByVal (unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, int MinSize, int MinAlign, ISD::ArgFlagsTy ArgFlags)


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 107 of file CallingConvLower.h.


Constructor & Destructor Documentation

CCState::CCState ( unsigned  CC,
bool  isVarArg,
const TargetMachine &  TM,
SmallVector< CCValAssign, 16 > &  locs 
)


Member Function Documentation

void llvm::CCState::addLoc ( const CCValAssign &  V  )  [inline]

Definition at line 120 of file CallingConvLower.h.

Referenced by HandleByVal().

const TargetMachine& llvm::CCState::getTarget (  )  const [inline]

Definition at line 124 of file CallingConvLower.h.

unsigned llvm::CCState::getCallingConv (  )  const [inline]

Definition at line 125 of file CallingConvLower.h.

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

Definition at line 126 of file CallingConvLower.h.

unsigned llvm::CCState::getNextStackOffset (  )  const [inline]

Definition at line 128 of file CallingConvLower.h.

bool llvm::CCState::isAllocated ( unsigned  Reg  )  const [inline]

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

Definition at line 132 of file CallingConvLower.h.

Referenced by AllocateReg(), and getFirstUnallocated().

void CCState::AnalyzeFormalArguments ( SDNode *  TheArgs,
CCAssignFn  Fn 
)

AnalyzeFormalArguments - Analyze an ISD::FORMAL_ARGUMENTS node, incorporating info about the formals into this state.

AnalyzeFormalArguments - Analyze an ISD::FORMAL_ARGUMENTS node, incorporating info about the formals into this state.

Definition at line 60 of file CallingConvLower.cpp.

References llvm::cerr(), llvm::CCValAssign::Full, llvm::MVT::getMVTString(), llvm::SDNode::getNumValues(), llvm::SDNode::getOperand(), and llvm::SDNode::getValueType().

void CCState::AnalyzeReturn ( SDNode *  TheRet,
CCAssignFn  Fn 
)

AnalyzeReturn - Analyze the returned values of an ISD::RET node, incorporating info about the result values into this state.

AnalyzeReturn - Analyze the returned values of an ISD::RET node, incorporating info about the result values into this state.

Definition at line 77 of file CallingConvLower.cpp.

References llvm::cerr(), llvm::CCValAssign::Full, llvm::MVT::getMVTString(), llvm::SDNode::getNumOperands(), llvm::SDNode::getOperand(), llvm::SDValue::getValueType(), and VT.

Referenced by LowerRET().

void CCState::AnalyzeCallOperands ( CallSDNode *  TheCall,
CCAssignFn  Fn 
)

AnalyzeCallOperands - Analyze an ISD::CALL node, incorporating info about the passed values into this state.

AnalyzeCallOperands - Analyze an ISD::CALL node, incorporating info about the passed values into this state.

Definition at line 94 of file CallingConvLower.cpp.

References llvm::cerr(), llvm::CCValAssign::Full, llvm::CallSDNode::getArg(), llvm::CallSDNode::getArgFlags(), llvm::MVT::getMVTString(), llvm::CallSDNode::getNumArgs(), and llvm::SDValue::getValueType().

void CCState::AnalyzeCallOperands ( SmallVectorImpl< MVT > &  ArgVTs,
SmallVectorImpl< ISD::ArgFlagsTy > &  Flags,
CCAssignFn  Fn 
)

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

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

Definition at line 109 of file CallingConvLower.cpp.

References llvm::cerr(), llvm::CCValAssign::Full, llvm::MVT::getMVTString(), and llvm::SmallVectorImpl< T >::size().

void CCState::AnalyzeCallResult ( CallSDNode *  TheCall,
CCAssignFn  Fn 
)

AnalyzeCallResult - Analyze the return values of an ISD::CALL node, incorporating info about the passed values into this state.

AnalyzeCallResult - Analyze the return values of an ISD::CALL node, incorporating info about the passed values into this state.

Definition at line 126 of file CallingConvLower.cpp.

References llvm::cerr(), llvm::CCValAssign::Full, llvm::MVT::getMVTString(), llvm::CallSDNode::getNumRetVals(), llvm::CallSDNode::getRetValType(), llvm::CallSDNode::isInreg(), llvm::ISD::ArgFlagsTy::setInReg(), and VT.

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

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

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

Definition at line 142 of file CallingConvLower.cpp.

References llvm::cerr(), llvm::CCValAssign::Full, and llvm::MVT::getMVTString().

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

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

Definition at line 164 of file CallingConvLower.h.

References isAllocated().

Referenced by AllocateReg().

unsigned llvm::CCState::AllocateReg ( unsigned  Reg  )  [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 174 of file CallingConvLower.h.

References isAllocated().

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

Version of AllocateReg with extra register to be shadowed.

Definition at line 181 of file CallingConvLower.h.

References isAllocated().

unsigned llvm::CCState::AllocateReg ( const unsigned *  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 191 of file CallingConvLower.h.

References getFirstUnallocated(), and Reg.

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

Version of AllocateReg with list of registers to be shadowed.

Definition at line 203 of file CallingConvLower.h.

References getFirstUnallocated(), and Reg.

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

AllocateStack - Allocate a chunk of stack space with the specified size and alignment.

Definition at line 218 of file CallingConvLower.h.

Referenced by HandleByVal().

void CCState::HandleByVal ( unsigned  ValNo,
MVT  ValVT,
MVT  LocVT,
CCValAssign::LocInfo  LocInfo,
int  MinSize,
int  MinAlign,
ISD::ArgFlagsTy  ArgFlags 
)


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