clang
9.0.0
|
#include "CGCall.h"
#include "ABIInfo.h"
#include "CGBlocks.h"
#include "CGCXXABI.h"
#include "CGCleanup.h"
#include "CodeGenFunction.h"
#include "CodeGenModule.h"
#include "TargetInfo.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclObjC.h"
#include "clang/Basic/CodeGenOptions.h"
#include "clang/Basic/TargetBuiltins.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/CodeGen/CGFunctionInfo.h"
#include "clang/CodeGen/SwiftCallingConv.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Analysis/ValueTracking.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"
Go to the source code of this file.
Namespaces | |
clang | |
Dataflow Directional Tag Classes. | |
clang::CodeGen | |
Functions | |
static CanQual< FunctionProtoType > | GetFormalType (const CXXMethodDecl *MD) |
Returns the canonical formal type of the given C++ method. More... | |
static CanQualType | GetReturnType (QualType RetTy) |
Returns the "extra-canonicalized" return type, which discards qualifiers on the return type. More... | |
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. More... | |
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. More... | |
static CallingConv | getCallingConventionForDecl (const Decl *D, bool IsWindows) |
static void | setCUDAKernelCallingConvention (CanQualType &FTy, CodeGenModule &CGM, const FunctionDecl *FD) |
Set calling convention for CUDA/HIP kernel. More... | |
static SmallVector< CanQualType, 16 > | getArgTypesForCall (ASTContext &ctx, const CallArgList &args) |
static SmallVector< CanQualType, 16 > | getArgTypesForDeclaration (ASTContext &ctx, const FunctionArgList &args) |
static llvm::SmallVector< FunctionProtoType::ExtParameterInfo, 16 > | 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. More... | |
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 Address | CreateTempAllocaForCoercion (CodeGenFunction &CGF, llvm::Type *Ty, CharUnits MinAlign) |
Create a temporary allocation for the purposes of coercion. More... | |
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. More... | |
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. More... | |
static llvm::Value * | CreateCoercedLoad (Address Src, llvm::Type *Ty, CodeGenFunction &CGF) |
CreateCoercedLoad - Create a load from. More... | |
static void | BuildAggStore (CodeGenFunction &CGF, llvm::Value *Val, Address Dest, bool DestIsVolatile) |
static void | CreateCoercedStore (llvm::Value *Src, Address Dst, bool DstIsVolatile, CodeGenFunction &CGF) |
CreateCoercedStore - Create a store to. More... | |
static Address | emitAddressAtOffset (CodeGenFunction &CGF, Address addr, const ABIArgInfo &info) |
static void | AddAttributesFromFunctionProtoType (ASTContext &Ctx, llvm::AttrBuilder &FuncAttrs, const FunctionProtoType *FPT) |
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. More... | |
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. More... | |
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. More... | |
static llvm::Value * | tryRemoveRetainOfSelf (CodeGenFunction &CGF, llvm::Value *result) |
If this is a +1 of the value of an immutable 'self', remove it. More... | |
static llvm::Value * | emitAutoreleaseOfResult (CodeGenFunction &CGF, llvm::Value *result) |
Emit an ARC autorelease of the result of a function. More... | |
static llvm::StoreInst * | findDominatingStoreToReturnValue (CodeGenFunction &CGF) |
Heuristically search for a dominating store to the return-value slot. More... | |
static bool | isInAllocaArgument (CGCXXABI &ABI, QualType type) |
static AggValueSlot | createPlaceholderSlot (CodeGenFunction &CGF, QualType Ty) |
static bool | isProvablyNull (llvm::Value *addr) |
static void | emitWriteback (CodeGenFunction &CGF, const CallArgList::Writeback &writeback) |
Emit the actual writing-back of a writeback. More... | |
static void | emitWritebacks (CodeGenFunction &CGF, const CallArgList &args) |
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. More... | |
|
static |
Definition at line 1679 of file CGCall.cpp.
References clang::FunctionProtoType::getExceptionSpecType(), clang::FunctionProtoType::isNothrow(), and clang::isUnresolvedExceptionSpec().
Referenced by clang::CodeGen::CodeGenModule::ConstructAttributeList().
|
static |
Definition at line 112 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 |
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 142 of file CGCall.cpp.
References addExtParameterInfosForCall(), clang::CodeGen::CodeGenTypes::getContext(), clang::ASTContext::getSizeType(), and clang::CanQual< T >::getTypePtr().
Referenced by clang::CodeGen::CodeGenTypes::arrangeCXXStructorDeclaration(), and arrangeLLVMFunctionInfo().
|
static |
Arrange a call as unto a free function, except possibly with an additional number of formal parameters considered required.
Definition at line 562 of file CGCall.cpp.
References addExtParameterInfosForCall(), clang::CodeGen::RequiredArgs::All, clang::CodeGen::CodeGenTypes::arrangeLLVMFunctionInfo(), clang::CodeGen::RequiredArgs::forPrototypePlus(), clang::ASTContext::getCanonicalParamType(), clang::CodeGen::CodeGenTypes::getContext(), clang::FunctionType::getExtInfo(), GetReturnType(), clang::FunctionType::getReturnType(), clang::CodeGen::CodeGenModule::getTargetCodeGenInfo(), and clang::CodeGen::TargetCodeGenInfo::isNoProtoCallVariadic().
Referenced by clang::CodeGen::CodeGenTypes::arrangeBlockFunctionCall(), and clang::CodeGen::CodeGenTypes::arrangeFreeFunctionCall().
|
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 175 of file CGCall.cpp.
References appendParameterTypes(), clang::CodeGen::CodeGenTypes::arrangeLLVMFunctionInfo(), clang::CodeGen::RequiredArgs::forPrototypePlus(), and clang::CanQual< T >::getUnqualifiedType().
Referenced by clang::CodeGen::CodeGenTypes::arrangeCXXMethodType(), clang::CodeGen::CodeGenTypes::arrangeFreeFunctionType(), and clang::CodeGen::CodeGenTypes::getLLVMContext().
|
static |
Definition at line 1269 of file CGCall.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CGBuilderTy::CreateStore(), clang::CodeGen::CGBuilderTy::CreateStructGEP(), and i.
Referenced by CreateCoercedStore().
|
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 1163 of file CGCall.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CGBuilderTy::CreateBitCast(), clang::CodeGen::CodeGenModule::getDataLayout(), clang::CodeGen::CodeGenTypeCache::IntPtrTy, and clang::CodeGen::Type.
Referenced by CreateCoercedLoad(), and CreateCoercedStore().
|
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 1217 of file CGCall.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, CoerceIntOrPtrToIntOrPtr(), clang::CodeGen::CGBuilderTy::CreateBitCast(), clang::CodeGen::CGBuilderTy::CreateElementBitCast(), clang::CodeGen::CGBuilderTy::CreateLoad(), clang::CodeGen::CGBuilderTy::CreateMemCpy(), CreateTempAllocaForCoercion(), EnterStructPointerForCoercedAccess(), clang::CodeGen::Address::getAddressSpace(), clang::CodeGen::Address::getAlignment(), clang::CodeGen::CodeGenModule::getDataLayout(), clang::CodeGen::Address::getElementType(), clang::CodeGen::Address::getType(), clang::CodeGen::CodeGenTypeCache::Int8Ty, clang::CodeGen::CodeGenTypeCache::IntPtrTy, and clang::CodeGen::Type.
|
static |
CreateCoercedStore - Create a store to.
This safely handles the case when the src type is larger than the destination type; the upper bits of the src will be lost.
Definition at line 1290 of file CGCall.cpp.
References BuildAggStore(), clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, CoerceIntOrPtrToIntOrPtr(), clang::CodeGen::CGBuilderTy::CreateElementBitCast(), clang::CodeGen::CGBuilderTy::CreateMemCpy(), clang::CodeGen::CGBuilderTy::CreateStore(), CreateTempAllocaForCoercion(), EnterStructPointerForCoercedAccess(), clang::CodeGen::Address::getAlignment(), clang::CodeGen::CodeGenModule::getDataLayout(), clang::CodeGen::Address::getType(), clang::CodeGen::CodeGenTypeCache::Int8Ty, clang::CodeGen::CodeGenTypeCache::IntPtrTy, and clang::CodeGen::Type.
|
static |
Definition at line 3030 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::QualType::getQualifiers(), clang::CodeGen::AggValueSlot::IsNotAliased, clang::CodeGen::AggValueSlot::IsNotDestructed, and clang::CodeGen::Type.
Referenced by clang::CodeGen::CodeGenFunction::EmitCallArg().
|
static |
Create a temporary allocation for the purposes of coercion.
Definition at line 1113 of file CGCall.cpp.
References clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::CreateTempAlloca(), clang::CharUnits::fromQuantity(), clang::CodeGen::CodeGenModule::getDataLayout(), and max().
Referenced by CreateCoercedLoad(), and CreateCoercedStore().
|
static |
Definition at line 3181 of file CGCall.cpp.
References clang::CodeGen::CodeGenFunction::DeactivateCleanupBlock(), and clang::CodeGen::CallArgList::getCleanupsToDeactivate().
|
static |
Definition at line 1343 of file CGCall.cpp.
References clang::CodeGen::CGFunctionInfo::arg_begin(), clang::CodeGen::CGFunctionInfo::arg_end(), clang::CodeGen::CGFunctionInfo::arg_size(), clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::ABIArgInfo::CoerceAndExpand, clang::CodeGen::CGBuilderTy::CreateConstInBoundsByteGEP(), clang::CodeGen::CGBuilderTy::CreateElementBitCast(), clang::CodeGen::ABIArgInfo::Direct, clang::CodeGen::ABIArgInfo::Expand, clang::CodeGen::ABIArgInfo::Extend, clang::CharUnits::fromQuantity(), clang::CodeGen::ABIArgInfo::getCanBeFlattened(), clang::CodeGen::ABIArgInfo::getCoerceAndExpandTypeSequence(), clang::CodeGen::ABIArgInfo::getCoerceToType(), clang::CodeGen::ABIArgInfo::getDirectOffset(), getExpansionSize(), clang::CodeGen::ABIArgInfo::getKind(), clang::CodeGen::CGFunctionInfo::getNumRequiredArgs(), clang::CodeGen::ABIArgInfo::getPaddingType(), clang::CodeGen::CGFunctionInfo::getReturnInfo(), clang::CodeGen::ABIArgInfo::Ignore, clang::CodeGen::ABIArgInfo::InAlloca, clang::CodeGen::ABIArgInfo::Indirect, clang::CodeGen::CodeGenTypeCache::Int8Ty, clang::CodeGen::ABIArgInfo::isDirect(), clang::CodeGen::ABIArgInfo::isSRetAfterThis(), and clang::CodeGen::CGFunctionInfo::usesInAlloca().
|
static |
An argument came in as a promoted argument; demote it back to its declared type.
Definition at line 2161 of file CGCall.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::ConvertType(), clang::ValueDecl::getType(), and clang::CodeGen::Type.
|
static |
Emit an ARC autorelease of the result of a function.
Definition at line 2710 of file CGCall.cpp.
References clang::CodeGen::CodeGenFunction::EmitARCAutoreleaseReturnValue(), clang::CodeGen::CodeGenFunction::shouldUseFusedARCCalls(), tryEmitFusedAutoreleaseOfResult(), and tryRemoveRetainOfSelf().
|
static |
Emit the actual writing-back of a writeback.
Definition at line 3109 of file CGCall.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::CGBuilderTy::CreateBitCast(), clang::CodeGen::CGBuilderTy::CreateLoad(), clang::CodeGen::CodeGenFunction::EmitARCIntrinsicUse(), clang::CodeGen::CodeGenFunction::EmitARCRelease(), clang::CodeGen::CodeGenFunction::EmitARCRetainNonBlock(), clang::CodeGen::CodeGenFunction::EmitBlock(), clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), clang::CodeGen::CodeGenFunction::EmitStoreThroughLValue(), clang::CodeGen::RValue::get(), clang::CodeGen::LValue::getAddress(), clang::CodeGen::CodeGenModule::getDataLayout(), clang::CodeGen::Address::getElementType(), clang::CodeGen::LValue::getObjCLifetime(), clang::CodeGen::Address::getPointer(), clang::CodeGen::LValue::isARCPreciseLifetime(), isProvablyNull(), clang::Qualifiers::OCL_Strong, clang::CodeGen::CallArgList::Writeback::Source, clang::CodeGen::CallArgList::Writeback::Temporary, and clang::CodeGen::CallArgList::Writeback::ToUse.
Referenced by 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 3203 of file CGCall.cpp.
References clang::CodeGen::CallArgList::add(), clang::CodeGen::CallArgList::addWriteback(), clang::CodeGen::CodeGenFunction::ConditionalEvaluation::begin(), clang::CodeGen::CodeGenFunction::Builder, clang::Type::castAs(), clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::ConvertType(), clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::CGBuilderTy::CreateBitCast(), 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::CodeGenFunction::ConditionalEvaluation::end(), clang::CodeGen::RValue::get(), clang::CodeGen::LValue::getAddress(), clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::CodeGen::CodeGenModule::getDataLayout(), clang::CodeGen::LValue::getObjCLifetime(), clang::CodeGen::Address::getPointer(), clang::CodeGen::CodeGenTypeCache::getPointerAlign(), clang::CodeGen::RValue::getScalarVal(), clang::ObjCIndirectCopyRestoreExpr::getSubExpr(), clang::Expr::getType(), 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 |
Definition at line 3175 of file CGCall.cpp.
References emitWriteback(), and clang::CodeGen::CallArgList::writebacks().
|
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 1127 of file CGCall.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CGBuilderTy::CreateStructGEP(), clang::CodeGen::CodeGenModule::getDataLayout(), clang::CodeGen::Address::getElementType(), and clang::CodeGen::Type.
Referenced by CreateCoercedLoad(), and CreateCoercedStore().
|
static |
Definition at line 2571 of file CGCall.cpp.
Referenced by tryRemoveRetainOfSelf().
|
static |
Heuristically search for a dominating store to the return-value slot.
Definition at line 2728 of file CGCall.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::Address::getPointer(), and clang::CodeGen::CodeGenFunction::ReturnValue.
|
static |
Definition at line 1001 of file CGCall.cpp.
References clang::CharUnits::alignmentOfArrayElement(), clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::RValue::get(), clang::CodeGen::LValue::getAddress(), clang::CodeGen::RValue::getAggregate(), clang::CodeGen::RValue::getAggregateAddress(), clang::CodeGen::Address::getAlignment(), clang::Type::getAsCXXRecordDecl(), clang::CodeGen::RValue::getComplexVal(), clang::CodeGen::CodeGenTypes::getContext(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::CallArg::getKnownLValue(), clang::CodeGen::CallArg::getKnownRValue(), clang::CodeGen::Address::getPointer(), clang::CodeGen::Address::getType(), getTypeExpansion(), clang::ASTContext::getTypeSizeInChars(), clang::CodeGen::CallArg::hasLValue(), i, clang::CodeGen::LValue::isSimple(), and V.
|
static |
Definition at line 355 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 363 of file CGCall.cpp.
References clang::ASTContext::getCanonicalParamType().
Referenced by clang::CodeGen::CodeGenTypes::arrangeBlockFunctionDeclaration(), and clang::CodeGen::CodeGenTypes::arrangeBuiltinFunctionDeclaration().
|
static |
Definition at line 199 of file CGCall.cpp.
References clang::CC_AAPCS, clang::CC_AAPCS_VFP, clang::CC_AArch64VectorCall, clang::CC_C, clang::CC_IntelOclBicc, clang::CC_PreserveAll, clang::CC_PreserveMost, 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().
|
static |
Definition at line 959 of file CGCall.cpp.
References getTypeExpansion().
Referenced by emitAddressAtOffset().
|
static |
Definition at line 371 of file CGCall.cpp.
References addExtParameterInfosForCall(), clang::FunctionProtoType::hasExtParameterInfos(), and result.
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 87 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 |
Returns the attribute (either parameter attribute, or function attribute), which declares argument ArgNo to be non-null.
Definition at line 2181 of file CGCall.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CGBuilderTy::CreateLoad(), clang::CodeGen::CGBuilderTy::CreateStore(), clang::Decl::getAttr(), clang::Type::isAnyPointerType(), clang::Type::isBlockPointerType(), and clang::Decl::specific_attrs().
Referenced by 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 96 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(), arrangeFreeFunctionLikeCall(), clang::CodeGen::CodeGenTypes::arrangeObjCMessageSendSignature(), and clang::CodeGen::CodeGenTypes::arrangeUnprototypedObjCMessageSend().
|
static |
Definition at line 904 of file CGCall.cpp.
References clang::RecordDecl::fields(), clang::Type::getAs(), clang::ASTContext::getAsConstantArrayType(), clang::ASTContext::getTypeSizeInChars(), clang::RecordDecl::hasFlexibleArrayMember(), clang::TagDecl::isUnion(), and clang::CharUnits::Zero().
Referenced by forConstantArrayExpansion(), clang::CodeGen::CodeGenTypes::getExpandedTypes(), and getExpansionSize().
Definition at line 3025 of file CGCall.cpp.
References clang::Type::getAsCXXRecordDecl(), clang::CodeGen::CGCXXABI::getRecordArgABI(), and clang::CodeGen::CGCXXABI::RAA_DirectInMemory.
Referenced by clang::CodeGen::CodeGenFunction::EmitDelegateCallArg().
|
static |
Definition at line 3104 of file CGCall.cpp.
Referenced by emitWriteback(), and emitWritebackArg().
Definition at line 3192 of file CGCall.cpp.
References clang::Expr::IgnoreParens().
Referenced by emitWritebackArg().
|
static |
Set calling convention for CUDA/HIP kernel.
Definition at line 264 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 |
Try to emit a fused autorelease of a return result.
Definition at line 2583 of file CGCall.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CGBuilderTy::CreateBitCast(), clang::CodeGen::CodeGenFunction::EmitARCRetainAutoreleaseReturnValue(), clang::CodeGen::CodeGenModule::getObjCEntrypoints(), clang::CodeGen::ObjCEntrypoints::objc_retain, clang::CodeGen::ObjCEntrypoints::objc_retainAutoreleasedReturnValue, result, clang::CodeGen::ObjCEntrypoints::retainAutoreleasedReturnValueMarker, and clang::CodeGen::Type.
Referenced by emitAutoreleaseOfResult().
|
static |
If this is a +1 of the value of an immutable 'self', remove it.
Definition at line 2671 of file CGCall.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CGBuilderTy::CreateBitCast(), clang::CodeGen::CodeGenFunction::CurCodeDecl, eraseUnusedBitCasts(), clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), clang::CodeGen::CodeGenModule::getObjCEntrypoints(), clang::CodeGen::Address::getPointer(), clang::ObjCMethodDecl::getSelfDecl(), clang::CodeGen::ObjCEntrypoints::objc_retain, and clang::CodeGen::Type.
Referenced by emitAutoreleaseOfResult().