class CCState

Declaration

class CCState { /* full declaration omitted */ };

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:191

Method Overview

  • public unsigned int AllocateReg(ArrayRef<llvm::MCPhysReg> Regs, const llvm::MCPhysReg * ShadowRegs)
  • public unsigned int AllocateReg(ArrayRef<llvm::MCPhysReg> Regs)
  • public unsigned int AllocateReg(unsigned int Reg, unsigned int ShadowReg)
  • public unsigned int AllocateReg(unsigned int Reg)
  • public unsigned int AllocateRegBlock(ArrayRef<llvm::MCPhysReg> Regs, unsigned int RegsRequired)
  • public unsigned int AllocateStack(unsigned int Size, unsigned int Align, ArrayRef<llvm::MCPhysReg> ShadowRegs)
  • public unsigned int AllocateStack(unsigned int Size, unsigned int Align, unsigned int ShadowReg)
  • public unsigned int AllocateStack(unsigned int Size, unsigned int Alignment)
  • public void AnalyzeArguments(const SmallVectorImpl<ISD::OutputArg> & Outs, llvm::CCAssignFn * Fn)
  • public void AnalyzeArguments(const SmallVectorImpl<ISD::InputArg> & Ins, llvm::CCAssignFn * Fn)
  • public template <class T>void AnalyzeArgumentsSecondPass(const SmallVectorImpl<T> & Args, llvm::CCAssignFn * Fn)
  • public void AnalyzeCallOperands(const SmallVectorImpl<ISD::OutputArg> & Outs, llvm::CCAssignFn * Fn)
  • public void AnalyzeCallOperands(SmallVectorImpl<llvm::MVT> & ArgVTs, SmallVectorImpl<ISD::ArgFlagsTy> & Flags, llvm::CCAssignFn * Fn)
  • public void AnalyzeCallResult(const SmallVectorImpl<ISD::InputArg> & Ins, llvm::CCAssignFn * Fn)
  • public void AnalyzeCallResult(llvm::MVT VT, llvm::CCAssignFn * Fn)
  • public void AnalyzeFormalArguments(const SmallVectorImpl<ISD::InputArg> & Ins, llvm::CCAssignFn * Fn)
  • public void AnalyzeReturn(const SmallVectorImpl<ISD::OutputArg> & Outs, llvm::CCAssignFn * Fn)
  • public CCState(CallingConv::ID CC, bool isVarArg, llvm::MachineFunction & MF, SmallVectorImpl<llvm::CCValAssign> & locs, llvm::LLVMContext & C)
  • public bool CheckReturn(const SmallVectorImpl<ISD::OutputArg> & Outs, llvm::CCAssignFn * Fn)
  • public void HandleByVal(unsigned int ValNo, llvm::MVT ValVT, llvm::MVT LocVT, CCValAssign::LocInfo LocInfo, int MinSize, int MinAlign, ISD::ArgFlagsTy ArgFlags)
  • public bool IsShadowAllocatedReg(unsigned int Reg) const
  • public void addInRegsParamInfo(unsigned int RegBegin, unsigned int RegEnd)
  • public void addLoc(const llvm::CCValAssign & V)
  • public void analyzeMustTailForwardedRegisters(SmallVectorImpl<llvm::ForwardedRegister> & Forwards, ArrayRef<llvm::MVT> RegParmTypes, llvm::CCAssignFn * Fn)
  • public void clearByValRegsInfo()
  • public void ensureMaxAlignment(llvm::Align Alignment)
  • public unsigned int getAlignedCallFrameSize() const
  • public CallingConv::ID getCallingConv() const
  • public llvm::LLVMContext & getContext() const
  • public unsigned int getFirstUnallocated(ArrayRef<llvm::MCPhysReg> Regs) const
  • public void getInRegsParamInfo(unsigned int InRegsParamRecordIndex, unsigned int & BeginReg, unsigned int & EndReg) const
  • public unsigned int getInRegsParamsCount() const
  • public unsigned int getInRegsParamsProcessed() const
  • public llvm::MachineFunction & getMachineFunction() const
  • public unsigned int getNextStackOffset() const
  • public SmallVectorImpl<ISD::ArgFlagsTy> & getPendingArgFlags()
  • public SmallVectorImpl<llvm::CCValAssign> & getPendingLocs()
  • public void getRemainingRegParmsForType(SmallVectorImpl<llvm::MCPhysReg> & Regs, llvm::MVT VT, llvm::CCAssignFn * Fn)
  • public bool isAllocated(unsigned int Reg) const
  • public bool isVarArg() const
  • public bool nextInRegsParam()
  • public static bool resultsCompatible(CallingConv::ID CalleeCC, CallingConv::ID CallerCC, llvm::MachineFunction & MF, llvm::LLVMContext & C, const SmallVectorImpl<ISD::InputArg> & Ins, llvm::CCAssignFn * CalleeFn, llvm::CCAssignFn * CallerFn)
  • public void rewindByValRegsInfo()

Methods

unsigned int AllocateReg(
    ArrayRef<llvm::MCPhysReg> Regs,
    const llvm::MCPhysReg* ShadowRegs)

Description

Version of AllocateReg with list of registers to be shadowed.

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:412

Parameters

ArrayRef<llvm::MCPhysReg> Regs
const llvm::MCPhysReg* ShadowRegs

unsigned int AllocateReg(
    ArrayRef<llvm::MCPhysReg> Regs)

Description

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.

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:371

Parameters

ArrayRef<llvm::MCPhysReg> Regs

unsigned int AllocateReg(unsigned int Reg,
                         unsigned int ShadowReg)

Description

Version of AllocateReg with extra register to be shadowed.

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:361

Parameters

unsigned int Reg
unsigned int ShadowReg

unsigned int AllocateReg(unsigned int Reg)

Description

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

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:354

Parameters

unsigned int Reg

unsigned int AllocateRegBlock(
    ArrayRef<llvm::MCPhysReg> Regs,
    unsigned int RegsRequired)

Description

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.

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:385

Parameters

ArrayRef<llvm::MCPhysReg> Regs
unsigned int RegsRequired

unsigned int AllocateStack(
    unsigned int Size,
    unsigned int Align,
    ArrayRef<llvm::MCPhysReg> ShadowRegs)

Description

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

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:449

Parameters

unsigned int Size
unsigned int Align
ArrayRef<llvm::MCPhysReg> ShadowRegs

unsigned int AllocateStack(unsigned int Size,
                           unsigned int Align,
                           unsigned int ShadowReg)

Description

Version of AllocateStack with extra register to be shadowed.

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:442

Parameters

unsigned int Size
unsigned int Align
unsigned int ShadowReg

unsigned int AllocateStack(unsigned int Size,
                           unsigned int Alignment)

Description

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

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:426

Parameters

unsigned int Size
unsigned int Alignment

void AnalyzeArguments(
    const SmallVectorImpl<ISD::OutputArg>& Outs,
    llvm::CCAssignFn* Fn)

Description

The function will invoke AnalyzeCallOperands.

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:323

Parameters

const SmallVectorImpl<ISD::OutputArg>& Outs
llvm::CCAssignFn* Fn

void AnalyzeArguments(
    const SmallVectorImpl<ISD::InputArg>& Ins,
    llvm::CCAssignFn* Fn)

Description

The function will invoke AnalyzeFormalArguments.

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:295

Parameters

const SmallVectorImpl<ISD::InputArg>& Ins
llvm::CCAssignFn* Fn

template <class T>
void AnalyzeArgumentsSecondPass(
    const SmallVectorImpl<T>& Args,
    llvm::CCAssignFn* Fn)

Description

The function runs an additional analysis pass over function arguments. It will mark each argument with the attribute flag SecArgPass. After running, it will sort the locs list.

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:543

Templates

T

Parameters

const SmallVectorImpl<T>& Args
llvm::CCAssignFn* Fn

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

Description

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

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:313

Parameters

const SmallVectorImpl<ISD::OutputArg>& Outs
llvm::CCAssignFn* Fn

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

Description

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

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:318

Parameters

SmallVectorImpl<llvm::MVT>& ArgVTs
SmallVectorImpl<ISD::ArgFlagsTy>& Flags
llvm::CCAssignFn* Fn

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

Description

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

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:330

Parameters

const SmallVectorImpl<ISD::InputArg>& Ins
llvm::CCAssignFn* Fn

void AnalyzeCallResult(llvm::MVT VT,
                       llvm::CCAssignFn* Fn)

Description

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

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:340

Parameters

llvm::MVT VT
llvm::CCAssignFn* Fn

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

Description

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

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:291

Parameters

const SmallVectorImpl<ISD::InputArg>& Ins
llvm::CCAssignFn* Fn

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

Description

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

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:302

Parameters

const SmallVectorImpl<ISD::OutputArg>& Outs
llvm::CCAssignFn* Fn

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

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:258

Parameters

CallingConv::ID CC
bool isVarArg
llvm::MachineFunction& MF
SmallVectorImpl<llvm::CCValAssign>& locs
llvm::LLVMContext& C

bool CheckReturn(
    const SmallVectorImpl<ISD::OutputArg>& Outs,
    llvm::CCAssignFn* Fn)

Description

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

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:308

Parameters

const SmallVectorImpl<ISD::OutputArg>& Outs
llvm::CCAssignFn* Fn

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

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:459

Parameters

unsigned int ValNo
llvm::MVT ValVT
llvm::MVT LocVT
CCValAssign::LocInfo LocInfo
int MinSize
int MinAlign
ISD::ArgFlagsTy ArgFlags

bool IsShadowAllocatedReg(unsigned int Reg) const

Description

A shadow allocated register is a register that was allocated but wasn't added to the location list (Locs).

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:336

Parameters

unsigned int Reg

Returns

true if the register was allocated as shadow or false otherwise.

void addInRegsParamInfo(unsigned int RegBegin,
                        unsigned int RegEnd)

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:483

Parameters

unsigned int RegBegin
unsigned int RegEnd

void addLoc(const llvm::CCValAssign& V)

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:261

Parameters

const llvm::CCValAssign& V

void analyzeMustTailForwardedRegisters(
    SmallVectorImpl<llvm::ForwardedRegister>&
        Forwards,
    ArrayRef<llvm::MVT> RegParmTypes,
    llvm::CCAssignFn* Fn)

Description

Compute the set of registers that need to be preserved and forwarded to any musttail calls.

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:527

Parameters

SmallVectorImpl<llvm::ForwardedRegister>& Forwards
ArrayRef<llvm::MVT> RegParmTypes
llvm::CCAssignFn* Fn

void clearByValRegsInfo()

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:498

void ensureMaxAlignment(llvm::Align Alignment)

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:436

Parameters

llvm::Align Alignment

unsigned int getAlignedCallFrameSize() const

Description

getAlignedCallFrameSize - Return the size of the call frame needed to be able to store all arguments and such that the alignment requirement of each of the arguments is satisfied.

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:279

CallingConv::ID getCallingConv() const

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:267

llvm::LLVMContext& getContext() const

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:265

unsigned int getFirstUnallocated(
    ArrayRef<llvm::MCPhysReg> Regs) const

Description

getFirstUnallocated - Return the index of the first unallocated register in the set, or Regs.size() if they are all allocated.

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:344

Parameters

ArrayRef<llvm::MCPhysReg> Regs

void getInRegsParamInfo(
    unsigned int InRegsParamRecordIndex,
    unsigned int& BeginReg,
    unsigned int& EndReg) const

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:472

Parameters

unsigned int InRegsParamRecordIndex
unsigned int& BeginReg
unsigned int& EndReg

unsigned int getInRegsParamsCount() const

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:465

unsigned int getInRegsParamsProcessed() const

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:468

llvm::MachineFunction& getMachineFunction() const

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:266

unsigned int getNextStackOffset() const

Description

getNextStackOffset - Return the next stack offset such that all stack slots satisfy their alignment requirements.

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:272

SmallVectorImpl<ISD::ArgFlagsTy>&
getPendingArgFlags()

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:514

SmallVectorImpl<llvm::CCValAssign>&
getPendingLocs()

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:509

void getRemainingRegParmsForType(
    SmallVectorImpl<llvm::MCPhysReg>& Regs,
    llvm::MVT VT,
    llvm::CCAssignFn* Fn)

Description

Compute the remaining unused register parameters that would be used for the given value type. This is useful when varargs are passed in the registers that normal prototyped parameters would be passed in, or for implementing perfect forwarding.

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:522

Parameters

SmallVectorImpl<llvm::MCPhysReg>& Regs
llvm::MVT VT
llvm::CCAssignFn* Fn

bool isAllocated(unsigned int Reg) const

Description

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

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:285

Parameters

unsigned int Reg

bool isVarArg() const

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:268

bool nextInRegsParam()

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:490

static bool resultsCompatible(
    CallingConv::ID CalleeCC,
    CallingConv::ID CallerCC,
    llvm::MachineFunction& MF,
    llvm::LLVMContext& C,
    const SmallVectorImpl<ISD::InputArg>& Ins,
    llvm::CCAssignFn* CalleeFn,
    llvm::CCAssignFn* CallerFn)

Description

Returns true if the results of the two calling conventions are compatible. This is usually part of the check for tailcall eligibility.

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:533

Parameters

CallingConv::ID CalleeCC
CallingConv::ID CallerCC
llvm::MachineFunction& MF
llvm::LLVMContext& C
const SmallVectorImpl<ISD::InputArg>& Ins
llvm::CCAssignFn* CalleeFn
llvm::CCAssignFn* CallerFn

void rewindByValRegsInfo()

Declared at: llvm/include/llvm/CodeGen/CallingConvLower.h:504