clang  3.8.0
Public Types | Public Member Functions | Static Public Member Functions | List of all members
clang::CodeGen::ABIArgInfo Class Reference

ABIArgInfo - Helper class to encapsulate information about how a specific C type should be passed to or returned from a function. More...

#include <CGFunctionInfo.h>

Collaboration diagram for clang::CodeGen::ABIArgInfo:
[legend]

Public Types

enum  Kind : uint8_t {
  Direct, Extend, Indirect, Ignore,
  Expand, InAlloca, KindFirst = Direct, KindLast = InAlloca
}
 

Public Member Functions

 ABIArgInfo ()
 
Kind getKind () const
 
bool isDirect () const
 
bool isInAlloca () const
 
bool isExtend () const
 
bool isIgnore () const
 
bool isIndirect () const
 
bool isExpand () const
 
bool canHaveCoerceToType () const
 
unsigned getDirectOffset () const
 
void setDirectOffset (unsigned Offset)
 
llvm::TypegetPaddingType () const
 
void setPaddingType (llvm::Type *T)
 
bool getPaddingInReg () const
 
void setPaddingInReg (bool PIR)
 
llvm::TypegetCoerceToType () const
 
void setCoerceToType (llvm::Type *T)
 
bool getInReg () const
 
void setInReg (bool IR)
 
CharUnits getIndirectAlign () const
 
void setIndirectAlign (CharUnits IA)
 
bool getIndirectByVal () const
 
void setIndirectByVal (bool IBV)
 
bool getIndirectRealign () const
 
void setIndirectRealign (bool IR)
 
bool isSRetAfterThis () const
 
void setSRetAfterThis (bool AfterThis)
 
unsigned getInAllocaFieldIndex () const
 
void setInAllocaFieldIndex (unsigned FieldIndex)
 
bool getInAllocaSRet () const
 Return true if this field of an inalloca struct should be returned to implement a struct return calling convention. More...
 
void setInAllocaSRet (bool SRet)
 
bool getCanBeFlattened () const
 
void setCanBeFlattened (bool Flatten)
 
void dump () const
 

Static Public Member Functions

static ABIArgInfo getDirect (llvm::Type *T=nullptr, unsigned Offset=0, llvm::Type *Padding=nullptr, bool CanBeFlattened=true)
 
static ABIArgInfo getDirectInReg (llvm::Type *T=nullptr)
 
static ABIArgInfo getExtend (llvm::Type *T=nullptr)
 
static ABIArgInfo getExtendInReg (llvm::Type *T=nullptr)
 
static ABIArgInfo getIgnore ()
 
static ABIArgInfo getIndirect (CharUnits Alignment, bool ByVal=true, bool Realign=false, llvm::Type *Padding=nullptr)
 
static ABIArgInfo getIndirectInReg (CharUnits Alignment, bool ByVal=true, bool Realign=false)
 
static ABIArgInfo getInAlloca (unsigned FieldIndex)
 
static ABIArgInfo getExpand ()
 
static ABIArgInfo getExpandWithPadding (bool PaddingInReg, llvm::Type *Padding)
 

Detailed Description

ABIArgInfo - Helper class to encapsulate information about how a specific C type should be passed to or returned from a function.

Definition at line 37 of file CGFunctionInfo.h.

Member Enumeration Documentation

Enumerator
Direct 

Direct - Pass the argument directly using the normal converted LLVM type, or by coercing to another specified type stored in 'CoerceToType').

If an offset is specified (in UIntData), then the argument passed is offset by some number of bytes in the memory representation. A dummy argument is emitted before the real argument if the specified type stored in "PaddingType" is not zero.

Extend 

Extend - Valid only for integer argument types.

Same as 'direct' but also emit a zero/sign extension attribute.

Indirect 

Indirect - Pass the argument indirectly via a hidden pointer with the specified alignment (0 indicates default alignment).

Ignore 

Ignore - Ignore the argument (treat as void).

Useful for void and empty structs.

Expand 

Expand - Only valid for aggregate argument types.

The structure should be expanded into consecutive arguments for its constituent fields. Currently expand is only allowed on structures whose fields are all scalar types or are themselves expandable types.

InAlloca 

InAlloca - Pass the argument directly using the LLVM inalloca attribute.

This is similar to indirect with byval, except it only applies to arguments stored in memory and forbids any implicit copies. When applied to a return type, it means the value is returned indirectly via an implicit sret parameter stored in the argument struct.

KindFirst 
KindLast 

Definition at line 39 of file CGFunctionInfo.h.

Constructor & Destructor Documentation

clang::CodeGen::ABIArgInfo::ABIArgInfo ( )
inline

Definition at line 97 of file CGFunctionInfo.h.

Referenced by getDirect(), getExpand(), getExtend(), getIgnore(), getInAlloca(), and getIndirect().

Member Function Documentation

bool clang::CodeGen::ABIArgInfo::canHaveCoerceToType ( ) const
inline
void ABIArgInfo::dump ( ) const
bool clang::CodeGen::ABIArgInfo::getCanBeFlattened ( ) const
inline
llvm::Type* clang::CodeGen::ABIArgInfo::getCoerceToType ( ) const
inline
static ABIArgInfo clang::CodeGen::ABIArgInfo::getDirect ( llvm::Type T = nullptr,
unsigned  Offset = 0,
llvm::Type Padding = nullptr,
bool  CanBeFlattened = true 
)
inlinestatic

Definition at line 101 of file CGFunctionInfo.h.

References ABIArgInfo(), and Direct.

Referenced by getDirectInReg().

static ABIArgInfo clang::CodeGen::ABIArgInfo::getDirectInReg ( llvm::Type T = nullptr)
inlinestatic

Definition at line 111 of file CGFunctionInfo.h.

References getDirect().

unsigned clang::CodeGen::ABIArgInfo::getDirectOffset ( ) const
inline
static ABIArgInfo clang::CodeGen::ABIArgInfo::getExpand ( )
inlinestatic

Definition at line 152 of file CGFunctionInfo.h.

References ABIArgInfo(), and Expand.

Referenced by getExpandWithPadding().

static ABIArgInfo clang::CodeGen::ABIArgInfo::getExpandWithPadding ( bool  PaddingInReg,
llvm::Type Padding 
)
inlinestatic

Definition at line 155 of file CGFunctionInfo.h.

References getExpand().

static ABIArgInfo clang::CodeGen::ABIArgInfo::getExtend ( llvm::Type T = nullptr)
inlinestatic

Definition at line 116 of file CGFunctionInfo.h.

References ABIArgInfo(), and Extend.

Referenced by getExtendInReg().

static ABIArgInfo clang::CodeGen::ABIArgInfo::getExtendInReg ( llvm::Type T = nullptr)
inlinestatic

Definition at line 122 of file CGFunctionInfo.h.

References getExtend().

static ABIArgInfo clang::CodeGen::ABIArgInfo::getIgnore ( )
inlinestatic

Definition at line 127 of file CGFunctionInfo.h.

References ABIArgInfo(), and Ignore.

static ABIArgInfo clang::CodeGen::ABIArgInfo::getInAlloca ( unsigned  FieldIndex)
inlinestatic

Definition at line 147 of file CGFunctionInfo.h.

References ABIArgInfo(), and InAlloca.

unsigned clang::CodeGen::ABIArgInfo::getInAllocaFieldIndex ( ) const
inline
bool clang::CodeGen::ABIArgInfo::getInAllocaSRet ( ) const
inline

Return true if this field of an inalloca struct should be returned to implement a struct return calling convention.

Definition at line 262 of file CGFunctionInfo.h.

References isInAlloca().

Referenced by clang::CodeGen::CodeGenFunction::EmitFunctionEpilog(), and clang::CodeGen::CodeGenTypes::GetFunctionType().

static ABIArgInfo clang::CodeGen::ABIArgInfo::getIndirect ( CharUnits  Alignment,
bool  ByVal = true,
bool  Realign = false,
llvm::Type Padding = nullptr 
)
inlinestatic

Definition at line 130 of file CGFunctionInfo.h.

References ABIArgInfo(), and Indirect.

Referenced by getIndirectInReg(), and clang::ABIInfo::getNaturalAlignIndirect().

CharUnits clang::CodeGen::ABIArgInfo::getIndirectAlign ( ) const
inline
bool clang::CodeGen::ABIArgInfo::getIndirectByVal ( ) const
inline
static ABIArgInfo clang::CodeGen::ABIArgInfo::getIndirectInReg ( CharUnits  Alignment,
bool  ByVal = true,
bool  Realign = false 
)
inlinestatic

Definition at line 141 of file CGFunctionInfo.h.

References getIndirect().

Referenced by clang::ABIInfo::getNaturalAlignIndirectInReg().

bool clang::CodeGen::ABIArgInfo::getIndirectRealign ( ) const
inline

Definition at line 233 of file CGFunctionInfo.h.

References isIndirect().

Referenced by dump(), and clang::CodeGen::CodeGenFunction::EmitFunctionProlog().

bool clang::CodeGen::ABIArgInfo::getInReg ( ) const
inline
Kind clang::CodeGen::ABIArgInfo::getKind ( ) const
inline
bool clang::CodeGen::ABIArgInfo::getPaddingInReg ( ) const
inline
llvm::Type* clang::CodeGen::ABIArgInfo::getPaddingType ( ) const
inline
bool clang::CodeGen::ABIArgInfo::isDirect ( ) const
inline
bool clang::CodeGen::ABIArgInfo::isExpand ( ) const
inline

Definition at line 169 of file CGFunctionInfo.h.

References Expand.

bool clang::CodeGen::ABIArgInfo::isExtend ( ) const
inline
bool clang::CodeGen::ABIArgInfo::isIgnore ( ) const
inline

Definition at line 167 of file CGFunctionInfo.h.

References Ignore.

bool clang::CodeGen::ABIArgInfo::isInAlloca ( ) const
inline
bool clang::CodeGen::ABIArgInfo::isIndirect ( ) const
inline
bool clang::CodeGen::ABIArgInfo::isSRetAfterThis ( ) const
inline
void clang::CodeGen::ABIArgInfo::setCanBeFlattened ( bool  Flatten)
inline

Definition at line 277 of file CGFunctionInfo.h.

References isDirect().

void clang::CodeGen::ABIArgInfo::setCoerceToType ( llvm::Type T)
inline
void clang::CodeGen::ABIArgInfo::setDirectOffset ( unsigned  Offset)
inline

Definition at line 178 of file CGFunctionInfo.h.

References DirectOffset, isDirect(), and isExtend().

void clang::CodeGen::ABIArgInfo::setInAllocaFieldIndex ( unsigned  FieldIndex)
inline

Definition at line 255 of file CGFunctionInfo.h.

References AllocaFieldIndex, and isInAlloca().

void clang::CodeGen::ABIArgInfo::setInAllocaSRet ( bool  SRet)
inline

Definition at line 267 of file CGFunctionInfo.h.

References isInAlloca().

void clang::CodeGen::ABIArgInfo::setIndirectAlign ( CharUnits  IA)
inline

Definition at line 219 of file CGFunctionInfo.h.

References clang::CharUnits::getQuantity(), IndirectAlign, and isIndirect().

void clang::CodeGen::ABIArgInfo::setIndirectByVal ( bool  IBV)
inline

Definition at line 228 of file CGFunctionInfo.h.

References isIndirect().

void clang::CodeGen::ABIArgInfo::setIndirectRealign ( bool  IR)
inline

Definition at line 237 of file CGFunctionInfo.h.

References isIndirect().

void clang::CodeGen::ABIArgInfo::setInReg ( bool  IR)
inline

Definition at line 209 of file CGFunctionInfo.h.

References isDirect(), isExtend(), and isIndirect().

void clang::CodeGen::ABIArgInfo::setPaddingInReg ( bool  PIR)
inline

Definition at line 190 of file CGFunctionInfo.h.

void clang::CodeGen::ABIArgInfo::setPaddingType ( llvm::Type T)
inline

Definition at line 185 of file CGFunctionInfo.h.

void clang::CodeGen::ABIArgInfo::setSRetAfterThis ( bool  AfterThis)
inline

Definition at line 246 of file CGFunctionInfo.h.

References isIndirect().

Member Data Documentation

unsigned clang::CodeGen::ABIArgInfo::AllocaFieldIndex

Definition at line 82 of file CGFunctionInfo.h.

Referenced by getInAllocaFieldIndex(), and setInAllocaFieldIndex().

unsigned clang::CodeGen::ABIArgInfo::DirectOffset

Definition at line 80 of file CGFunctionInfo.h.

Referenced by getDirectOffset(), and setDirectOffset().

unsigned clang::CodeGen::ABIArgInfo::IndirectAlign

Definition at line 81 of file CGFunctionInfo.h.

Referenced by getIndirectAlign(), and setIndirectAlign().


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