|
clang 24.0.0git
|
Classes | |
| struct | EHPersonality |
| The exceptions personality for a function. More... | |
Enumerations | |
| enum | PointerTypeInfoFlags { PTI_Const = 0x1 , PTI_Volatile = 0x2 , PTI_Restrict = 0x4 , PTI_Incomplete = 0x8 , PTI_ContainingClassIncomplete = 0x10 , PTI_Noexcept = 0x40 } |
| Flags for abi::__pbase_type_info. More... | |
| enum | VMIClassTypeInfoFlags { VMI_NonDiamondRepeat = 0x1 , VMI_DiamondShaped = 0x2 } |
| Flags for abi::__vmi_class_type_info. More... | |
| enum | BaseClassTypeInfoFlags { BCTI_Virtual = 0x1 , BCTI_Public = 0x2 } |
| Flags for abi::__base_class_type_info. More... | |
| enum class | ArmSMEInlinability : uint8_t { Ok = 0 , ErrorCalleeRequiresNewZA = 1 << 0 , ErrorCalleeRequiresNewZT0 = 1 << 1 , WarnIncompatibleStreamingModes = 1 << 2 , ErrorIncompatibleStreamingModes = 1 << 3 , IncompatibleStreamingModes , LLVM_MARK_AS_BITMASK_ENUM =(ErrorIncompatibleStreamingModes) } |
| The Arm SME ABI issues that can prevent inlining one function into another. More... | |
Functions | |
| CanQual< FunctionProtoType > | getFormalType (const CXXMethodDecl *MD) |
| Returns the canonical formal type of the given C++ method. | |
| llvm::FPClassTest | getNoFPClassTestMask (const LangOptions &LangOpts) |
| Returns the set of floating-point value kinds that the language options promise never reach a function's arguments or return value. | |
| bool | baseInitializerUsesThis (ASTContext &Ctx, const Expr *Init) |
Check whether Init uses 'this' in a way which requires the vtable to be properly set. | |
| bool | canSkipVTablePointerInitialization (ASTContext &Ctx, const CXXDestructorDecl *Dtor) |
| Check whether we need to initialize any vtable pointers before calling this destructor. | |
| bool | fieldHasTrivialDestructorBody (ASTContext &Ctx, const FieldDecl *Field) |
Check whether destructing Field has no observable behaviors, and thus can be skipped when creating a destructor body. | |
| bool | isInitializerOfDynamicClass (const CXXCtorInitializer *BaseInit) |
Return whether BaseInit initializes a base class that is dynamic, that is, one whose vtable pointer must be set before the initializer runs. | |
| const EHPersonality & | getEHPersonality (const TargetInfo &Target, const LangOptions &LangOpts, const CodeGenOptions &CGOpts, const FunctionDecl *FD) |
Selects the personality function to use for FD, or for the translation unit as a whole when FD is null. | |
| const EHPersonality & | getCXXEHPersonality (const TargetInfo &Target, const CodeGenOptions &CGOpts) |
| Selects the personality function that plain C++ would use. | |
| QualType | getFixedSizeElementType (const ASTContext &Ctx, const VariableArrayType *VLA) |
Strip off the variably-modified array types wrapping VLA and return the first element type that has a fixed size. | |
| bool | isBlockVarRef (const Expr *E) |
Check whether the value of E is possibly a reference to or into a __block variable. | |
| bool | isCheapEnoughToEvaluateUnconditionally (const Expr *E, const ASTContext &Ctx) |
Check whether E is cheap enough and side-effect-free enough to evaluate unconditionally instead of conditionally. | |
| bool | isTrivialFiller (const Expr *E) |
Check whether E is a trivial array filler, that is, one that is equivalent to zero-initialization. | |
| bool | onlyHasInlineBuiltinDeclaration (const FunctionDecl *FD) |
| Detect the unusual situation where an inline version of a builtin is shadowed by a non-inline version. | |
| bool | shouldEmitLifetimeMarkers (const CodeGenOptions &CGOpts, const LangOptions &LangOpts) |
| Decide whether we need to emit the lifetime markers. | |
| void | checkTargetFeatures (ASTContext &Ctx, DiagnosticsEngine &Diags, const LangOptions &LangOpts, const CallExpr *E, const FunctionDecl *Caller, const FunctionDecl *TargetDecl) |
| Check that a call to a target-specific builtin has the required target features enabled in the caller, emitting an error diagnostic if not. | |
| void | checkTargetFeatures (ASTContext &Ctx, DiagnosticsEngine &Diags, const LangOptions &LangOpts, SourceLocation Loc, const FunctionDecl *Caller, const FunctionDecl *TargetDecl) |
| Overload taking a raw source location instead of a CallExpr. | |
| bool | canUseSingleInheritance (const CXXRecordDecl *RD) |
| Return whether the given record decl has a "single, public, non-virtual base at offset zero (i.e. | |
| CharUnits | computeOffsetHint (ASTContext &Ctx, const CXXRecordDecl *Src, const CXXRecordDecl *Dst) |
| Compute the src2dst_offset hint as described in the Itanium C++ ABI [2.9.7]. | |
| unsigned | computeVMIClassTypeInfoFlags (const CXXRecordDecl *RD) |
| Compute the value of the flags member in abi::__vmi_class_type_info. | |
| bool | containsIncompleteClassType (QualType Ty) |
| Returns whether the given type contains an incomplete class type. | |
| unsigned | extractPBaseFlags (const ASTContext &Ctx, QualType &Type) |
Compute the flags for a __pbase_type_info, and remove the corresponding pieces from Type. | |
| bool | isStandardLibraryRTTIDescriptor (QualType Ty) |
| Returns whether the type information for the given type exists in the standard library. | |
| LangAS | getGlobalConstantAddressSpace (const LangOptions &LangOpts, const TargetInfo &Target) |
| Determines whether the language options require us to model unwind exceptions. | |
| bool | hasUnwindExceptions (const LangOptions &LangOpts) |
| bool | isVarDeclStrongDefinition (const ASTContext &Ctx, const VarDecl *D, bool NoCommon) |
Check whether D is a strong definition, and thus must not be given common linkage. | |
| bool | shouldBeInCOMDAT (const ASTContext &Ctx, const Decl &D) |
Check whether D should be emitted into a COMDAT group. | |
| bool | hasOwnStorage (const ASTContext &Ctx, const CXXRecordDecl *Decl, const CXXRecordDecl *Query) |
Recursively searches all of the bases of Decl to find out whether Query is not the primary vbase of some base class. | |
| bool | isDiscreteBitFieldABI (const ASTContext &Ctx, const RecordDecl *RD) |
| The Microsoft bitfield layout rule allocates discrete storage units of the field's formal type and only combines adjacent fields of the same formal type. | |
| bool | isEmptyFieldForLayout (const ASTContext &Ctx, const FieldDecl *FD) |
| Return true iff the field is "empty", that is, either a zero-width bit-field or an isEmptyRecordForLayout. | |
| bool | isEmptyRecordForLayout (const ASTContext &Ctx, QualType T) |
| Return true iff a structure contains only empty base classes (per isEmptyRecordForLayout) and fields (per isEmptyFieldForLayout). | |
| bool | isOverlappingVBaseABI (const ASTContext &Ctx) |
| The Itanium base layout rule allows virtual bases to overlap other bases, which complicates layout in specific ways. | |
| template<typename LoopStmt> | |
| bool | hasEmptyLoopBody (const LoopStmt &S) |
| bool | checkIfLoopMustProgress (const LangOptions &LangOpts, const CodeGenOptions &CGOpts, ASTContext &Ctx, const Expr *ControllingExpression, bool HasEmptyBody, llvm::function_ref< void()> RemoveMustProgress) |
| Returns true if a loop must make progress, which means the mustprogress attribute can be added to it. | |
| ArmSMEInlinability | getArmSMEInlinability (const FunctionDecl *Caller, const FunctionDecl *Callee) |
Determines if there are any Arm SME ABI issues with inlining Callee into Caller. | |
| bool | hasExtraNeonArgument (unsigned BuiltinID) |
Returns whether the Neon builtin BuiltinID takes a trailing argument that discriminates the operand type. | |
| bool | isAAPCS (const TargetInfo &TargetInfo) |
| Helper method to check if the underlying ABI is AAPCS. | |
| bool | requiresAMDGPUProtectedVisibility (const Decl *D, bool HasHiddenVisibility) |
Returns whether D must be given protected visibility on AMDGPU. | |
| bool | spirNullPointerNeedsGenericCast (QualType QT, const llvm::Triple &Triple) |
Return true if a SPIR(-V) null pointer of type QT must be materialized as an addrspacecast from a generic null pointer, as the null bit pattern in non-generic address spaces is unspecified. | |
| static bool | hasTrivialDestructorBody (ASTContext &Ctx, const CXXRecordDecl *BaseClassDecl, const CXXRecordDecl *MostDerivedClassDecl) |
| static const EHPersonality & | getCPersonality (const TargetInfo &Target, const CodeGenOptions &CGOpts) |
| static const EHPersonality & | getObjCPersonality (const TargetInfo &Target, const CodeGenOptions &CGOpts, const LangOptions &L) |
| static const EHPersonality & | getObjCXXPersonality (const TargetInfo &Target, const CodeGenOptions &CGOpts, const LangOptions &L) |
| Determines the personality function to use when both C++ and Objective-C exceptions are being caught. | |
| static const EHPersonality & | getSEHPersonalityMSVC (const llvm::Triple &T) |
| static unsigned | computeVMIClassTypeInfoFlags (const CXXBaseSpecifier *Base, SeenBases &Bases) |
| static bool | isIncompleteClassType (const RecordType *RecordTy) |
| Returns whether the given record type is incomplete. | |
| static bool | typeInfoIsInStandardLibrary (const BuiltinType *Ty) |
| Given a builtin type, returns whether the type info for that type is defined in the standard library. | |
| static bool | typeInfoIsInStandardLibrary (const PointerType *PointerTy) |
| static bool | isStreamingCompatible (const FunctionDecl *F) |
|
strong |
The Arm SME ABI issues that can prevent inlining one function into another.
| Enumerator | |
|---|---|
| Ok | |
| ErrorCalleeRequiresNewZA | |
| ErrorCalleeRequiresNewZT0 | |
| WarnIncompatibleStreamingModes | |
| ErrorIncompatibleStreamingModes | |
| IncompatibleStreamingModes | |
| LLVM_MARK_AS_BITMASK_ENUM | |
Definition at line 39 of file TargetUtils.h.
Flags for abi::__base_class_type_info.
| Enumerator | |
|---|---|
| BCTI_Virtual | BCTI_Virtual - Base class is virtual. |
| BCTI_Public | BCTI_Public - Base class is public. |
Definition at line 57 of file ItaniumCXXABIUtils.h.
Flags for abi::__pbase_type_info.
| Enumerator | |
|---|---|
| PTI_Const | PTI_Const - Type has const qualifier. |
| PTI_Volatile | PTI_Volatile - Type has volatile qualifier. |
| PTI_Restrict | PTI_Restrict - Type has restrict qualifier. |
| PTI_Incomplete | PTI_Incomplete - Type is incomplete. |
| PTI_ContainingClassIncomplete | PTI_ContainingClassIncomplete - Containing class is incomplete. (in pointer to member). |
| PTI_Noexcept | PTI_TransactionSafe - Pointee is transaction_safe function (C++ TM TS). PTI_Noexcept - Pointee is noexcept function (C++1z). |
Definition at line 23 of file ItaniumCXXABIUtils.h.
Flags for abi::__vmi_class_type_info.
| Enumerator | |
|---|---|
| VMI_NonDiamondRepeat | VMI_NonDiamondRepeat - Class has non-diamond repeated inheritance. |
| VMI_DiamondShaped | VMI_DiamondShaped - Class is diamond shaped. |
Definition at line 48 of file ItaniumCXXABIUtils.h.
| bool clang::CodeGenUtils::baseInitializerUsesThis | ( | ASTContext & | Ctx, |
| const Expr * | Init ) |
Check whether Init uses 'this' in a way which requires the vtable to be properly set.
Definition at line 33 of file ClassUtils.cpp.
References clang::Init.
Referenced by EmitBaseInitializer(), and clang::CIRGen::CIRGenFunction::emitBaseInitializer().
| bool clang::CodeGenUtils::canSkipVTablePointerInitialization | ( | ASTContext & | Ctx, |
| const CXXDestructorDecl * | Dtor ) |
Check whether we need to initialize any vtable pointers before calling this destructor.
Definition at line 90 of file ClassUtils.cpp.
References fieldHasTrivialDestructorBody(), clang::RecordDecl::fields(), clang::CXXRecordDecl::isDynamicClass(), and clang::CXXRecordDecl::isEffectivelyFinal().
Referenced by clang::CodeGen::CodeGenFunction::EmitDestructorBody(), and clang::CIRGen::CIRGenFunction::emitDestructorBody().
| bool clang::CodeGenUtils::canUseSingleInheritance | ( | const CXXRecordDecl * | RD | ) |
Return whether the given record decl has a "single, public, non-virtual base at offset zero (i.e.
the derived class is dynamic iff the base is)", according to Itanium C++ ABI, 2.95p6b.
Definition at line 64 of file ItaniumCXXABIUtils.cpp.
References clang::AS_public, clang::CXXRecordDecl::bases_begin(), clang::CXXRecordDecl::getNumBases(), and clang::CXXRecordDecl::isDynamicClass().
| bool clang::CodeGenUtils::checkIfLoopMustProgress | ( | const LangOptions & | LangOpts, |
| const CodeGenOptions & | CGOpts, | ||
| ASTContext & | Ctx, | ||
| const Expr * | ControllingExpression, | ||
| bool | HasEmptyBody, | ||
| llvm::function_ref< void()> | RemoveMustProgress ) |
Returns true if a loop must make progress, which means the mustprogress attribute can be added to it.
HasEmptyBody indicates whether the loop is trivially empty (see hasEmptyLoopBody()).
A loop that is both trivially empty and has a constant-true controlling expression (e.g. while (true) {}) is a trivial infinite loop, which is exempt from the forward-progress guarantee: [C++26][stmt.iter.general] (DR). When such a loop is found, RemoveMustProgress is called so the caller can delete the 'mustprogress' attribute it may have speculatively added to the enclosing function.
Definition at line 15 of file StmtUtils.cpp.
References clang::CodeGenOptions::Always, clang::Expr::EvaluateAsInt(), clang::CodeGenOptions::Never, and clang::Result.
Referenced by clang::CIRGen::CIRGenFunction::checkIfLoopMustProgress(), and clang::CodeGen::CodeGenFunction::checkIfLoopMustProgress().
| void clang::CodeGenUtils::checkTargetFeatures | ( | ASTContext & | Ctx, |
| DiagnosticsEngine & | Diags, | ||
| const LangOptions & | LangOpts, | ||
| const CallExpr * | E, | ||
| const FunctionDecl * | Caller, | ||
| const FunctionDecl * | TargetDecl ) |
Check that a call to a target-specific builtin has the required target features enabled in the caller, emitting an error diagnostic if not.
Caller is the FunctionDecl of the enclosing function (may be null).
Definition at line 39 of file FunctionUtils.cpp.
References checkTargetFeatures(), clang::CallExpr::getArg(), clang::CallExpr::getBeginLoc(), clang::FunctionDecl::getBuiltinID(), clang::NamedDecl::getDeclName(), clang::ASTContext::getFunctionFeatureMap(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::DiagnosticsEngine::Report(), and clang::Result.
Referenced by clang::CIRGen::CIRGenFunction::checkTargetFeatures(), clang::CIRGen::CIRGenFunction::checkTargetFeatures(), clang::CodeGen::CodeGenFunction::checkTargetFeatures(), clang::CodeGen::CodeGenFunction::checkTargetFeatures(), and checkTargetFeatures().
| void clang::CodeGenUtils::checkTargetFeatures | ( | ASTContext & | Ctx, |
| DiagnosticsEngine & | Diags, | ||
| const LangOptions & | LangOpts, | ||
| SourceLocation | Loc, | ||
| const FunctionDecl * | Caller, | ||
| const FunctionDecl * | TargetDecl ) |
Overload taking a raw source location instead of a CallExpr.
Definition at line 65 of file FunctionUtils.cpp.
References clang::ASTContext::BuiltinInfo, clang::Builtin::evaluateRequiredTargetFeatures(), Feature, clang::ASTContext::filterFunctionTargetAttrs(), clang::Decl::getAttr(), clang::FunctionDecl::getBuiltinID(), clang::NamedDecl::getDeclName(), clang::ASTContext::getFunctionFeatureMap(), clang::Builtin::Context::getRequiredFeatures(), clang::Decl::hasAttr(), clang::FunctionDecl::isMultiVersion(), and clang::DiagnosticsEngine::Report().
| CharUnits clang::CodeGenUtils::computeOffsetHint | ( | ASTContext & | Ctx, |
| const CXXRecordDecl * | Src, | ||
| const CXXRecordDecl * | Dst ) |
Compute the src2dst_offset hint as described in the Itanium C++ ABI [2.9.7].
Definition at line 15 of file ItaniumCXXABIUtils.cpp.
References clang::AS_public, clang::CharUnits::fromQuantity(), clang::ASTContext::getASTRecordLayout(), clang::ASTRecordLayout::getBaseClassOffset(), and clang::CXXRecordDecl::isDerivedFrom().
Referenced by emitDynamicCastInfo().
|
static |
Definition at line 95 of file ItaniumCXXABIUtils.cpp.
References computeVMIClassTypeInfoFlags(), VMI_DiamondShaped, and VMI_NonDiamondRepeat.
| unsigned clang::CodeGenUtils::computeVMIClassTypeInfoFlags | ( | const CXXRecordDecl * | RD | ) |
Compute the value of the flags member in abi::__vmi_class_type_info.
Definition at line 129 of file ItaniumCXXABIUtils.cpp.
References clang::CXXRecordDecl::bases(), and computeVMIClassTypeInfoFlags().
Referenced by computeVMIClassTypeInfoFlags(), and computeVMIClassTypeInfoFlags().
Returns whether the given type contains an incomplete class type.
This is true if
Definition at line 145 of file ItaniumCXXABIUtils.cpp.
References containsIncompleteClassType(), and isIncompleteClassType().
Referenced by containsIncompleteClassType(), extractPBaseFlags(), getTypeInfoLinkage(), and getTypeInfoLinkage().
| unsigned clang::CodeGenUtils::extractPBaseFlags | ( | const ASTContext & | Ctx, |
| QualType & | Type ) |
Compute the flags for a __pbase_type_info, and remove the corresponding pieces from Type.
Definition at line 165 of file ItaniumCXXABIUtils.cpp.
References containsIncompleteClassType(), clang::EST_None, clang::Type::getAs(), clang::ASTContext::getFunctionTypeWithExceptionSpec(), PTI_Const, PTI_Incomplete, PTI_Noexcept, PTI_Restrict, and PTI_Volatile.
| bool clang::CodeGenUtils::fieldHasTrivialDestructorBody | ( | ASTContext & | Ctx, |
| const FieldDecl * | Field ) |
Check whether destructing Field has no observable behaviors, and thus can be skipped when creating a destructor body.
So non-record types, anonymous structs/unions, or record types where the destructor doesnt DO anything are considered as this version of 'trivial'. Note: This is a more liberal definition of trivial destruction than the C++ Standard's version, and thus cannot be used as a substitute for C++ Standard requirements.
Definition at line 76 of file ClassUtils.cpp.
References clang::Type::getAsCXXRecordDecl(), clang::ASTContext::getBaseElementType(), and hasTrivialDestructorBody().
Referenced by canSkipVTablePointerInitialization(), and hasTrivialDestructorBody().
| ArmSMEInlinability clang::CodeGenUtils::getArmSMEInlinability | ( | const FunctionDecl * | Caller, |
| const FunctionDecl * | Callee ) |
Determines if there are any Arm SME ABI issues with inlining Callee into Caller.
Returns the issue (if any) in the ArmSMEInlinability bit enum.
Definition at line 31 of file TargetUtils.cpp.
References ErrorCalleeRequiresNewZA, ErrorCalleeRequiresNewZT0, ErrorIncompatibleStreamingModes, clang::IsArmStreamingFunction(), isStreamingCompatible(), Ok, and WarnIncompatibleStreamingModes.
|
static |
Definition at line 53 of file EHPersonality.cpp.
References clang::CodeGenUtils::EHPersonality::GNU_C, clang::CodeGenUtils::EHPersonality::GNU_C_SEH, clang::CodeGenUtils::EHPersonality::GNU_C_SJLJ, clang::CodeGenOptions::hasDWARFExceptions(), clang::CodeGenOptions::hasSEHExceptions(), clang::CodeGenOptions::hasSjLjExceptions(), clang::CodeGenUtils::EHPersonality::MSVC_CxxFrameHandler3, clang::T, and clang::Target.
Referenced by getEHPersonality(), and getObjCPersonality().
| const EHPersonality & clang::CodeGenUtils::getCXXEHPersonality | ( | const TargetInfo & | Target, |
| const CodeGenOptions & | CGOpts ) |
Selects the personality function that plain C++ would use.
ObjC++ consults this to decide whether it can fall back on the C++ personality.
Definition at line 100 of file EHPersonality.cpp.
References clang::CodeGenUtils::EHPersonality::GNU_CPlusPlus, clang::CodeGenUtils::EHPersonality::GNU_CPlusPlus_SEH, clang::CodeGenUtils::EHPersonality::GNU_CPlusPlus_SJLJ, clang::CodeGenUtils::EHPersonality::GNU_Wasm_CPlusPlus, clang::CodeGenOptions::hasDWARFExceptions(), clang::CodeGenOptions::hasSEHExceptions(), clang::CodeGenOptions::hasSjLjExceptions(), clang::CodeGenOptions::hasWasmExceptions(), clang::CodeGenUtils::EHPersonality::MSVC_CxxFrameHandler3, clang::T, clang::Target, clang::CodeGenUtils::EHPersonality::XL_CPlusPlus, and clang::CodeGenUtils::EHPersonality::ZOS_CPlusPlus.
Referenced by getEHPersonality(), and getObjCXXPersonality().
| const EHPersonality & clang::CodeGenUtils::getEHPersonality | ( | const TargetInfo & | Target, |
| const LangOptions & | LangOpts, | ||
| const CodeGenOptions & | CGOpts, | ||
| const FunctionDecl * | FD ) |
Selects the personality function to use for FD, or for the translation unit as a whole when FD is null.
Definition at line 165 of file EHPersonality.cpp.
References getCPersonality(), getCXXEHPersonality(), getObjCPersonality(), getObjCXXPersonality(), getSEHPersonalityMSVC(), clang::Target, and clang::FunctionDecl::usesSEHTry().
Referenced by clang::CIRGen::getEHPersonality(), and clang::CodeGen::getEHPersonality().
| QualType clang::CodeGenUtils::getFixedSizeElementType | ( | const ASTContext & | Ctx, |
| const VariableArrayType * | VLA ) |
Strip off the variably-modified array types wrapping VLA and return the first element type that has a fixed size.
Definition at line 15 of file ExprUtils.cpp.
References clang::ASTContext::getAsVariableArrayType(), and clang::ArrayType::getElementType().
Referenced by emitArraySubscriptGEP(), and emitArraySubscriptPtr().
| CanQual< FunctionProtoType > clang::CodeGenUtils::getFormalType | ( | const CXXMethodDecl * | MD | ) |
Returns the canonical formal type of the given C++ method.
Definition at line 13 of file CallUtils.cpp.
References clang::CanQual< T >::getAs(), clang::Type::getCanonicalTypeUnqualified(), and clang::ValueDecl::getType().
Referenced by clang::CIRGen::CIRGenTypes::arrangeCXXConstructorCall(), clang::CodeGen::CodeGenTypes::arrangeCXXConstructorCall(), clang::CodeGen::CodeGenTypes::arrangeCXXMethodDeclaration(), clang::CIRGen::CIRGenTypes::arrangeCXXStructorDeclaration(), clang::CodeGen::CodeGenTypes::arrangeCXXStructorDeclaration(), clang::CodeGen::CodeGenTypes::arrangeMSCtorClosure(), and clang::CodeGen::CodeGenTypes::arrangeUnprototypedMustTailThunk().
| LangAS clang::CodeGenUtils::getGlobalConstantAddressSpace | ( | const LangOptions & | LangOpts, |
| const TargetInfo & | Target ) |
Determines whether the language options require us to model unwind exceptions.
We treat -fexceptions as mandating this except under the fragile ObjC ABI with only ObjC exceptions enabled. This means, for example, that C with -fexceptions enables this. Return the AST address space of constant literal, which is used to emit the constant literal as global variable in LLVM IR. Note: This is not necessarily the address space of the constant literal in AST. For address space agnostic language, e.g. C++, constant literal in AST is always in default address space.
Definition at line 15 of file ModuleUtils.cpp.
References clang::cuda_device, clang::Default, clang::opencl_constant, clang::sycl_global, and clang::Target.
Referenced by generateStringLiteral(), and clang::CodeGen::CodeGenModule::GetGlobalConstantAddressSpace().
| llvm::FPClassTest clang::CodeGenUtils::getNoFPClassTestMask | ( | const LangOptions & | LangOpts | ) |
Returns the set of floating-point value kinds that the language options promise never reach a function's arguments or return value.
Definition at line 19 of file CallUtils.cpp.
Referenced by clang::CodeGen::CodeGenModule::ConstructAttributeList().
|
static |
Definition at line 67 of file EHPersonality.cpp.
References clang::ObjCRuntime::FragileMacOSX, clang::ObjCRuntime::GCC, getCPersonality(), clang::ObjCRuntime::getKind(), clang::ObjCRuntime::getVersion(), clang::CodeGenUtils::EHPersonality::GNU_CPlusPlus_SEH, clang::CodeGenUtils::EHPersonality::GNU_ObjC, clang::CodeGenUtils::EHPersonality::GNU_ObjC_SEH, clang::CodeGenUtils::EHPersonality::GNU_ObjC_SJLJ, clang::CodeGenUtils::EHPersonality::GNU_Wasm_CPlusPlus, clang::ObjCRuntime::GNUstep, clang::CodeGenUtils::EHPersonality::GNUstep_ObjC, clang::CodeGenOptions::hasSEHExceptions(), clang::CodeGenOptions::hasSjLjExceptions(), clang::ObjCRuntime::iOS, clang::ObjCRuntime::MacOSX, clang::CodeGenUtils::EHPersonality::MSVC_CxxFrameHandler3, clang::CodeGenUtils::EHPersonality::NeXT_ObjC, clang::LangOptions::ObjCRuntime, clang::ObjCRuntime::ObjFW, clang::T, clang::Target, and clang::ObjCRuntime::WatchOS.
Referenced by getEHPersonality(), and getObjCXXPersonality().
|
static |
Determines the personality function to use when both C++ and Objective-C exceptions are being caught.
Definition at line 122 of file EHPersonality.cpp.
References clang::ObjCRuntime::FragileMacOSX, clang::ObjCRuntime::GCC, getCXXEHPersonality(), clang::ObjCRuntime::getKind(), getObjCPersonality(), clang::CodeGenUtils::EHPersonality::GNU_CPlusPlus_SEH, clang::CodeGenUtils::EHPersonality::GNU_ObjCXX, clang::CodeGenUtils::EHPersonality::GNU_Wasm_CPlusPlus, clang::ObjCRuntime::GNUstep, clang::ObjCRuntime::iOS, clang::ObjCRuntime::MacOSX, clang::CodeGenUtils::EHPersonality::MSVC_CxxFrameHandler3, clang::LangOptions::ObjCRuntime, clang::ObjCRuntime::ObjFW, clang::Target, and clang::ObjCRuntime::WatchOS.
Referenced by getEHPersonality().
|
static |
Definition at line 159 of file EHPersonality.cpp.
References clang::CodeGenUtils::EHPersonality::MSVC_C_specific_handler, clang::CodeGenUtils::EHPersonality::MSVC_except_handler, and clang::T.
Referenced by getEHPersonality().
| bool clang::CodeGenUtils::hasEmptyLoopBody | ( | const LoopStmt & | S | ) |
Definition at line 39 of file StmtUtils.h.
References clang::isa().
Referenced by clang::CodeGen::CodeGenFunction::EmitDoStmt(), clang::CIRGen::CIRGenFunction::emitDoStmt(), clang::CodeGen::CodeGenFunction::EmitForStmt(), clang::CIRGen::CIRGenFunction::emitForStmt(), clang::CodeGen::CodeGenFunction::EmitWhileStmt(), and clang::CIRGen::CIRGenFunction::emitWhileStmt().
Returns whether the Neon builtin BuiltinID takes a trailing argument that discriminates the operand type.
This should be kept consistent with the logic in Sema. TODO: Make this return false for SISD builtins.
Definition at line 59 of file TargetUtils.cpp.
Referenced by clang::CodeGen::CodeGenFunction::EmitAArch64BuiltinExpr(), clang::CIRGen::CIRGenFunction::emitAArch64BuiltinExpr(), and clang::CodeGen::CodeGenFunction::EmitARMBuiltinExpr().
| bool clang::CodeGenUtils::hasOwnStorage | ( | const ASTContext & | Ctx, |
| const CXXRecordDecl * | Decl, | ||
| const CXXRecordDecl * | Query ) |
Recursively searches all of the bases of Decl to find out whether Query is not the primary vbase of some base class.
Definition at line 15 of file RecordLayoutUtils.cpp.
References clang::ASTContext::getASTRecordLayout(), clang::ASTRecordLayout::getPrimaryBase(), hasOwnStorage(), and clang::ASTRecordLayout::isPrimaryBaseVirtual().
Referenced by hasOwnStorage().
|
static |
Definition at line 40 of file ClassUtils.cpp.
References clang::CXXRecordDecl::bases(), fieldHasTrivialDestructorBody(), clang::RecordDecl::fields(), clang::CXXRecordDecl::getDestructor(), clang::FunctionDecl::hasTrivialBody(), clang::CXXRecordDecl::hasTrivialDestructor(), hasTrivialDestructorBody(), clang::NonVirtualBase, clang::CXXRecordDecl::vbases(), and clang::VirtualBase.
Referenced by fieldHasTrivialDestructorBody(), and hasTrivialDestructorBody().
| bool clang::CodeGenUtils::hasUnwindExceptions | ( | const LangOptions & | LangOpts | ) |
Definition at line 35 of file ModuleUtils.cpp.
References clang::ObjCRuntime::hasUnwindExceptions(), and clang::LangOptions::ObjCRuntime.
Referenced by clang::CIRGen::CIRGenModule::setCIRFunctionAttributesForDefinition(), and clang::CodeGen::CodeGenModule::SetLLVMFunctionAttributesForDefinition().
| bool clang::CodeGenUtils::isAAPCS | ( | const TargetInfo & | TargetInfo | ) |
Helper method to check if the underlying ABI is AAPCS.
Definition at line 83 of file TargetUtils.cpp.
References clang::TargetInfo::getABI().
Referenced by clang::CodeGen::CodeGenFunction::EmitLoadOfBitfieldLValue(), clang::CIRGen::CIRGenFunction::emitLoadOfBitfieldLValue(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CodeGenFunction::EmitStoreThroughBitfieldLValue(), and clang::CIRGen::CIRGenFunction::emitStoreThroughBitfieldLValue().
Check whether the value of E is possibly a reference to or into a __block variable.
Definition at line 24 of file ExprUtils.cpp.
References clang::Decl::hasAttr(), clang::Expr::IgnoreParens(), and isBlockVarRef().
Referenced by isBlockVarRef().
| bool clang::CodeGenUtils::isCheapEnoughToEvaluateUnconditionally | ( | const Expr * | E, |
| const ASTContext & | Ctx ) |
Check whether E is cheap enough and side-effect-free enough to evaluate unconditionally instead of conditionally.
This is used to convert control flow into selects in some cases.
Definition at line 87 of file ExprUtils.cpp.
References clang::Expr::IgnoreParens(), and clang::Expr::isEvaluatable().
| bool clang::CodeGenUtils::isDiscreteBitFieldABI | ( | const ASTContext & | Ctx, |
| const RecordDecl * | RD ) |
The Microsoft bitfield layout rule allocates discrete storage units of the field's formal type and only combines adjacent fields of the same formal type.
We want to emit a layout with these discrete storage units instead of combining them into a continuous run.
Definition at line 26 of file RecordLayoutUtils.cpp.
References clang::TargetInfo::getCXXABI(), clang::ASTContext::getTargetInfo(), clang::TargetCXXABI::isMicrosoft(), and clang::RecordDecl::isMsStruct().
| bool clang::CodeGenUtils::isEmptyFieldForLayout | ( | const ASTContext & | Ctx, |
| const FieldDecl * | FD ) |
Return true iff the field is "empty", that is, either a zero-width bit-field or an isEmptyRecordForLayout.
Definition at line 30 of file RecordLayoutUtils.cpp.
References clang::ValueDecl::getType(), isEmptyRecordForLayout(), clang::FieldDecl::isUnnamedBitField(), and clang::FieldDecl::isZeroLengthBitField().
Referenced by clang::CodeGen::CodeGenTypes::ComputeRecordLayout(), clang::CIRGen::CIRGenFunction::emitAddrOfFieldStorage(), EmitNullConstant(), emitNullConstant(), emitRawAddrOfFieldStorage(), clang::CIRGen::CIRGenModule::isEmptyFieldForMemberPointer(), and isEmptyRecordForLayout().
| bool clang::CodeGenUtils::isEmptyRecordForLayout | ( | const ASTContext & | Ctx, |
| QualType | T ) |
Return true iff a structure contains only empty base classes (per isEmptyRecordForLayout) and fields (per isEmptyFieldForLayout).
Note, C++ record fields are considered empty if the [[no_unique_address]] attribute would have made them empty, so this is not the same as isEmptyRecord.
Definition at line 40 of file RecordLayoutUtils.cpp.
References isEmptyFieldForLayout(), isEmptyRecordForLayout(), and clang::T.
Referenced by EmitNullConstant(), emitNullConstant(), isEmptyFieldForLayout(), and isEmptyRecordForLayout().
|
static |
Returns whether the given record type is incomplete.
Definition at line 141 of file ItaniumCXXABIUtils.cpp.
Referenced by containsIncompleteClassType().
| bool clang::CodeGenUtils::isInitializerOfDynamicClass | ( | const CXXCtorInitializer * | BaseInit | ) |
Return whether BaseInit initializes a base class that is dynamic, that is, one whose vtable pointer must be set before the initializer runs.
Definition at line 112 of file ClassUtils.cpp.
References clang::Type::castAsCXXRecordDecl(), clang::CXXCtorInitializer::getBaseClass(), and clang::CXXRecordDecl::isDynamicClass().
Referenced by clang::CodeGen::CodeGenFunction::EmitCtorPrologue(), and clang::CIRGen::CIRGenFunction::emitCtorPrologue().
| bool clang::CodeGenUtils::isOverlappingVBaseABI | ( | const ASTContext & | Ctx | ) |
The Itanium base layout rule allows virtual bases to overlap other bases, which complicates layout in specific ways.
Note specifically that the ms_struct attribute doesn't change this.
Definition at line 62 of file RecordLayoutUtils.cpp.
References clang::TargetInfo::getCXXABI(), clang::ASTContext::getTargetInfo(), and clang::TargetCXXABI::isMicrosoft().
Returns whether the type information for the given type exists in the standard library.
Definition at line 327 of file ItaniumCXXABIUtils.cpp.
References typeInfoIsInStandardLibrary().
|
static |
Definition at line 24 of file TargetUtils.cpp.
References clang::Type::getAs(), clang::ValueDecl::getType(), clang::FunctionType::SME_PStateSMCompatibleMask, and clang::T.
Referenced by getArmSMEInlinability().
Check whether E is a trivial array filler, that is, one that is equivalent to zero-initialization.
Definition at line 100 of file ExprUtils.cpp.
References clang::isa(), and isTrivialFiller().
Referenced by isTrivialFiller().
| bool clang::CodeGenUtils::isVarDeclStrongDefinition | ( | const ASTContext & | Ctx, |
| const VarDecl * | D, | ||
| bool | NoCommon ) |
Check whether D is a strong definition, and thus must not be given common linkage.
NoCommon reflects -fno-common.
Definition at line 52 of file ModuleUtils.cpp.
References clang::CharUnits::fromQuantity(), clang::Type::getAsRecordDecl(), clang::TargetInfo::getCXXABI(), clang::VarDecl::getInit(), clang::ASTContext::getTargetInfo(), clang::VarDecl::getTLSKind(), clang::TargetInfo::getTriple(), clang::ValueDecl::getType(), clang::ASTContext::getTypeAlignIfKnown(), clang::Decl::hasAttr(), clang::VarDecl::hasExternalStorage(), clang::ASTContext::isAlignmentRequired(), clang::TargetCXXABI::isMicrosoft(), shouldBeInCOMDAT(), and clang::ASTContext::toBits().
Referenced by clang::CIRGen::CIRGenModule::getCIRLinkageForDeclarator(), and clang::CodeGen::CodeGenModule::getLLVMLinkageForDeclarator().
| bool clang::CodeGenUtils::onlyHasInlineBuiltinDeclaration | ( | const FunctionDecl * | FD | ) |
Detect the unusual situation where an inline version of a builtin is shadowed by a non-inline version.
In that case we should pick the external one everywhere. That's GCC behavior too.
Definition at line 121 of file ExprUtils.cpp.
References clang::FunctionDecl::getPreviousDecl().
Referenced by EmitDirectCallee().
| bool clang::CodeGenUtils::requiresAMDGPUProtectedVisibility | ( | const Decl * | D, |
| bool | HasHiddenVisibility ) |
Returns whether D must be given protected visibility on AMDGPU.
HasHiddenVisibility is whether the emitted global currently has hidden visibility.
Definition at line 91 of file TargetUtils.cpp.
References clang::cast(), clang::Decl::hasAttr(), and clang::isa().
| bool clang::CodeGenUtils::shouldBeInCOMDAT | ( | const ASTContext & | Ctx, |
| const Decl & | D ) |
Check whether D should be emitted into a COMDAT group.
Definition at line 126 of file ModuleUtils.cpp.
References clang::cast(), clang::ASTContext::GetGVALinkageForFunction(), clang::ASTContext::GetGVALinkageForVariable(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::GVA_AvailableExternally, clang::GVA_DiscardableODR, clang::GVA_Internal, clang::GVA_StrongExternal, clang::GVA_StrongODR, and clang::Decl::hasAttr().
Referenced by isVarDeclStrongDefinition(), clang::CIRGen::CIRGenModule::maybeSetTrivialComdat(), and clang::CodeGen::CodeGenModule::maybeSetTrivialComdat().
| bool clang::CodeGenUtils::shouldEmitLifetimeMarkers | ( | const CodeGenOptions & | CGOpts, |
| const LangOptions & | LangOpts ) |
Decide whether we need to emit the lifetime markers.
Definition at line 21 of file FunctionUtils.cpp.
References clang::SanitizerSet::has(), and clang::LangOptions::Sanitize.
Referenced by clang::CIRGen::CIRGenFunction::CIRGenFunction().
| bool clang::CodeGenUtils::spirNullPointerNeedsGenericCast | ( | QualType | QT, |
| const llvm::Triple & | Triple ) |
Return true if a SPIR(-V) null pointer of type QT must be materialized as an addrspacecast from a generic null pointer, as the null bit pattern in non-generic address spaces is unspecified.
Definition at line 109 of file TargetUtils.cpp.
References clang::Default, clang::QualType::getAddressSpace(), clang::Type::getPointeeType(), clang::Type::getUnqualifiedDesugaredType(), clang::Type::isNullPtrType(), clang::isTargetAddressSpace(), clang::opencl_constant, clang::opencl_generic, and clang::toTargetAddressSpace().
|
static |
Given a builtin type, returns whether the type info for that type is defined in the standard library.
Definition at line 194 of file ItaniumCXXABIUtils.cpp.
References clang::BuiltinType::getKind().
Referenced by isStandardLibraryRTTIDescriptor(), and typeInfoIsInStandardLibrary().
|
static |
Definition at line 311 of file ItaniumCXXABIUtils.cpp.
References clang::Qualifiers::empty(), clang::PointerType::getPointeeType(), clang::QualType::getQualifiers(), clang::Qualifiers::removeConst(), and typeInfoIsInStandardLibrary().