clang 24.0.0git
CGCall.cpp File Reference
#include "CGCall.h"
#include "ABIInfo.h"
#include "ABIInfoImpl.h"
#include "CGBlocks.h"
#include "CGCXXABI.h"
#include "CGCleanup.h"
#include "CGDebugInfo.h"
#include "CGRecordLayout.h"
#include "CodeGenFunction.h"
#include "CodeGenModule.h"
#include "CodeGenPGO.h"
#include "QualTypeMapper.h"
#include "TargetInfo.h"
#include "clang/AST/Attr.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/RecordLayout.h"
#include "clang/Basic/CodeGenOptions.h"
#include "clang/Basic/DiagnosticFrontend.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/CodeGen/CGFunctionInfo.h"
#include "clang/CodeGen/SwiftCallingConv.h"
#include "clang/CodeGenUtils/CallUtils.h"
#include "llvm/ABI/FunctionInfo.h"
#include "llvm/ABI/IRTypeMapper.h"
#include "llvm/ABI/TargetInfo.h"
#include "llvm/ABI/Types.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/Assumptions.h"
#include "llvm/IR/AttributeMask.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/CallingConv.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/IR/InlineAsm.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/Type.h"
#include "llvm/Transforms/Utils/Local.h"
#include <optional>

Go to the source code of this file.

Namespaces

namespace  clang
 Top level wrappers for InstallAPI frontend operations.
namespace  clang::CodeGen

Macros

#define CC_VLS_CASE(ABI_VLEN)
#define CC_VLS_CASE(ABI_VLEN)

Typedefs

using ExtParameterInfoList
using CanQualTypeList = SmallVector<CanQualType, 16>

Functions

static CanQualType GetReturnType (QualType RetTy)
 Returns the "extra-canonicalized" return type, which discards qualifiers on the return type.
static void addExtParameterInfosForCall (llvm::SmallVectorImpl< FunctionProtoType::ExtParameterInfo > &paramInfos, const FunctionProtoType *proto, unsigned prefixArgs, unsigned totalArgs)
static void appendParameterTypes (const CodeGenTypes &CGT, SmallVectorImpl< CanQualType > &prefix, SmallVectorImpl< FunctionProtoType::ExtParameterInfo > &paramInfos, CanQual< FunctionProtoType > FPT)
 Adds the formal parameters in FPT to the given prefix.
static const CGFunctionInfo & arrangeLLVMFunctionInfo (CodeGenTypes &CGT, bool instanceMethod, SmallVectorImpl< CanQualType > &prefix, CanQual< FunctionProtoType > FTP)
 Arrange the LLVM function layout for a value of the given function type, on top of any implicit parameters already stored.
static CallingConv getCallingConventionForDecl (const ObjCMethodDecl *D, bool IsTargetDefaultMSABI)
static SmallVector< unsigned, 4 > getGridConstantArgs (CodeGenModule &CGM, const FunctionDecl *FD, unsigned PrefixArgs)
 Collect grid-constant argument indices separately from the source function type, so functions with different grid-constant parameters do not share ABI information.
static void setCUDAKernelCallingConvention (CanQualType &FTy, CodeGenModule &CGM, const FunctionDecl *FD)
 Set calling convention for CUDA/HIP kernel.
static CanQualTypeList getArgTypesForCall (ASTContext &ctx, const CallArgList &args)
static CanQualTypeList getArgTypesForDeclaration (ASTContext &ctx, const FunctionArgList &args)
static ExtParameterInfoList getExtParameterInfosForCall (const FunctionProtoType *proto, unsigned prefixArgs, unsigned totalArgs)
static const CGFunctionInfo & arrangeFreeFunctionLikeCall (CodeGenTypes &CGT, CodeGenModule &CGM, const CallArgList &args, const FunctionType *fnType, unsigned numExtraRequiredArgs, bool chainCall, const FunctionDecl *ABIInfoFD)
 Arrange a call as unto a free function, except possibly with an additional number of formal parameters considered required.
void clang::CodeGen::computeSPIRKernelABIInfo (CodeGenModule &CGM, CGFunctionInfo &FI)
static const char * abiKindToString (ABIArgInfo::Kind K)
static std::unique_ptr< TypeExpansion > getTypeExpansion (QualType Ty, const ASTContext &Context)
static int getExpansionSize (QualType Ty, const ASTContext &Context)
static void forConstantArrayExpansion (CodeGenFunction &CGF, ConstantArrayExpansion *CAE, Address BaseAddr, llvm::function_ref< void(Address)> Fn)
static RawAddress CreateTempAllocaForCoercion (CodeGenFunction &CGF, llvm::Type *Ty, CharUnits MinAlign, const Twine &Name="tmp")
 Create a temporary allocation for the purposes of coercion.
static Address EnterStructPointerForCoercedAccess (Address SrcPtr, llvm::StructType *SrcSTy, uint64_t DstSize, CodeGenFunction &CGF)
 EnterStructPointerForCoercedAccess - Given a struct pointer that we are accessing some number of bytes out of it, try to gep into the struct to get at its inner goodness.
static llvm::Value * CoerceIntOrPtrToIntOrPtr (llvm::Value *Val, llvm::Type *Ty, CodeGenFunction &CGF)
 CoerceIntOrPtrToIntOrPtr - Convert a value Val to the specific Ty where both are either integers or pointers.
static llvm::Value * CreatePFPCoercedLoad (Address Src, QualType SrcFETy, llvm::Type *Ty, CodeGenFunction &CGF)
static llvm::Value * CreateCoercedLoad (Address Src, QualType SrcFETy, llvm::Type *Ty, CodeGenFunction &CGF)
 CreateCoercedLoad - Create a load from.
static bool CreatePFPCoercedStore (llvm::Value *Src, QualType SrcFETy, Address Dst, CodeGenFunction &CGF)
static Address emitAddressAtOffset (CodeGenFunction &CGF, Address addr, const ABIArgInfo &info)
static std::pair< llvm::Value *, bool > CoerceScalableToFixed (CodeGenFunction &CGF, llvm::FixedVectorType *ToTy, llvm::ScalableVectorType *FromTy, llvm::Value *V, StringRef Name="")
static void AddAttributesFromFunctionProtoType (ASTContext &Ctx, llvm::AttrBuilder &FuncAttrs, const FunctionProtoType *FPT)
static void AddAttributesFromOMPAssumes (llvm::AttrBuilder &FuncAttrs, const Decl *Callee)
static bool HasStrictReturn (const CodeGenModule &Module, QualType RetTy, const Decl *TargetDecl)
static void addDenormalModeAttrs (llvm::DenormalMode FPDenormalMode, llvm::DenormalMode FP32DenormalMode, llvm::AttrBuilder &FuncAttrs)
 Add denormal-fp-math and denormal-fp-math-f32 as appropriate for the requested denormal behavior, accounting for the overriding behavior of the -f32 case.
static void addMergableDefaultFunctionAttributes (const CodeGenOptions &CodeGenOpts, llvm::AttrBuilder &FuncAttrs)
 Add default attributes to a function, which have merge semantics under -mlink-builtin-bitcode and should not simply overwrite any existing attributes in the linked library.
static void addZeroCallUsedRegsAttr (const CodeGenOptions &CodeGenOpts, llvm::AttrBuilder &FuncAttrs)
static void getTrivialDefaultFunctionAttributes (StringRef Name, bool HasOptnone, const CodeGenOptions &CodeGenOpts, const LangOptions &LangOpts, bool AttrOnCallSite, llvm::AttrBuilder &FuncAttrs)
static void overrideFunctionFeaturesWithTargetFeatures (llvm::AttrBuilder &FuncAttr, const llvm::Function &F, const TargetOptions &TargetOpts)
 Merges target-features from \TargetOpts and \F, and sets the result in \FuncAttr.
static void addNoBuiltinAttributes (llvm::AttrBuilder &FuncAttrs, const LangOptions &LangOpts, const NoBuiltinAttr *NBA=nullptr)
static bool DetermineNoUndef (QualType QTy, CodeGenTypes &Types, const llvm::DataLayout &DL, const ABIArgInfo &AI, bool CheckCoerce=true)
static bool canApplyNoFPClass (const ABIArgInfo &AI, QualType ParamType, bool IsReturn)
 Test if it's legal to apply nofpclass for the given parameter type and it's lowered IR type.
static llvm::Value * emitArgumentDemotion (CodeGenFunction &CGF, const VarDecl *var, llvm::Value *value)
 An argument came in as a promoted argument; demote it back to its declared type.
static const NonNullAttr * getNonNullAttr (const Decl *FD, const ParmVarDecl *PVD, QualType ArgType, unsigned ArgNo)
 Returns the attribute (either parameter attribute, or function attribute), which declares argument ArgNo to be non-null.
static void eraseUnusedBitCasts (llvm::Instruction *insn)
static llvm::Value * tryEmitFusedAutoreleaseOfResult (CodeGenFunction &CGF, llvm::Value *result)
 Try to emit a fused autorelease of a return result.
static llvm::Value * tryRemoveRetainOfSelf (CodeGenFunction &CGF, llvm::Value *result)
 If this is a +1 of the value of an immutable 'self', remove it.
static llvm::Value * emitAutoreleaseOfResult (CodeGenFunction &CGF, llvm::Value *result)
 Emit an ARC autorelease of the result of a function.
static llvm::StoreInst * findDominatingStoreToReturnValue (CodeGenFunction &CGF)
 Heuristically search for a dominating store to the return-value slot.
static void setBitRange (SmallVectorImpl< uint64_t > &Bits, int BitOffset, int BitWidth, int CharWidth)
static void setBitRange (SmallVectorImpl< uint64_t > &Bits, int StorageOffset, int StorageSize, int BitOffset, int BitWidth, int CharWidth, bool BigEndian)
static void setUsedBits (CodeGenModule &, QualType, int, SmallVectorImpl< uint64_t > &)
static void setUsedBits (CodeGenModule &CGM, const RecordType *RTy, int Offset, SmallVectorImpl< uint64_t > &Bits)
static void setUsedBits (CodeGenModule &CGM, const ConstantArrayType *ATy, int Offset, SmallVectorImpl< uint64_t > &Bits)
static uint64_t buildMultiCharMask (const SmallVectorImpl< uint64_t > &Bits, int Pos, int Size, int CharWidth, bool BigEndian)
static bool isInAllocaArgument (CGCXXABI &ABI, QualType type)
static AggValueSlot createPlaceholderSlot (CodeGenFunction &CGF, QualType Ty)
static bool isProvablyNull (llvm::Value *addr)
static bool isProvablyNonNull (Address Addr, CodeGenFunction &CGF)
static void emitWriteback (CodeGenFunction &CGF, const CallArgList::Writeback &writeback)
 Emit the actual writing-back of a writeback.
static void deactivateArgCleanupsBeforeCall (CodeGenFunction &CGF, const CallArgList &CallArgs)
static const Expr * maybeGetUnaryAddrOfOperand (const Expr *E)
static void emitWritebackArg (CodeGenFunction &CGF, CallArgList &args, const ObjCIndirectCopyRestoreExpr *CRE)
 Emit an argument that's being passed call-by-writeback.
static bool hasInAllocaArgs (CodeGenModule &CGM, CallingConv ExplicitCC, ArrayRef< QualType > ArgTypes)
static bool isObjCMethodWithTypeParams (const ObjCMethodDecl *method)
static bool isConvergentIntrinsic (const llvm::Function *F)
static unsigned getMaxVectorWidth (const llvm::Type *Ty)

Macro Definition Documentation

◆ CC_VLS_CASE [1/2]

#define CC_VLS_CASE ( ABI_VLEN)
Value:
case CC_RISCVVLSCall_##ABI_VLEN: \
return llvm::CallingConv::RISCV_VLSCall_##ABI_VLEN;

◆ CC_VLS_CASE [2/2]

#define CC_VLS_CASE ( ABI_VLEN)
Value:
case ABI_VLEN: \
return CC_RISCVVLSCall_##ABI_VLEN;

Typedef Documentation

◆ CanQualTypeList

Definition at line 252 of file CGCall.cpp.

◆ ExtParameterInfoList

Function Documentation

◆ abiKindToString()

◆ AddAttributesFromFunctionProtoType()

◆ AddAttributesFromOMPAssumes()

void AddAttributesFromOMPAssumes ( llvm::AttrBuilder & FuncAttrs,
const Decl * Callee )
static

Definition at line 2312 of file CGCall.cpp.

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

◆ addDenormalModeAttrs()

void addDenormalModeAttrs ( llvm::DenormalMode FPDenormalMode,
llvm::DenormalMode FP32DenormalMode,
llvm::AttrBuilder & FuncAttrs )
static

Add denormal-fp-math and denormal-fp-math-f32 as appropriate for the requested denormal behavior, accounting for the overriding behavior of the -f32 case.

Definition at line 2374 of file CGCall.cpp.

◆ addExtParameterInfosForCall()

◆ addMergableDefaultFunctionAttributes()

void addMergableDefaultFunctionAttributes ( const CodeGenOptions & CodeGenOpts,
llvm::AttrBuilder & FuncAttrs )
static

Add default attributes to a function, which have merge semantics under -mlink-builtin-bitcode and should not simply overwrite any existing attributes in the linked library.

Definition at line 2386 of file CGCall.cpp.

References addDenormalModeAttrs(), clang::CodeGenOptions::FP32DenormalMode, and clang::CodeGenOptions::FPDenormalMode.

◆ addNoBuiltinAttributes()

void addNoBuiltinAttributes ( llvm::AttrBuilder & FuncAttrs,
const LangOptions & LangOpts,
const NoBuiltinAttr * NBA = nullptr )
static

Definition at line 2650 of file CGCall.cpp.

References clang::LangOptions::NoBuiltinFuncs.

◆ addZeroCallUsedRegsAttr()

void addZeroCallUsedRegsAttr ( const CodeGenOptions & CodeGenOpts,
llvm::AttrBuilder & FuncAttrs )
static

◆ appendParameterTypes()

void appendParameterTypes ( const CodeGenTypes & CGT,
SmallVectorImpl< CanQualType > & prefix,
SmallVectorImpl< FunctionProtoType::ExtParameterInfo > & paramInfos,
CanQual< FunctionProtoType > FPT )
static

Adds the formal parameters in FPT to the given prefix.

If any parameter in FPT has pass_object_size attrs, then we'll add parameters for those, too.

Definition at line 201 of file CGCall.cpp.

References addExtParameterInfosForCall(), clang::ASTContext::getCanonicalSizeType(), clang::CodeGen::CodeGenTypes::getContext(), and clang::CanQual< T >::getTypePtr().

◆ arrangeFreeFunctionLikeCall()

◆ arrangeLLVMFunctionInfo()

const CGFunctionInfo & arrangeLLVMFunctionInfo ( CodeGenTypes & CGT,
bool instanceMethod,
SmallVectorImpl< CanQualType > & prefix,
CanQual< FunctionProtoType > FTP )
static

Arrange the LLVM function layout for a value of the given function type, on top of any implicit parameters already stored.

Definition at line 237 of file CGCall.cpp.

References appendParameterTypes(), clang::CodeGen::CodeGenTypes::arrangeLLVMFunctionInfo(), clang::CodeGen::RequiredArgs::forPrototypePlus(), clang::CanQual< T >::getUnqualifiedType(), clang::CodeGen::IsInstanceMethod, clang::CodeGen::None, and clang::Required.

◆ buildMultiCharMask()

uint64_t buildMultiCharMask ( const SmallVectorImpl< uint64_t > & Bits,
int Pos,
int Size,
int CharWidth,
bool BigEndian )
static

◆ canApplyNoFPClass()

bool canApplyNoFPClass ( const ABIArgInfo & AI,
QualType ParamType,
bool IsReturn )
static

Test if it's legal to apply nofpclass for the given parameter type and it's lowered IR type.

Definition at line 2738 of file CGCall.cpp.

References clang::CodeGen::ABIArgInfo::getCanBeFlattened(), clang::CodeGen::ABIArgInfo::getCoerceToType(), and clang::Type::hasFloatingRepresentation().

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

◆ CoerceIntOrPtrToIntOrPtr()

llvm::Value * CoerceIntOrPtrToIntOrPtr ( llvm::Value * Val,
llvm::Type * Ty,
CodeGenFunction & CGF )
static

CoerceIntOrPtrToIntOrPtr - Convert a value Val to the specific Ty where both are either integers or pointers.

This does a truncation of the value if it is too large or a zero extension if it is too small.

This behaves as if the value were coerced through memory, so on big-endian targets the high bits are preserved in a truncation, while little-endian targets preserve the low bits.

Definition at line 1605 of file CGCall.cpp.

References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenModule::getDataLayout(), clang::CodeGen::CodeGenTypeCache::IntPtrTy, clang::isa(), and uint64_t.

Referenced by CreateCoercedLoad(), and clang::CodeGen::CodeGenFunction::CreateCoercedStore().

◆ CoerceScalableToFixed()

std::pair< llvm::Value *, bool > CoerceScalableToFixed ( CodeGenFunction & CGF,
llvm::FixedVectorType * ToTy,
llvm::ScalableVectorType * FromTy,
llvm::Value * V,
StringRef Name = "" )
static

◆ CreateCoercedLoad()

◆ CreatePFPCoercedLoad()

◆ CreatePFPCoercedStore()

◆ createPlaceholderSlot()

◆ CreateTempAllocaForCoercion()

RawAddress CreateTempAllocaForCoercion ( CodeGenFunction & CGF,
llvm::Type * Ty,
CharUnits MinAlign,
const Twine & Name = "tmp" )
static

◆ deactivateArgCleanupsBeforeCall()

void deactivateArgCleanupsBeforeCall ( CodeGenFunction & CGF,
const CallArgList & CallArgs )
static

◆ DetermineNoUndef()

◆ emitAddressAtOffset()

◆ emitArgumentDemotion()

llvm::Value * emitArgumentDemotion ( CodeGenFunction & CGF,
const VarDecl * var,
llvm::Value * value )
static

An argument came in as a promoted argument; demote it back to its declared type.

Definition at line 3486 of file CGCall.cpp.

References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::ConvertType(), and clang::isa().

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

◆ emitAutoreleaseOfResult()

llvm::Value * emitAutoreleaseOfResult ( CodeGenFunction & CGF,
llvm::Value * result )
static

Emit an ARC autorelease of the result of a function.

Returns
the value to actually return from the function

Definition at line 4165 of file CGCall.cpp.

References clang::CodeGen::CodeGenFunction::EmitARCAutoreleaseReturnValue(), clang::CodeGen::CodeGenFunction::shouldUseFusedARCCalls(), tryEmitFusedAutoreleaseOfResult(), and tryRemoveRetainOfSelf().

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

◆ emitWriteback()

◆ emitWritebackArg()

void emitWritebackArg ( CodeGenFunction & CGF,
CallArgList & args,
const ObjCIndirectCopyRestoreExpr * CRE )
static

Emit an argument that's being passed call-by-writeback.

That is, we are passing the address of an __autoreleased temporary; it might be copy-initialized with the current value of the given address, but it will definitely be copied out of after the call.

Definition at line 4922 of file CGCall.cpp.

References clang::CodeGen::CallArgList::add(), clang::CodeGen::CallArgList::addWriteback(), clang::CodeGen::CodeGenFunction::ConditionalEvaluation::begin(), clang::CodeGen::CodeGenFunction::Builder, clang::cast(), clang::Type::castAs(), clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::ConvertType(), clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::CGBuilderTy::CreateIsNull(), clang::CodeGen::CGBuilderTy::CreateStore(), clang::CodeGen::CodeGenFunction::CreateTempAlloca(), clang::CodeGen::CodeGenFunction::EmitBlock(), clang::CodeGen::CodeGenFunction::EmitLoadOfLValue(), clang::CodeGen::CodeGenFunction::EmitLValue(), clang::CodeGen::CodeGenFunction::EmitPointerWithAlignment(), clang::CodeGen::Address::emitRawPointer(), clang::CodeGen::CodeGenFunction::ConditionalEvaluation::end(), clang::CodeGen::RValue::get(), clang::CodeGen::Address::getBasePointer(), clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::Type::getPointeeType(), getPointeeType(), clang::CodeGen::CodeGenTypeCache::getPointerAlign(), clang::CodeGen::RValue::getScalarVal(), clang::ObjCIndirectCopyRestoreExpr::getSubExpr(), clang::Expr::getType(), isProvablyNonNull(), isProvablyNull(), clang::CodeGen::RValue::isScalar(), clang::CodeGen::CodeGenFunction::MakeAddrLValue(), maybeGetUnaryAddrOfOperand(), clang::Qualifiers::OCL_Strong, and clang::ObjCIndirectCopyRestoreExpr::shouldCopy().

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

◆ EnterStructPointerForCoercedAccess()

Address EnterStructPointerForCoercedAccess ( Address SrcPtr,
llvm::StructType * SrcSTy,
uint64_t DstSize,
CodeGenFunction & CGF )
static

EnterStructPointerForCoercedAccess - Given a struct pointer that we are accessing some number of bytes out of it, try to gep into the struct to get at its inner goodness.

Dive as deep as possible without entering an element with an in-memory size smaller than DstSize.

Definition at line 1568 of file CGCall.cpp.

References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CGBuilderTy::CreateStructGEP(), EnterStructPointerForCoercedAccess(), clang::CodeGen::CodeGenModule::getDataLayout(), clang::CodeGen::Address::getElementType(), and uint64_t.

Referenced by CreateCoercedLoad(), clang::CodeGen::CodeGenFunction::CreateCoercedStore(), and EnterStructPointerForCoercedAccess().

◆ eraseUnusedBitCasts()

void eraseUnusedBitCasts ( llvm::Instruction * insn)
static

Definition at line 4019 of file CGCall.cpp.

References clang::cast().

Referenced by tryRemoveRetainOfSelf().

◆ findDominatingStoreToReturnValue()

◆ forConstantArrayExpansion()

void forConstantArrayExpansion ( CodeGenFunction & CGF,
ConstantArrayExpansion * CAE,
Address BaseAddr,
llvm::function_ref< void(Address)> Fn )
static

◆ getArgTypesForCall()

◆ getArgTypesForDeclaration()

◆ getCallingConventionForDecl()

◆ getExpansionSize()

int getExpansionSize ( QualType Ty,
const ASTContext & Context )
static

Definition at line 1392 of file CGCall.cpp.

References getExpansionSize(), getTypeExpansion(), and clang::isa().

Referenced by getExpansionSize().

◆ getExtParameterInfosForCall()

◆ getGridConstantArgs()

SmallVector< unsigned, 4 > getGridConstantArgs ( CodeGenModule & CGM,
const FunctionDecl * FD,
unsigned PrefixArgs )
static

Collect grid-constant argument indices separately from the source function type, so functions with different grid-constant parameters do not share ABI information.

Host stubs retain their normal argument classification.

Definition at line 349 of file CGCall.cpp.

References clang::CodeGen::CodeGenModule::getLangOpts(), clang::CodeGen::CodeGenModule::getTarget(), clang::TargetInfo::getTriple(), clang::Decl::hasAttr(), and clang::FunctionDecl::parameters().

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

◆ getMaxVectorWidth()

unsigned getMaxVectorWidth ( const llvm::Type * Ty)
static

Definition at line 5782 of file CGCall.cpp.

References getMaxVectorWidth().

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

◆ getNonNullAttr()

const NonNullAttr * getNonNullAttr ( const Decl * FD,
const ParmVarDecl * PVD,
QualType ArgType,
unsigned ArgNo )
static

Returns the attribute (either parameter attribute, or function attribute), which declares argument ArgNo to be non-null.

Definition at line 3507 of file CGCall.cpp.

References clang::Decl::getAttr(), and clang::Decl::specific_attrs().

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

◆ GetReturnType()

◆ getTrivialDefaultFunctionAttributes()

◆ getTypeExpansion()

std::unique_ptr< TypeExpansion > getTypeExpansion ( QualType Ty,
const ASTContext & Context )
static

◆ hasInAllocaArgs()

◆ HasStrictReturn()

bool HasStrictReturn ( const CodeGenModule & Module,
QualType RetTy,
const Decl * TargetDecl )
static

Definition at line 2339 of file CGCall.cpp.

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

◆ isConvergentIntrinsic()

bool isConvergentIntrinsic ( const llvm::Function * F)
static

Definition at line 5527 of file CGCall.cpp.

◆ isInAllocaArgument()

bool isInAllocaArgument ( CGCXXABI & ABI,
QualType type )
static

◆ isObjCMethodWithTypeParams()

bool isObjCMethodWithTypeParams ( const ObjCMethodDecl * method)
static

Definition at line 5144 of file CGCall.cpp.

References clang::Decl::getDeclContext().

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

◆ isProvablyNonNull()

bool isProvablyNonNull ( Address Addr,
CodeGenFunction & CGF )
static

◆ isProvablyNull()

bool isProvablyNull ( llvm::Value * addr)
static

Definition at line 4820 of file CGCall.cpp.

Referenced by emitWriteback(), and emitWritebackArg().

◆ maybeGetUnaryAddrOfOperand()

const Expr * maybeGetUnaryAddrOfOperand ( const Expr * E)
static

Definition at line 4911 of file CGCall.cpp.

References clang::Expr::IgnoreParens().

Referenced by emitWritebackArg().

◆ overrideFunctionFeaturesWithTargetFeatures()

void overrideFunctionFeaturesWithTargetFeatures ( llvm::AttrBuilder & FuncAttr,
const llvm::Function & F,
const TargetOptions & TargetOpts )
static

Merges target-features from \TargetOpts and \F, and sets the result in \FuncAttr.

  • features from \F are always kept
  • a feature from \TargetOpts is kept if itself and its opposite are absent from \F

Definition at line 2538 of file CGCall.cpp.

References Feature, and clang::TargetOptions::Features.

Referenced by clang::CodeGen::mergeDefaultFunctionDefinitionAttributes().

◆ setBitRange() [1/2]

void setBitRange ( SmallVectorImpl< uint64_t > & Bits,
int BitOffset,
int BitWidth,
int CharWidth )
static

Definition at line 4261 of file CGCall.cpp.

References uint64_t, and Used.

Referenced by setBitRange(), and setUsedBits().

◆ setBitRange() [2/2]

void setBitRange ( SmallVectorImpl< uint64_t > & Bits,
int StorageOffset,
int StorageSize,
int BitOffset,
int BitWidth,
int CharWidth,
bool BigEndian )
static

Definition at line 4292 of file CGCall.cpp.

References setBitRange(), uint64_t, and V.

◆ setCUDAKernelCallingConvention()

void setCUDAKernelCallingConvention ( CanQualType & FTy,
CodeGenModule & CGM,
const FunctionDecl * FD )
static

◆ setUsedBits() [1/3]

◆ setUsedBits() [2/3]

void setUsedBits ( CodeGenModule & CGM,
const ConstantArrayType * ATy,
int Offset,
SmallVectorImpl< uint64_t > & Bits )
static

Definition at line 4345 of file CGCall.cpp.

References clang::CodeGen::CodeGenModule::getContext(), and setUsedBits().

◆ setUsedBits() [3/3]

◆ tryEmitFusedAutoreleaseOfResult()

◆ tryRemoveRetainOfSelf()