clang 8.0.0

Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
clang::CodeGen::CGFunctionInfo Class Referencefinal

CGFunctionInfo - Class to encapsulate the information about a function definition. More...

`#include "clang/CodeGen/CGFunctionInfo.h"`

Inheritance diagram for clang::CodeGen::CGFunctionInfo:
[legend]
Collaboration diagram for clang::CodeGen::CGFunctionInfo:
[legend]

## Public Types
typedef const ArgInfo * | const_arg_iterator
typedef ArgInfo * | arg_iterator
typedef llvm::iterator_range< arg_iterator > | arg_range
typedef llvm::iterator_range< const_arg_iterator > | const_arg_range

## Public Member Functions
void | operator delete (void *p)
size_t | numTrailingObjects (OverloadToken< ArgInfo >) const
size_t | numTrailingObjects (OverloadToken< ExtParameterInfo >) const
arg_range | arguments ()
const_arg_range | arguments () const
const_arg_iterator | arg_begin () const
const_arg_iterator | arg_end () const
arg_iterator | arg_begin ()
arg_iterator | arg_end ()
unsigned | arg_size () const
bool | isVariadic () const
RequiredArgs | getRequiredArgs () const
unsigned | getNumRequiredArgs () const
bool | isInstanceMethod () const
bool | isChainCall () const
bool | isNoReturn () const
bool | isReturnsRetained () const
| In ARC, whether this function retains its return value. More...
bool | isNoCallerSavedRegs () const
| Whether this function no longer saves caller registers. More...
bool | isNoCfCheck () const
| Whether this function has nocf_check attribute. More...
CallingConv | getASTCallingConvention () const
| getASTCallingConvention() - Return the AST-specified calling convention. More...
unsigned | getCallingConvention () const
| getCallingConvention - Return the user specified calling convention, which has been translated into an LLVM CC. More...
unsigned | getEffectiveCallingConvention () const
| getEffectiveCallingConvention - Return the actual calling convention to use, which may depend on the ABI. More...
void | setEffectiveCallingConvention (unsigned Value)
bool | getHasRegParm () const
unsigned | getRegParm () const
FunctionType::ExtInfo | getExtInfo () const
CanQualType | getReturnType () const
ABIArgInfo & | getReturnInfo ()
const ABIArgInfo & | getReturnInfo () const
ArrayRef< ExtParameterInfo > | getExtParameterInfos () const
ExtParameterInfo | getExtParameterInfo (unsigned argIndex) const
bool | usesInAlloca () const
| Return true if this function uses inalloca arguments. More...
llvm::StructType * | getArgStruct () const
| Get the struct type used to represent all the arguments in memory. More...
CharUnits | getArgStructAlignment () const
void | setArgStruct (llvm::StructType *Ty, CharUnits Align)
void | Profile (llvm::FoldingSetNodeID &ID)

## Static Public Member Functions
static CGFunctionInfo * | create (unsigned llvmCC, bool instanceMethod, bool chainCall, const FunctionType::ExtInfo &extInfo, ArrayRef< ExtParameterInfo > paramInfos, CanQualType resultType, ArrayRef< CanQualType > argTypes, RequiredArgs required)
static void | Profile (llvm::FoldingSetNodeID &ID, bool InstanceMethod, bool ChainCall, const FunctionType::ExtInfo &info, ArrayRef< ExtParameterInfo > paramInfos, RequiredArgs required, CanQualType resultType, ArrayRef< CanQualType > argTypes)

## Friends
class | TrailingObjects

## Detailed Description

CGFunctionInfo - Class to encapsulate the information about a function definition.

Definition at line 493 of file CGFunctionInfo.h.

## Member Typedef Documentation

## ◆ arg_iterator

typedef ArgInfo* clang::CodeGen::CGFunctionInfo::arg_iterator

Definition at line 581 of file CGFunctionInfo.h.

## ◆ arg_range

typedef llvm::iterator_range<arg_iterator> clang::CodeGen::CGFunctionInfo::arg_range

Definition at line 583 of file CGFunctionInfo.h.

## ◆ const_arg_iterator

typedef const ArgInfo* clang::CodeGen::CGFunctionInfo::const_arg_iterator

Definition at line 580 of file CGFunctionInfo.h.

## ◆ const_arg_range

typedef llvm::iterator_range<const_arg_iterator> clang::CodeGen::CGFunctionInfo::const_arg_range

Definition at line 584 of file CGFunctionInfo.h.

## Member Function Documentation

## ◆ arg_begin() [1/2]

const_arg_iterator clang::CodeGen::CGFunctionInfo::arg_begin | ( |  | ) | const
| inline

Definition at line 591 of file CGFunctionInfo.h.

Referenced by clang::CodeGen::swiftcall::computeABIInfo(), clang::CodeGen::CodeGenModule::ConstructAttributeList(), emitAddressAtOffset(), clang::CodeGen::CodeGenTypes::GetFunctionType(), GetX86_64ByValArgumentPair(), and isArgInAlloca().

## ◆ arg_begin() [2/2]

arg_iterator clang::CodeGen::CGFunctionInfo::arg_begin | ( |  | ) |
| inline

Definition at line 593 of file CGFunctionInfo.h.

## ◆ arg_end() [1/2]

const_arg_iterator clang::CodeGen::CGFunctionInfo::arg_end | ( |  | ) | const
| inline

Definition at line 592 of file CGFunctionInfo.h.

Referenced by clang::CodeGen::CodeGenModule::ConstructAttributeList(), emitAddressAtOffset(), GetX86_64ByValArgumentPair(), and isArgInAlloca().

## ◆ arg_end() [2/2]

arg_iterator clang::CodeGen::CGFunctionInfo::arg_end | ( |  | ) |
| inline

Definition at line 594 of file CGFunctionInfo.h.

## ◆ arg_size()

unsigned clang::CodeGen::CGFunctionInfo::arg_size | ( |  | ) | const
| inline

Definition at line 596 of file CGFunctionInfo.h.

Referenced by clang::CodeGen::CodeGenTypes::arrangeCall(), clang::CodeGen::swiftcall::computeABIInfo(), clang::CodeGen::CodeGenModule::ConstructAttributeList(), and emitAddressAtOffset().

## ◆ arguments() [1/2]

arg_range clang::CodeGen::CGFunctionInfo::arguments | ( |  | ) |
| inline

Definition at line 586 of file CGFunctionInfo.h.

Referenced by EmitX86_64VAArgFromMemory(), getTypeString(), and isRecordWithSSEVectorType().

## ◆ arguments() [2/2]

const_arg_range clang::CodeGen::CGFunctionInfo::arguments | ( |  | ) | const
| inline

Definition at line 587 of file CGFunctionInfo.h.

## ◆ create()

CGFunctionInfo * CGFunctionInfo::create | ( | unsigned | llvmCC,
|  | bool | instanceMethod,
|  | bool | chainCall,
|  | const FunctionType::ExtInfo & | extInfo,
|  | ArrayRef< ExtParameterInfo > | paramInfos,
|  | CanQualType | resultType,
|  | ArrayRef< CanQualType > | argTypes,
|  | RequiredArgs | required
| ) |  |
| static

Definition at line 802 of file CGCall.cpp.

References clang::classof(), clang::FunctionType::ExtInfo::getCC(), clang::FunctionType::ExtInfo::getHasRegParm(), clang::FunctionType::ExtInfo::getNoCallerSavedRegs(), clang::FunctionType::ExtInfo::getNoCfCheck(), clang::FunctionType::ExtInfo::getNoReturn(), clang::FunctionType::ExtInfo::getProducesResult(), clang::FunctionType::ExtInfo::getRegParm(), clang::CodeGen::TEK_Complex, and clang::CodeGen::CGFunctionInfoArgInfo::type.

Referenced by clang::CodeGen::CodeGenTypes::arrangeLLVMFunctionInfo().

## ◆ getArgStruct()

llvm::StructType* clang::CodeGen::CGFunctionInfo::getArgStruct | ( |  | ) | const
| inline

Get the struct type used to represent all the arguments in memory.

Definition at line 667 of file CGFunctionInfo.h.

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

## ◆ getArgStructAlignment()

CharUnits clang::CodeGen::CGFunctionInfo::getArgStructAlignment | ( |  | ) | const
| inline

Definition at line 668 of file CGFunctionInfo.h.

References clang::CharUnits::fromQuantity().

Referenced by clang::CodeGen::CodeGenFunction::EmitCall().

## ◆ getASTCallingConvention()

CallingConv clang::CodeGen::CGFunctionInfo::getASTCallingConvention | ( |  | ) | const
| inline

getASTCallingConvention() - Return the AST-specified calling convention.

Definition at line 622 of file CGFunctionInfo.h.

## ◆ getCallingConvention()

unsigned clang::CodeGen::CGFunctionInfo::getCallingConvention | ( |  | ) | const
| inline

getCallingConvention - Return the user specified calling convention, which has been translated into an LLVM CC.

Definition at line 628 of file CGFunctionInfo.h.

Referenced by EmitX86_64VAArgFromMemory(), GetX86_64ByValArgumentPair(), isArgInAlloca(), and isRecordWithSSEVectorType().

## ◆ getEffectiveCallingConvention()

unsigned clang::CodeGen::CGFunctionInfo::getEffectiveCallingConvention | ( |  | ) | const
| inline

getEffectiveCallingConvention - Return the actual calling convention to use, which may depend on the ABI.

Definition at line 632 of file CGFunctionInfo.h.

Referenced by clang::CodeGen::CodeGenModule::ConstructAttributeList(), and emitCXXDestructor().

## ◆ getExtInfo()

FunctionType::ExtInfo clang::CodeGen::CGFunctionInfo::getExtInfo | ( |  | ) | const
| inline

Definition at line 642 of file CGFunctionInfo.h.

Referenced by clang::CodeGen::CodeGenTypes::arrangeCall().

## ◆ getExtParameterInfo()

ExtParameterInfo clang::CodeGen::CGFunctionInfo::getExtParameterInfo | ( | unsigned | argIndex | ) | const
| inline

Definition at line 657 of file CGFunctionInfo.h.

Referenced by clang::CodeGen::CodeGenModule::ConstructAttributeList().

## ◆ getExtParameterInfos()

ArrayRef<ExtParameterInfo> clang::CodeGen::CGFunctionInfo::getExtParameterInfos | ( |  | ) | const
| inline

Definition at line 653 of file CGFunctionInfo.h.

Referenced by clang::CodeGen::CodeGenTypes::arrangeCall().

## ◆ getHasRegParm()

bool clang::CodeGen::CGFunctionInfo::getHasRegParm | ( |  | ) | const
| inline

Definition at line 639 of file CGFunctionInfo.h.

Referenced by isRecordWithSSEVectorType().

## ◆ getNumRequiredArgs()

unsigned clang::CodeGen::CGFunctionInfo::getNumRequiredArgs | ( |  | ) | const
| inline

Definition at line 600 of file CGFunctionInfo.h.

Referenced by emitAddressAtOffset(), clang::CodeGen::CodeGenTypes::GetFunctionType(), getTypeString(), and GetX86_64ByValArgumentPair().

## ◆ getRegParm()

unsigned clang::CodeGen::CGFunctionInfo::getRegParm | ( |  | ) | const
| inline

Definition at line 640 of file CGFunctionInfo.h.

Referenced by isRecordWithSSEVectorType().

## ◆ getRequiredArgs()

RequiredArgs clang::CodeGen::CGFunctionInfo::getRequiredArgs | ( |  | ) | const
| inline

Definition at line 599 of file CGFunctionInfo.h.

Referenced by clang::CodeGen::CodeGenTypes::arrangeCall().

## ◆ getReturnInfo() [1/2]

ABIArgInfo& clang::CodeGen::CGFunctionInfo::getReturnInfo | ( |  | ) |
| inline

Definition at line 650 of file CGFunctionInfo.h.

Referenced by classifyReturnType(), clang::CodeGen::swiftcall::computeABIInfo(), clang::CodeGen::CodeGenModule::ConstructAttributeList(), emitAddressAtOffset(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitForwardingCallToLambda(), EmitX86_64VAArgFromMemory(), clang::CodeGen::CodeGenTypes::GetFunctionType(), getTypeString(), GetX86_64ByValArgumentPair(), isArgInAlloca(), isDeletingDtor(), isRecordWithSSEVectorType(), clang::CodeGen::CodeGenModule::ReturnTypeUsesSRet(), and clang::CodeGen::CodeGenFunction::StartFunction().

## ◆ getReturnInfo() [2/2]

const ABIArgInfo& clang::CodeGen::CGFunctionInfo::getReturnInfo | ( |  | ) | const
| inline

Definition at line 651 of file CGFunctionInfo.h.

## ◆ getReturnType()

CanQualType clang::CodeGen::CGFunctionInfo::getReturnType | ( |  | ) | const
| inline

Definition at line 648 of file CGFunctionInfo.h.

Referenced by clang::CodeGen::CodeGenTypes::arrangeCall(), classifyReturnType(), clang::CodeGen::swiftcall::computeABIInfo(), clang::CodeGen::CodeGenModule::ConstructAttributeList(), clang::CodeGen::CodeGenFunction::EmitCall(), emitCXXDestructor(), clang::CodeGen::CodeGenFunction::EmitForwardingCallToLambda(), EmitX86_64VAArgFromMemory(), clang::CodeGen::CodeGenTypes::GetFunctionType(), getTypeString(), GetX86_64ByValArgumentPair(), isArgInAlloca(), isDeletingDtor(), isRecordWithSSEVectorType(), and clang::CodeGen::CodeGenFunction::StartFunction().

## ◆ isChainCall()

bool clang::CodeGen::CGFunctionInfo::isChainCall | ( |  | ) | const
| inline

Definition at line 606 of file CGFunctionInfo.h.

Referenced by clang::CodeGen::CodeGenTypes::arrangeCall(), clang::CodeGen::CodeGenModule::ConstructAttributeList(), GetX86_64ByValArgumentPair(), and isRecordWithSSEVectorType().

## ◆ isInstanceMethod()

bool clang::CodeGen::CGFunctionInfo::isInstanceMethod | ( |  | ) | const
| inline

Definition at line 604 of file CGFunctionInfo.h.

Referenced by clang::CodeGen::CodeGenTypes::arrangeCall(), and isDeletingDtor().

## ◆ isNoCallerSavedRegs()

bool clang::CodeGen::CGFunctionInfo::isNoCallerSavedRegs | ( |  | ) | const
| inline

Whether this function no longer saves caller registers.

Definition at line 615 of file CGFunctionInfo.h.

## ◆ isNoCfCheck()

bool clang::CodeGen::CGFunctionInfo::isNoCfCheck | ( |  | ) | const
| inline

Whether this function has nocf_check attribute.

Definition at line 618 of file CGFunctionInfo.h.

## ◆ isNoReturn()

bool clang::CodeGen::CGFunctionInfo::isNoReturn | ( |  | ) | const
| inline

Definition at line 608 of file CGFunctionInfo.h.

Referenced by clang::CodeGen::CodeGenModule::ConstructAttributeList(), and clang::CodeGen::CodeGenFunction::EmitFunctionEpilog().

## ◆ isReturnsRetained()

bool clang::CodeGen::CGFunctionInfo::isReturnsRetained | ( |  | ) | const
| inline

In ARC, whether this function retains its return value.

This is not always reliable for call sites.

Definition at line 612 of file CGFunctionInfo.h.

Referenced by clang::CodeGen::CodeGenFunction::StartFunction().

## ◆ isVariadic()

bool clang::CodeGen::CGFunctionInfo::isVariadic | ( |  | ) | const
| inline

Definition at line 598 of file CGFunctionInfo.h.

References clang::CodeGen::RequiredArgs::allowsOptionalArgs().

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

## ◆ numTrailingObjects() [1/2]

size_t clang::CodeGen::CGFunctionInfo::numTrailingObjects | ( | OverloadToken< ArgInfo > |  | ) | const
| inline

Definition at line 573 of file CGFunctionInfo.h.

## ◆ numTrailingObjects() [2/2]

size_t clang::CodeGen::CGFunctionInfo::numTrailingObjects | ( | OverloadToken< ExtParameterInfo > |  | ) | const
| inline

Definition at line 576 of file CGFunctionInfo.h.

## ◆ operator delete()

void clang::CodeGen::CGFunctionInfo::operator delete | ( | void * | p | ) |
| inline

Definition at line 568 of file CGFunctionInfo.h.

## ◆ Profile() [1/2]

void clang::CodeGen::CGFunctionInfo::Profile | ( | llvm::FoldingSetNodeID & | ID | ) |
| inline

Definition at line 676 of file CGFunctionInfo.h.

References clang::CodeGen::RequiredArgs::getOpaqueData().

Referenced by clang::CodeGen::CodeGenTypes::arrangeLLVMFunctionInfo().

## ◆ Profile() [2/2]

static void clang::CodeGen::CGFunctionInfo::Profile | ( | llvm::FoldingSetNodeID & | ID,
|  | bool | InstanceMethod,
|  | bool | ChainCall,
|  | const FunctionType::ExtInfo & | info,
|  | ArrayRef< ExtParameterInfo > | paramInfos,
|  | RequiredArgs | required,
|  | CanQualType | resultType,
|  | ArrayRef< CanQualType > | argTypes
| ) |  |
| inline static

Definition at line 696 of file CGFunctionInfo.h.

References clang::FunctionType::ExtInfo::getCC(), clang::FunctionType::ExtInfo::getHasRegParm(), clang::FunctionType::ExtInfo::getNoCallerSavedRegs(), clang::FunctionType::ExtInfo::getNoCfCheck(), clang::FunctionType::ExtInfo::getNoReturn(), clang::CodeGen::RequiredArgs::getOpaqueData(), clang::FunctionType::ExtInfo::getProducesResult(), clang::FunctionType::ExtInfo::getRegParm(), and clang::CanQual< T >::Profile().

## ◆ setArgStruct()

void clang::CodeGen::CGFunctionInfo::setArgStruct | ( | llvm::StructType * | Ty,
|  | CharUnits | Align
| ) |  |
| inline

Definition at line 671 of file CGFunctionInfo.h.

References clang::CharUnits::getQuantity().

Referenced by isArgInAlloca().

## ◆ setEffectiveCallingConvention()

void clang::CodeGen::CGFunctionInfo::setEffectiveCallingConvention | ( | unsigned | Value | ) |
| inline

Definition at line 635 of file CGFunctionInfo.h.

## ◆ usesInAlloca()

bool clang::CodeGen::CGFunctionInfo::usesInAlloca | ( |  | ) | const
| inline

Return true if this function uses inalloca arguments.

Definition at line 664 of file CGFunctionInfo.h.

Referenced by canEmitDelegateCallArgs(), and emitAddressAtOffset().

## Friends And Related Function Documentation

## ◆ TrailingObjects

friend class TrailingObjects
| friend

Definition at line 572 of file CGFunctionInfo.h.

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

- include/clang/CodeGen/CGFunctionInfo.h
- lib/CodeGen/CGCall.cpp