clang API Documentation

Public Types | Public Member Functions | Static Public Member Functions
clang::CodeGen::ABIArgInfo Class Reference

#include <CGFunctionInfo.h>

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

List of all members.

Public Types

enum  Kind {
  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::Type * getPaddingType () const
void setPaddingType (llvm::Type *T)
bool getPaddingInReg () const
void setPaddingInReg (bool PIR)
llvm::Type * getCoerceToType () const
void setCoerceToType (llvm::Type *T)
bool getInReg () const
void setInReg (bool IR)
unsigned getIndirectAlign () const
void setIndirectAlign (unsigned IA)
bool getIndirectByVal () const
void setIndirectByVal (unsigned 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.
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 (unsigned Alignment, bool ByVal=true, bool Realign=false, llvm::Type *Padding=nullptr)
static ABIArgInfo getIndirectInReg (unsigned 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 36 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 'direct', 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 38 of file CGFunctionInfo.h.


Constructor & Destructor Documentation

clang::CodeGen::ABIArgInfo::ABIArgInfo ( ) [inline]

Definition at line 96 of file CGFunctionInfo.h.

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


Member Function Documentation

void ABIArgInfo::dump ( ) const
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 
) [inline, static]

Definition at line 100 of file CGFunctionInfo.h.

References ABIArgInfo(), and Direct.

Referenced by getDirectInReg().

static ABIArgInfo clang::CodeGen::ABIArgInfo::getDirectInReg ( llvm::Type *  T = nullptr) [inline, static]

Definition at line 110 of file CGFunctionInfo.h.

References getDirect().

Definition at line 151 of file CGFunctionInfo.h.

References ABIArgInfo(), and Expand.

Referenced by getExpandWithPadding().

static ABIArgInfo clang::CodeGen::ABIArgInfo::getExpandWithPadding ( bool  PaddingInReg,
llvm::Type *  Padding 
) [inline, static]

Definition at line 154 of file CGFunctionInfo.h.

References getExpand().

static ABIArgInfo clang::CodeGen::ABIArgInfo::getExtend ( llvm::Type *  T = nullptr) [inline, static]

Definition at line 115 of file CGFunctionInfo.h.

References ABIArgInfo(), and Extend.

Referenced by getExtendInReg().

static ABIArgInfo clang::CodeGen::ABIArgInfo::getExtendInReg ( llvm::Type *  T = nullptr) [inline, static]

Definition at line 121 of file CGFunctionInfo.h.

References getExtend().

Definition at line 126 of file CGFunctionInfo.h.

References ABIArgInfo(), and Ignore.

static ABIArgInfo clang::CodeGen::ABIArgInfo::getInAlloca ( unsigned  FieldIndex) [inline, static]

Definition at line 146 of file CGFunctionInfo.h.

References ABIArgInfo(), and InAlloca.

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

Definition at line 261 of file CGFunctionInfo.h.

References isInAlloca().

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

static ABIArgInfo clang::CodeGen::ABIArgInfo::getIndirect ( unsigned  Alignment,
bool  ByVal = true,
bool  Realign = false,
llvm::Type *  Padding = nullptr 
) [inline, static]

Definition at line 129 of file CGFunctionInfo.h.

References ABIArgInfo(), and Indirect.

Referenced by getIndirectInReg().

static ABIArgInfo clang::CodeGen::ABIArgInfo::getIndirectInReg ( unsigned  Alignment,
bool  ByVal = true,
bool  Realign = false 
) [inline, static]

Definition at line 140 of file CGFunctionInfo.h.

References getIndirect().

Definition at line 232 of file CGFunctionInfo.h.

References isIndirect().

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

llvm::Type* clang::CodeGen::ABIArgInfo::getPaddingType ( ) const [inline]

Definition at line 168 of file CGFunctionInfo.h.

References Expand.

Definition at line 166 of file CGFunctionInfo.h.

References Ignore.

Definition at line 276 of file CGFunctionInfo.h.

References isDirect().

void clang::CodeGen::ABIArgInfo::setCoerceToType ( llvm::Type *  T) [inline]

Definition at line 177 of file CGFunctionInfo.h.

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

Definition at line 254 of file CGFunctionInfo.h.

References AllocaFieldIndex, and isInAlloca().

Definition at line 266 of file CGFunctionInfo.h.

References isInAlloca().

Definition at line 218 of file CGFunctionInfo.h.

References IndirectAlign, and isIndirect().

Definition at line 227 of file CGFunctionInfo.h.

References isIndirect().

Definition at line 236 of file CGFunctionInfo.h.

References isIndirect().

Definition at line 208 of file CGFunctionInfo.h.

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

Definition at line 189 of file CGFunctionInfo.h.

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

Definition at line 184 of file CGFunctionInfo.h.

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

Definition at line 245 of file CGFunctionInfo.h.

References isIndirect().


Member Data Documentation

Definition at line 81 of file CGFunctionInfo.h.

Referenced by getInAllocaFieldIndex(), and setInAllocaFieldIndex().

Definition at line 79 of file CGFunctionInfo.h.

Referenced by getDirectOffset(), and setDirectOffset().

Definition at line 80 of file CGFunctionInfo.h.

Referenced by getIndirectAlign(), and setIndirectAlign().


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