clang 22.0.0git
|
#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 "TargetInfo.h"
#include "clang/AST/Attr.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclObjC.h"
#include "clang/Basic/CodeGenOptions.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/CodeGen/CGFunctionInfo.h"
#include "clang/CodeGen/SwiftCallingConv.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/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 |
The JSON file list parser is used to communicate input to InstallAPI. | |
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 CanQual< FunctionProtoType > | GetFormalType (const CXXMethodDecl *MD) |
Returns the canonical formal type of the given C++ method. | |
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 > ¶mInfos, const FunctionProtoType *proto, unsigned prefixArgs, unsigned totalArgs) |
static void | appendParameterTypes (const CodeGenTypes &CGT, SmallVectorImpl< CanQualType > &prefix, SmallVectorImpl< FunctionProtoType::ExtParameterInfo > ¶mInfos, 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 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) |
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 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 * | CreateCoercedLoad (Address Src, llvm::Type *Ty, CodeGenFunction &CGF) |
CreateCoercedLoad - Create a load from. | |
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 | 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 | IsArgumentMaybeUndef (const Decl *TargetDecl, unsigned NumRequiredArgs, unsigned ArgNo) |
Check if the argument of a function has maybe_undef attribute. | |
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::FPClassTest | getNoFPClassTestMask (const LangOptions &LangOpts) |
Return the nofpclass mask that can be applied to floating-point parameters. | |
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 unsigned | getMaxVectorWidth (const llvm::Type *Ty) |
#define CC_VLS_CASE | ( | ABI_VLEN | ) |
#define CC_VLS_CASE | ( | ABI_VLEN | ) |
using CanQualTypeList = SmallVector<CanQualType, 16> |
Definition at line 244 of file CGCall.cpp.
using ExtParameterInfoList |
Definition at line 224 of file CGCall.cpp.
|
static |
Definition at line 1839 of file CGCall.cpp.
References clang::FunctionType::ARM_In, clang::FunctionType::ARM_InOut, clang::FunctionType::ARM_Out, clang::FunctionType::ARM_Preserves, clang::FunctionProtoType::getAArch64SMEAttributes(), clang::FunctionType::getArmZAState(), clang::FunctionType::getArmZT0State(), clang::FunctionProtoType::getExceptionSpecType(), clang::FunctionProtoType::isNothrow(), clang::isUnresolvedExceptionSpec(), clang::FunctionType::SME_AgnosticZAStateMask, clang::FunctionType::SME_PStateSMCompatibleMask, and clang::FunctionType::SME_PStateSMEnabledMask.
Referenced by clang::CodeGen::CodeGenModule::ConstructAttributeList().
|
static |
Definition at line 1878 of file CGCall.cpp.
Referenced by clang::CodeGen::CodeGenModule::ConstructAttributeList().
|
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 1940 of file CGCall.cpp.
Referenced by addMergableDefaultFunctionAttributes(), and clang::CodeGen::mergeDefaultFunctionDefinitionAttributes().
|
static |
Definition at line 166 of file CGCall.cpp.
References clang::FunctionProtoType::getExtParameterInfos(), clang::FunctionProtoType::getNumParams(), and clang::FunctionProtoType::hasExtParameterInfos().
Referenced by appendParameterTypes(), clang::CodeGen::CodeGenTypes::arrangeCXXConstructorCall(), arrangeFreeFunctionLikeCall(), and getExtParameterInfosForCall().
|
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 1954 of file CGCall.cpp.
References addDenormalModeAttrs(), clang::CodeGenOptions::FP32DenormalMode, and clang::CodeGenOptions::FPDenormalMode.
|
static |
Definition at line 2242 of file CGCall.cpp.
References clang::LangOptions::NoBuiltinFuncs.
Referenced by clang::CodeGen::CodeGenModule::ConstructAttributeList().
|
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 194 of file CGCall.cpp.
References addExtParameterInfosForCall(), clang::ASTContext::getCanonicalSizeType(), clang::CodeGen::CodeGenTypes::getContext(), and clang::CanQual< T >::getTypePtr().
|
static |
Arrange a call as unto a free function, except possibly with an additional number of formal parameters considered required.
Definition at line 657 of file CGCall.cpp.
References addExtParameterInfosForCall(), clang::CodeGen::RequiredArgs::All, clang::CodeGen::CodeGenTypes::arrangeLLVMFunctionInfo(), clang::cast(), clang::CodeGen::RequiredArgs::forPrototypePlus(), clang::ASTContext::getCanonicalParamType(), clang::CodeGen::CodeGenTypes::getContext(), clang::FunctionType::getExtInfo(), GetReturnType(), clang::FunctionType::getReturnType(), clang::CodeGen::CodeGenModule::getTargetCodeGenInfo(), clang::CodeGen::IsChainCall, clang::CodeGen::TargetCodeGenInfo::isNoProtoCallVariadic(), and clang::CodeGen::None.
|
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 230 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.
|
static |
Definition at line 3901 of file CGCall.cpp.
Referenced by clang::CodeGen::CodeGenFunction::EmitCMSEClearRecord(), and clang::CodeGen::CodeGenFunction::EmitCMSEClearRecord().
|
static |
Test if it's legal to apply nofpclass for the given parameter type and it's lowered IR type.
Definition at line 2351 of file CGCall.cpp.
References clang::CodeGen::ABIArgInfo::getCanBeFlattened(), clang::CodeGen::ABIArgInfo::getCoerceToType(), and clang::Type::hasFloatingRepresentation().
Referenced by clang::CodeGen::CodeGenModule::ConstructAttributeList().
|
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 1268 of file CGCall.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenModule::getDataLayout(), clang::CodeGen::CodeGenTypeCache::IntPtrTy, and clang::isa().
Referenced by CreateCoercedLoad(), and clang::CodeGen::CodeGenFunction::CreateCoercedStore().
|
static |
Definition at line 1481 of file CGCall.cpp.
References clang::CodeGen::CodeGenFunction::Builder, and V.
Referenced by clang::CodeGen::CodeGenFunction::EmitFunctionProlog().
|
static |
CreateCoercedLoad - Create a load from.
This safely handles the case when the src type is smaller than the destination type; in this situation the values of bits which not present in the src are undefined.
Definition at line 1319 of file CGCall.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::cast(), clang::CodeGen::CodeGenFunction::CGM, CoerceIntOrPtrToIntOrPtr(), clang::CodeGen::CGBuilderTy::CreateLoad(), clang::CodeGen::CGBuilderTy::CreateMemCpy(), CreateTempAllocaForCoercion(), clang::CodeGen::Address::emitRawPointer(), EnterStructPointerForCoercedAccess(), clang::CodeGen::Address::getAlignment(), clang::CodeGen::RawAddress::getAlignment(), clang::CharUnits::getAsAlign(), clang::CodeGen::CodeGenModule::getDataLayout(), clang::CodeGen::Address::getElementType(), clang::CodeGen::Address::getName(), clang::CodeGen::RawAddress::getPointer(), clang::CodeGen::CodeGenTypeCache::IntPtrTy, clang::isa(), and clang::CodeGen::Address::withElementType().
Referenced by clang::CodeGen::CodeGenFunction::EmitCall(), and clang::CodeGen::CodeGenFunction::EmitFunctionEpilog().
|
static |
Definition at line 4250 of file CGCall.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::CGBuilderTy::CreateAlignedLoad(), clang::CodeGen::AggValueSlot::DoesNotNeedGCBarriers, clang::CodeGen::AggValueSlot::DoesNotOverlap, clang::CodeGen::AggValueSlot::forAddr(), clang::CharUnits::fromQuantity(), clang::CodeGen::CodeGenFunction::getLLVMContext(), clang::QualType::getQualifiers(), clang::CodeGen::AggValueSlot::IsNotAliased, and clang::CodeGen::AggValueSlot::IsNotDestructed.
Referenced by clang::CodeGen::CodeGenFunction::EmitCallArg().
|
static |
Create a temporary allocation for the purposes of coercion.
Definition at line 1216 of file CGCall.cpp.
References clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::CreateTempAlloca(), clang::CharUnits::fromQuantity(), and clang::CodeGen::CodeGenModule::getDataLayout().
Referenced by CreateCoercedLoad(), and clang::CodeGen::CodeGenFunction::CreateCoercedStore().
|
static |
Definition at line 4396 of file CGCall.cpp.
References clang::CodeGen::CodeGenFunction::DeactivateCleanupBlock(), and clang::CodeGen::CallArgList::getCleanupsToDeactivate().
Referenced by clang::CodeGen::CodeGenFunction::EmitCall().
|
static |
Definition at line 2278 of file CGCall.cpp.
References clang::CodeGen::ABIArgInfo::canHaveCoerceToType(), Complex, clang::CodeGen::CodeGenTypes::ConvertTypeForMem(), DetermineNoUndef(), clang::CodeGen::ABIArgInfo::Extend, clang::CodeGen::ABIArgInfo::getCoerceToType(), clang::CodeGen::ABIArgInfo::getKind(), clang::CodeGen::ABIArgInfo::Indirect, clang::CodeGen::ABIArgInfo::IndirectAliased, clang::Type::isBitIntType(), clang::Type::isMemberPointerType(), clang::CodeGen::ABIArgInfo::isNoExt(), clang::Type::isNullPtrType(), clang::Type::isReferenceType(), clang::Type::isScalarType(), and clang::Vector.
Referenced by clang::CodeGen::CodeGenModule::ConstructAttributeList(), and DetermineNoUndef().
|
static |
Definition at line 1469 of file CGCall.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CGBuilderTy::CreateConstInBoundsByteGEP(), clang::CharUnits::fromQuantity(), clang::CodeGen::ABIArgInfo::getCoerceToType(), clang::CodeGen::ABIArgInfo::getDirectOffset(), clang::CodeGen::CodeGenTypeCache::Int8Ty, and clang::CodeGen::Address::withElementType().
Referenced by clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitFunctionEpilog(), and clang::CodeGen::CodeGenFunction::EmitFunctionProlog().
|
static |
An argument came in as a promoted argument; demote it back to its declared type.
Definition at line 3021 of file CGCall.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::ConvertType(), and clang::isa().
Referenced by clang::CodeGen::CodeGenFunction::EmitFunctionProlog().
|
static |
Emit an ARC autorelease of the result of a function.
Definition at line 3685 of file CGCall.cpp.
References clang::CodeGen::CodeGenFunction::EmitARCAutoreleaseReturnValue(), clang::CodeGen::CodeGenFunction::shouldUseFusedARCCalls(), tryEmitFusedAutoreleaseOfResult(), and tryRemoveRetainOfSelf().
Referenced by clang::CodeGen::CodeGenFunction::EmitFunctionEpilog().
|
static |
Emit the actual writing-back of a writeback.
Definition at line 4325 of file CGCall.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::CGBuilderTy::CreateIsNull(), clang::CodeGen::CGBuilderTy::CreateLoad(), clang::CodeGen::CodeGenFunction::EmitARCIntrinsicUse(), clang::CodeGen::CodeGenFunction::EmitARCRelease(), clang::CodeGen::CodeGenFunction::EmitARCRetainNonBlock(), clang::CodeGen::CodeGenFunction::EmitBlock(), clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(), clang::CodeGen::CodeGenFunction::EmitLifetimeEnd(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), clang::CodeGen::CodeGenFunction::EmitStoreThroughLValue(), clang::CodeGen::RValue::get(), clang::CodeGen::Address::getBasePointer(), clang::CodeGen::Address::getElementType(), isProvablyNonNull(), isProvablyNull(), clang::Qualifiers::OCL_Strong, clang::CodeGen::CallArgList::Writeback::Source, clang::CodeGen::CallArgList::Writeback::Temporary, clang::CodeGen::CallArgList::Writeback::ToUse, and clang::CodeGen::CallArgList::Writeback::WritebackExpr.
Referenced by clang::CodeGen::CodeGenFunction::EmitWritebacks().
|
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 4418 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().
|
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 1231 of file CGCall.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CGBuilderTy::CreateStructGEP(), EnterStructPointerForCoercedAccess(), clang::CodeGen::CodeGenModule::getDataLayout(), and clang::CodeGen::Address::getElementType().
Referenced by CreateCoercedLoad(), clang::CodeGen::CodeGenFunction::CreateCoercedStore(), and EnterStructPointerForCoercedAccess().
|
static |
Definition at line 3539 of file CGCall.cpp.
References clang::cast().
Referenced by tryRemoveRetainOfSelf().
|
static |
Heuristically search for a dominating store to the return-value slot.
Definition at line 3703 of file CGCall.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::currentFunctionUsesSEHTry(), clang::CodeGen::Address::getBasePointer(), clang::CodeGen::Address::getElementType(), clang::isa(), and clang::CodeGen::CodeGenFunction::ReturnValue.
Referenced by clang::CodeGen::CodeGenFunction::EmitFunctionEpilog().
|
static |
Definition at line 1096 of file CGCall.cpp.
References clang::CodeGen::CodeGenFunction::Builder, and clang::CodeGen::CGBuilderTy::CreateConstGEP2_32().
|
static |
Definition at line 450 of file CGCall.cpp.
References clang::ASTContext::getCanonicalParamType().
Referenced by clang::CodeGen::CodeGenTypes::arrangeCall(), clang::CodeGen::CodeGenTypes::arrangeCXXMethodCall(), and clang::CodeGen::CodeGenTypes::arrangeUnprototypedObjCMessageSend().
|
static |
Definition at line 458 of file CGCall.cpp.
References clang::ASTContext::getCanonicalParamType().
Referenced by clang::CodeGen::CodeGenTypes::arrangeBlockFunctionDeclaration(), clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), and clang::CodeGen::CodeGenTypes::arrangeDeviceKernelCallerDeclaration().
|
static |
Definition at line 255 of file CGCall.cpp.
References clang::CC_AAPCS, clang::CC_AAPCS_VFP, clang::CC_AArch64SVEPCS, clang::CC_AArch64VectorCall, clang::CC_C, clang::CC_DeviceKernel, clang::CC_IntelOclBicc, clang::CC_M68kRTD, clang::CC_PreserveAll, clang::CC_PreserveMost, clang::CC_PreserveNone, clang::CC_RISCVVectorCall, CC_VLS_CASE, clang::CC_Win64, clang::CC_X86_64SysV, clang::CC_X86FastCall, clang::CC_X86Pascal, clang::CC_X86RegCall, clang::CC_X86StdCall, clang::CC_X86ThisCall, clang::CC_X86VectorCall, clang::Decl::getAttr(), and clang::Decl::hasAttr().
Referenced by clang::CodeGen::CodeGenTypes::arrangeObjCMessageSendSignature(), and clang::CodeGen::CodeGenFunction::EmitCallArgs().
|
static |
Definition at line 1055 of file CGCall.cpp.
References getExpansionSize(), getTypeExpansion(), and clang::isa().
Referenced by getExpansionSize().
|
static |
Definition at line 467 of file CGCall.cpp.
References addExtParameterInfosForCall(), and clang::FunctionProtoType::hasExtParameterInfos().
Referenced by clang::CodeGen::CodeGenTypes::arrangeBlockFunctionDeclaration(), and clang::CodeGen::CodeGenTypes::arrangeCXXMethodCall().
|
static |
Returns the canonical formal type of the given C++ method.
Definition at line 141 of file CGCall.cpp.
References clang::CanQual< T >::getAs(), clang::Type::getCanonicalTypeUnqualified(), and clang::ValueDecl::getType().
Referenced by clang::CodeGen::CodeGenTypes::arrangeCXXConstructorCall(), clang::CodeGen::CodeGenTypes::arrangeCXXMethodDeclaration(), clang::CodeGen::CodeGenTypes::arrangeCXXStructorDeclaration(), clang::CodeGen::CodeGenTypes::arrangeMSCtorClosure(), and clang::CodeGen::CodeGenTypes::arrangeUnprototypedMustTailThunk().
|
static |
Definition at line 5202 of file CGCall.cpp.
References getMaxVectorWidth().
Referenced by clang::CodeGen::CodeGenFunction::EmitCall(), and getMaxVectorWidth().
|
static |
Return the nofpclass mask that can be applied to floating-point parameters.
Definition at line 2372 of file CGCall.cpp.
Referenced by clang::CodeGen::CodeGenModule::ConstructAttributeList().
|
static |
Returns the attribute (either parameter attribute, or function attribute), which declares argument ArgNo to be non-null.
Definition at line 3042 of file CGCall.cpp.
References clang::Decl::getAttr(), and clang::Decl::specific_attrs().
Referenced by clang::CodeGen::CodeGenFunction::EmitFunctionProlog(), and clang::CodeGen::CodeGenFunction::EmitNonNullArgCheck().
|
static |
Returns the "extra-canonicalized" return type, which discards qualifiers on the return type.
Codegen doesn't care about them, and it makes ABI code a little easier to be able to assume that all parameter and return types are top-level unqualified.
Definition at line 151 of file CGCall.cpp.
References clang::Type::getCanonicalTypeUnqualified(), and clang::CanQual< T >::getUnqualifiedType().
Referenced by clang::CodeGen::CodeGenTypes::arrangeBlockFunctionDeclaration(), clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionCall(), clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration(), clang::CodeGen::CodeGenTypes::arrangeCXXMethodCall(), clang::CodeGen::CodeGenTypes::arrangeDeviceKernelCallerDeclaration(), arrangeFreeFunctionLikeCall(), clang::CodeGen::CodeGenTypes::arrangeObjCMessageSendSignature(), clang::CodeGen::CodeGenTypes::arrangeUnprototypedObjCMessageSend(), clang::Sema::BuildTypeTrait(), and clang::ento::retaincountchecker::RetainCountChecker::checkSummary().
|
static |
Definition at line 1960 of file CGCall.cpp.
References clang::CodeGenOptions::All, clang::LangOptions::assumeFunctionsAreConvergent(), clang::CodeGenOptions::DefaultFunctionAttrs, clang::LangOptionsBase::FPE_Ignore, clang::LangOptionsBase::FPM_Fast, clang::LangOptionsBase::FPM_FastHonorPragmas, clang::LangOptions::getDefaultExceptionMode(), clang::CodeGenOptions::getFramePointerKindName(), clang::CodeGen::TargetCodeGenInfo::initBranchProtectionFnAttributes(), clang::LangOptions::isNoBuiltinFunc(), clang::CodeGenOptions::None, clang::CodeGenOptions::NonLeaf, clang::CodeGenOptions::PreferVectorWidth, clang::CodeGenOptions::Reciprocals, clang::CodeGenOptions::Reserved, and clang::CodeGenOptions::TrapFuncName.
Referenced by clang::CodeGen::mergeDefaultFunctionDefinitionAttributes().
|
static |
Definition at line 1002 of file CGCall.cpp.
References clang::Type::getAs(), clang::Type::getAsRecordDecl(), and clang::CharUnits::Zero().
Referenced by clang::CodeGen::CodeGenTypes::getExpandedTypes(), and getExpansionSize().
|
static |
Definition at line 4622 of file CGCall.cpp.
References clang::CC_Swift, clang::CC_SwiftAsync, clang::CodeGen::CodeGenModule::getCXXABI(), clang::TargetInfo::getCXXABI(), clang::CodeGen::CodeGenModule::getTarget(), isInAllocaArgument(), and clang::TargetCXXABI::isMicrosoft().
Referenced by clang::CodeGen::CodeGenFunction::EmitCallArgs().
|
static |
Definition at line 1905 of file CGCall.cpp.
Referenced by clang::CodeGen::CodeGenModule::ConstructAttributeList().
|
static |
Check if the argument of a function has maybe_undef attribute.
Definition at line 2329 of file CGCall.cpp.
Referenced by clang::CodeGen::CodeGenFunction::EmitCall().
Definition at line 4245 of file CGCall.cpp.
References clang::CodeGen::CGCXXABI::getRecordArgABI(), clang::CodeGen::CGCXXABI::RAA_DirectInMemory, and clang::ast_matchers::type.
Referenced by hasInAllocaArgs().
|
static |
Definition at line 4640 of file CGCall.cpp.
References clang::Decl::getDeclContext().
Referenced by clang::CodeGen::CodeGenFunction::EmitCallArgs().
|
static |
Definition at line 4320 of file CGCall.cpp.
References clang::Addr, clang::CodeGen::CodeGenFunction::CGM, and clang::CodeGen::CodeGenModule::getDataLayout().
Referenced by emitWriteback(), and emitWritebackArg().
|
static |
Definition at line 4316 of file CGCall.cpp.
Referenced by emitWriteback(), and emitWritebackArg().
Definition at line 4407 of file CGCall.cpp.
References clang::Expr::IgnoreParens().
Referenced by emitWritebackArg().
|
static |
Merges target-features from \TargetOpts and \F, and sets the result in \FuncAttr.
Definition at line 2116 of file CGCall.cpp.
References Feature, and clang::TargetOptions::Features.
Referenced by clang::CodeGen::mergeDefaultFunctionDefinitionAttributes().
|
static |
Definition at line 3781 of file CGCall.cpp.
References Used.
Referenced by setBitRange(), and setUsedBits().
|
static |
Definition at line 3812 of file CGCall.cpp.
References setBitRange(), and V.
|
static |
Set calling convention for CUDA/HIP kernel.
Definition at line 359 of file CGCall.cpp.
References clang::CanQual< T >::getAs(), clang::Type::getCanonicalTypeUnqualified(), clang::CodeGen::CodeGenModule::getTargetCodeGenInfo(), clang::Decl::hasAttr(), and clang::CodeGen::TargetCodeGenInfo::setCUDAKernelCallingConvention().
Referenced by clang::CodeGen::CodeGenTypes::arrangeCXXMethodDeclaration(), and clang::CodeGen::CodeGenTypes::arrangeFunctionDeclaration().
|
static |
Definition at line 3884 of file CGCall.cpp.
References clang::Type::getAsCanonical(), clang::CodeGen::CodeGenModule::getContext(), and setUsedBits().
Referenced by clang::CodeGen::CodeGenFunction::EmitCMSEClearRecord(), clang::CodeGen::CodeGenFunction::EmitCMSEClearRecord(), setUsedBits(), setUsedBits(), and setUsedBits().
|
static |
Definition at line 3865 of file CGCall.cpp.
References clang::CodeGen::CodeGenModule::getContext(), and setUsedBits().
|
static |
Definition at line 3834 of file CGCall.cpp.
References clang::RecordDecl::field_begin(), clang::RecordDecl::field_end(), clang::CodeGen::CGRecordLayout::getBitFieldInfo(), clang::CodeGen::CodeGenTypes::getCGRecordLayout(), clang::ASTContext::getCharWidth(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenModule::getDataLayout(), clang::ASTRecordLayout::getFieldOffset(), clang::CharUnits::getQuantity(), clang::ValueDecl::getType(), clang::CodeGen::CodeGenModule::getTypes(), clang::FieldDecl::isBitField(), clang::Type::isIncompleteArrayType(), clang::FieldDecl::isUnnamedBitField(), clang::FieldDecl::isZeroLengthBitField(), clang::CodeGen::CGBitFieldInfo::Offset, setBitRange(), setUsedBits(), clang::CodeGen::CGBitFieldInfo::Size, clang::CodeGen::CGBitFieldInfo::StorageOffset, and clang::CodeGen::CGBitFieldInfo::StorageSize.
|
static |
Try to emit a fused autorelease of a return result.
Definition at line 3552 of file CGCall.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::cast(), clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::EmitARCRetainAutoreleaseReturnValue(), clang::CodeGen::CodeGenModule::getObjCEntrypoints(), clang::isa(), clang::CodeGen::ObjCEntrypoints::objc_retain, clang::CodeGen::ObjCEntrypoints::objc_retainAutoreleasedReturnValue, and clang::CodeGen::ObjCEntrypoints::retainAutoreleasedReturnValueMarker.
Referenced by emitAutoreleaseOfResult().
|
static |
If this is a +1 of the value of an immutable 'self', remove it.
Definition at line 3644 of file CGCall.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::cast(), clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::CurCodeDecl, eraseUnusedBitCasts(), clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), clang::CodeGen::Address::getBasePointer(), clang::CodeGen::CodeGenModule::getObjCEntrypoints(), clang::ObjCMethodDecl::getSelfDecl(), clang::ValueDecl::getType(), clang::QualType::isConstQualified(), and clang::CodeGen::ObjCEntrypoints::objc_retain.
Referenced by emitAutoreleaseOfResult().