#include "CGCall.h"
#include "ABIInfo.h"
#include "ABIInfoImpl.h"
#include "CGBlocks.h"
#include "CGCXXABI.h"
#include "CGCleanup.h"
#include "CGRecordLayout.h"
#include "CodeGenFunction.h"
#include "CodeGenModule.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.
namespace clang The JSON file list parser is used to communicate input to InstallAPI.target-features
from \TargetOpts and \F, and sets the result in \FuncAttr.
Definition at line 1767 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().
◆ AddAttributesFromOMPAssumes() static void AddAttributesFromOMPAssumes ( llvm::AttrBuilder & FuncAttrs, const Decl * Callee ) static ◆ addDenormalModeAttrs() static void addDenormalModeAttrs ( llvm::DenormalMode FPDenormalMode, llvm::DenormalMode FP32DenormalMode, llvm::AttrBuilder & FuncAttrs ) static ◆ addExtParameterInfosForCall() ◆ addMergableDefaultFunctionAttributes() static void addMergableDefaultFunctionAttributes ( const CodeGenOptions & CodeGenOpts, llvm::AttrBuilder & FuncAttrs ) static ◆ addNoBuiltinAttributes() static void addNoBuiltinAttributes ( llvm::AttrBuilder & FuncAttrs, const LangOptions & LangOpts, const NoBuiltinAttr * NBA =nullptr
) static ◆ appendParameterTypes() ◆ arrangeFreeFunctionLikeCall()
Arrange a call as unto a free function, except possibly with an additional number of formal parameters considered required.
Definition at line 590 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(), clang::FunctionType::getReturnType(), GetReturnType(), clang::CodeGen::CodeGenModule::getTargetCodeGenInfo(), clang::CodeGen::IsChainCall, clang::CodeGen::TargetCodeGenInfo::isNoProtoCallVariadic(), and clang::CodeGen::None.
Referenced by clang::CodeGen::CodeGenTypes::arrangeBlockFunctionCall(), and clang::CodeGen::CodeGenTypes::arrangeFreeFunctionCall().
◆ arrangeLLVMFunctionInfo() ◆ buildMultiCharMask() ◆ canApplyNoFPClass() ◆ CoerceIntOrPtrToIntOrPtr() ◆ CoerceScalableToFixed() ◆ CreateCoercedLoad()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 1262 of file CGCall.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, CoerceIntOrPtrToIntOrPtr(), clang::CodeGen::CGBuilderTy::CreateLoad(), clang::CodeGen::CGBuilderTy::CreateMemCpy(), CreateTempAllocaForCoercion(), clang::CodeGen::Address::emitRawPointer(), EnterStructPointerForCoercedAccess(), clang::CodeGen::RawAddress::getAlignment(), clang::CodeGen::Address::getAlignment(), clang::CharUnits::getAsAlign(), clang::CodeGen::CodeGenModule::getDataLayout(), clang::CodeGen::Address::getElementType(), clang::CodeGen::Address::getName(), clang::CodeGen::RawAddress::getPointer(), clang::CodeGen::CodeGenTypeCache::Int64Ty, clang::CodeGen::CodeGenTypeCache::IntPtrTy, clang::Result, and clang::CodeGen::Address::withElementType().
◆ createPlaceholderSlot()Definition at line 4090 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.
◆ CreateTempAllocaForCoercion() ◆ deactivateArgCleanupsBeforeCall() ◆ DetermineNoUndef()Definition at line 2204 of file CGCall.cpp.
References clang::CodeGen::ABIArgInfo::canHaveCoerceToType(), Complex, 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().
◆ emitAddressAtOffset() ◆ emitArgumentDemotion() ◆ emitAutoreleaseOfResult() ◆ emitWriteback()Emit the actual writing-back of a writeback.
Definition at line 4169 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::LValue::getAddress(), clang::CodeGen::Address::getBasePointer(), clang::CodeGen::Address::getElementType(), clang::CodeGen::LValue::getObjCLifetime(), clang::CodeGen::LValue::isARCPreciseLifetime(), isProvablyNonNull(), isProvablyNull(), clang::CodeGen::CallArgList::Writeback::LifetimeSz, 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.
◆ emitWritebackArg()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 4265 of file CGCall.cpp.
References clang::CodeGen::CallArgList::add(), clang::CodeGen::CallArgList::addWriteback(), clang::CodeGen::CodeGenFunction::Builder, 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::RValue::get(), clang::CodeGen::LValue::getAddress(), clang::CodeGen::Address::getBasePointer(), clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::CodeGen::LValue::getObjCLifetime(), 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().
◆ EnterStructPointerForCoercedAccess() ◆ eraseUnusedBitCasts() static void eraseUnusedBitCasts ( llvm::Instruction * insn ) static ◆ findDominatingStoreToReturnValue() static llvm::StoreInst * findDominatingStoreToReturnValue ( CodeGenFunction & CGF ) static ◆ forConstantArrayExpansion() static void forConstantArrayExpansion ( CodeGenFunction & CGF, ConstantArrayExpansion * CAE, Address BaseAddr, llvm::function_ref< void(Address)> Fn ) static ◆ getArgTypesForCall() ◆ getArgTypesForDeclaration() ◆ getCallingConventionForDecl()Definition at line 212 of file CGCall.cpp.
References clang::CC_AAPCS, clang::CC_AAPCS_VFP, clang::CC_AArch64SVEPCS, clang::CC_AArch64VectorCall, clang::CC_AMDGPUKernelCall, clang::CC_C, clang::CC_IntelOclBicc, clang::CC_M68kRTD, clang::CC_PreserveAll, clang::CC_PreserveMost, clang::CC_PreserveNone, clang::CC_RISCVVectorCall, 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, D, clang::Decl::getAttr(), and clang::Decl::hasAttr().
Referenced by clang::CodeGen::CodeGenTypes::arrangeObjCMessageSendSignature().
◆ getExpansionSize() ◆ getExtParameterInfosForCall() ◆ GetFormalType() ◆ getMaxVectorWidth() ◆ getNoFPClassTestMask() static llvm::FPClassTest getNoFPClassTestMask ( const LangOptions & LangOpts ) static ◆ getNonNullAttr() ◆ GetReturnType()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 110 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(), clang::CodeGen::CodeGenTypes::arrangeUnprototypedObjCMessageSend(), clang::Sema::BuildTypeTrait(), and clang::ento::retaincountchecker::RetainCountChecker::checkSummary().
◆ getTrivialDefaultFunctionAttributes() static void getTrivialDefaultFunctionAttributes ( StringRef Name, bool HasOptnone, const CodeGenOptions & CodeGenOpts, const LangOptions & LangOpts, bool AttrOnCallSite, llvm::AttrBuilder & FuncAttrs ) staticDefinition at line 1888 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().
◆ getTypeExpansion() static std::unique_ptr< TypeExpansion > getTypeExpansion ( QualType Ty, const ASTContext & Context ) static ◆ hasInAllocaArgs() ◆ HasStrictReturn() ◆ IsArgumentMaybeUndef() ◆ isInAllocaArgument() ◆ isObjCMethodWithTypeParams() ◆ isProvablyNonNull() ◆ isProvablyNull() ◆ maybeGetUnaryAddrOfOperand() static const Expr * maybeGetUnaryAddrOfOperand ( const Expr * E ) static ◆ overrideFunctionFeaturesWithTargetFeatures() static void overrideFunctionFeaturesWithTargetFeatures ( llvm::AttrBuilder & FuncAttr, const llvm::Function & F, const TargetOptions & TargetOpts ) static ◆ setBitRange() [1/2] ◆ setBitRange() [2/2] ◆ setCUDAKernelCallingConvention() ◆ setUsedBits() [1/3] ◆ setUsedBits() [2/3] ◆ setUsedBits() [3/3]Definition at line 3686 of file CGCall.cpp.
References E, clang::RecordDecl::field_begin(), clang::RecordDecl::field_end(), clang::ASTContext::getASTRecordLayout(), clang::CodeGen::CGRecordLayout::getBitFieldInfo(), clang::CodeGen::CodeGenTypes::getCGRecordLayout(), clang::ASTContext::getCharWidth(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenModule::getDataLayout(), clang::RecordType::getDecl(), clang::RecordDecl::getDefinition(), 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.
◆ tryEmitFusedAutoreleaseOfResult() ◆ tryRemoveRetainOfSelf()If this is a +1 of the value of an immutable 'self', remove it.
Definition at line 3500 of file CGCall.cpp.
References clang::CodeGen::CodeGenFunction::Builder, 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().
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4