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, LLVMContext &C)
void addLoc (const CCValAssign &V)
LLVMContext & getContext () const
const TargetMachine & getTarget () const
unsigned 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)
void AnalyzeCallOperands (const SmallVectorImpl< ISD::OutputArg > &Outs, CCAssignFn Fn)
void AnalyzeCallOperands (SmallVectorImpl< EVT > &ArgVTs, SmallVectorImpl< ISD::ArgFlagsTy > &Flags, CCAssignFn Fn)
void AnalyzeCallResult (const SmallVectorImpl< ISD::InputArg > &Ins, CCAssignFn Fn)
void AnalyzeCallResult (EVT 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, EVT ValVT, EVT 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 144 of file CallingConvLower.h.


Constructor & Destructor Documentation

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


Member Function Documentation

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

LLVMContext& llvm::CCState::getContext (  )  const [inline]

Definition at line 162 of file CallingConvLower.h.

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

Definition at line 163 of file CallingConvLower.h.

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

Definition at line 164 of file CallingConvLower.h.

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

Definition at line 165 of file CallingConvLower.h.

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

Definition at line 167 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 171 of file CallingConvLower.h.

Referenced by AllocateReg(), and getFirstUnallocated().

void CCState::AnalyzeFormalArguments ( const SmallVectorImpl< ISD::InputArg > &  Ins,
CCAssignFn  Fn 
)

AnalyzeFormalArguments - Analyze an array of argument values, incorporating info about the formals into this state.

AnalyzeFormalArguments - Analyze an array of argument values, incorporating info about the formals into this state.

Definition at line 63 of file CallingConvLower.cpp.

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

void CCState::AnalyzeReturn ( const SmallVectorImpl< ISD::OutputArg > &  Outs,
CCAssignFn  Fn 
)

AnalyzeReturn - Analyze the returned values of a return, incorporating info about the result values into this state.

AnalyzeReturn - Analyze the returned values of a return, incorporating info about the result values into this state.

Definition at line 82 of file CallingConvLower.cpp.

References llvm::cerr(), llvm::CCValAssign::Full, llvm::EVT::getEVTString(), llvm_unreachable, llvm::SmallVectorImpl< T >::size(), and VT.

void CCState::AnalyzeCallOperands ( const SmallVectorImpl< ISD::OutputArg > &  Outs,
CCAssignFn  Fn 
)

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

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

Definition at line 101 of file CallingConvLower.cpp.

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

void CCState::AnalyzeCallOperands ( SmallVectorImpl< EVT > &  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 119 of file CallingConvLower.cpp.

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

void CCState::AnalyzeCallResult ( const SmallVectorImpl< ISD::InputArg > &  Ins,
CCAssignFn  Fn 
)

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

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

Definition at line 138 of file CallingConvLower.cpp.

References llvm::cerr(), llvm::CCValAssign::Full, llvm::EVT::getEVTString(), llvm_unreachable, llvm::SmallVectorImpl< T >::size(), and VT.

void CCState::AnalyzeCallResult ( EVT  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 155 of file CallingConvLower.cpp.

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

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

References isAllocated().

Referenced by AllocateReg(), CC_MipsO32(), CC_PPC_SVR4_Custom_AlignArgRegs(), and CC_PPC_SVR4_Custom_AlignFPArgRegs().

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

References isAllocated().

Referenced by CC_MipsO32(), CC_PPC_SVR4_Custom_AlignArgRegs(), CC_PPC_SVR4_Custom_AlignFPArgRegs(), f64AssignAAPCS(), f64AssignAPCS(), and f64RetAssign().

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

Version of AllocateReg with extra register to be shadowed.

Definition at line 224 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 234 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 246 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 261 of file CallingConvLower.h.

Referenced by CC_MipsO32(), f64AssignAAPCS(), f64AssignAPCS(), and HandleByVal().

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


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