|
clang 22.0.0git
|
This class organizes the cross-function state that is used while generating CIR code. More...
#include "/work/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/CIR/CodeGen/CIRGenModule.h"
Public Member Functions | |
| CIRGenModule (mlir::MLIRContext &mlirContext, clang::ASTContext &astContext, const clang::CodeGenOptions &cgo, clang::DiagnosticsEngine &diags) | |
| ~CIRGenModule () | |
| mlir::ModuleOp | getModule () const |
| CIRGenBuilderTy & | getBuilder () |
| clang::ASTContext & | getASTContext () const |
| const clang::TargetInfo & | getTarget () const |
| const clang::CodeGenOptions & | getCodeGenOpts () const |
| clang::DiagnosticsEngine & | getDiags () const |
| CIRGenTypes & | getTypes () |
| const clang::LangOptions & | getLangOpts () const |
| CIRGenCXXABI & | getCXXABI () const |
| mlir::MLIRContext & | getMLIRContext () |
| const cir::CIRDataLayout | getDataLayout () const |
| cir::LabelOp | lookupBlockAddressInfo (cir::BlockAddrInfoAttr blockInfo) |
| void | mapBlockAddress (cir::BlockAddrInfoAttr blockInfo, cir::LabelOp label) |
| void | mapUnresolvedBlockAddress (cir::BlockAddressOp op) |
| void | mapResolvedBlockAddress (cir::BlockAddressOp op, cir::LabelOp) |
| void | updateResolvedBlockAddress (cir::BlockAddressOp op, cir::LabelOp newLabel) |
| void | handleCXXStaticMemberVarInstantiation (VarDecl *vd) |
| Tell the consumer that this variable has been instantiated. | |
| mlir::Operation * | getGlobalValue (llvm::StringRef ref) |
| cir::GlobalOp | getStaticLocalDeclAddress (const VarDecl *d) |
| void | setStaticLocalDeclAddress (const VarDecl *d, cir::GlobalOp c) |
| cir::GlobalOp | getOrCreateStaticVarDecl (const VarDecl &d, cir::GlobalLinkageKind linkage) |
| cir::GlobalOp | getOrCreateCIRGlobal (llvm::StringRef mangledName, mlir::Type ty, LangAS langAS, const VarDecl *d, ForDefinition_t isForDefinition) |
| If the specified mangled name is not in the module, create and return an mlir::GlobalOp value. | |
| cir::GlobalOp | getOrCreateCIRGlobal (const VarDecl *d, mlir::Type ty, ForDefinition_t isForDefinition) |
| void | addGlobalCtor (cir::FuncOp ctor, std::optional< int > priority=std::nullopt) |
| Add a global constructor or destructor to the module. | |
| void | addGlobalDtor (cir::FuncOp dtor, std::optional< int > priority=std::nullopt) |
| Add a function to the list that will be called when the module is unloaded. | |
| bool | shouldZeroInitPadding () const |
| std::string | getUniqueGlobalName (const std::string &baseName) |
| mlir::Value | getAddrOfGlobalVar (const VarDecl *d, mlir::Type ty={}, ForDefinition_t isForDefinition=NotForDefinition) |
| Return the mlir::Value for the address of the given global variable. | |
| cir::GlobalViewAttr | getAddrOfGlobalVarAttr (const VarDecl *d) |
| Return the mlir::GlobalViewAttr for the address of the given global. | |
| CharUnits | computeNonVirtualBaseClassOffset (const CXXRecordDecl *derivedClass, llvm::iterator_range< CastExpr::path_const_iterator > path) |
| void | constructAttributeList (CIRGenCalleeInfo calleeInfo, mlir::NamedAttrList &attrs) |
| Get the CIR attributes and calling convention to use for a particular function type. | |
| cir::GlobalOp | createOrReplaceCXXRuntimeVariable (mlir::Location loc, llvm::StringRef name, mlir::Type ty, cir::GlobalLinkageKind linkage, clang::CharUnits alignment) |
| Will return a global variable of the given type. | |
| void | emitVTable (const CXXRecordDecl *rd) |
| This is a callback from Sema to tell us that a particular vtable is required to be emitted in this translation unit. | |
| cir::GlobalLinkageKind | getVTableLinkage (const CXXRecordDecl *rd) |
| Return the appropriate linkage for the vtable, VTT, and type information of the given class. | |
| mlir::Attribute | getAddrOfRTTIDescriptor (mlir::Location loc, QualType ty, bool forEH=false) |
| Get the address of the RTTI descriptor for the given type. | |
| mlir::Attribute | getConstantArrayFromStringLiteral (const StringLiteral *e) |
| Return a constant array for the given string. | |
| cir::GlobalOp | getGlobalForStringLiteral (const StringLiteral *s, llvm::StringRef name=".str") |
| Return a global symbol reference to a constant array for the given string literal. | |
| cir::GlobalViewAttr | getAddrOfConstantStringFromLiteral (const StringLiteral *s, llvm::StringRef name=".str") |
| Return a global symbol reference to a constant array for the given string literal. | |
| LangAS | getLangTempAllocaAddressSpace () const |
| Returns the address space for temporary allocations in the language. | |
| void | setCommonAttributes (GlobalDecl gd, mlir::Operation *op) |
| Set attributes which are common to any form of a global definition (alias, Objective-C method, function, global variable). | |
| const TargetCIRGenInfo & | getTargetCIRGenInfo () |
| mlir::Location | getLoc (clang::SourceLocation cLoc) |
| Helpers to convert the presumed location of Clang's SourceLocation to an MLIR Location. | |
| mlir::Location | getLoc (clang::SourceRange cRange) |
| clang::CharUnits | getClassPointerAlignment (const clang::CXXRecordDecl *rd) |
| Return the best known alignment for an unknown pointer to a particular class. | |
| clang::CharUnits | getNaturalTypeAlignment (clang::QualType t, LValueBaseInfo *baseInfo) |
| FIXME: this could likely be a common helper and not necessarily related with codegen. | |
| CharUnits | getDynamicOffsetAlignment (CharUnits actualBaseAlign, const CXXRecordDecl *baseDecl, CharUnits expectedTargetAlign) |
| TODO: Add TBAAAccessInfo. | |
| CharUnits | getVBaseAlignment (CharUnits derivedAlign, const CXXRecordDecl *derived, const CXXRecordDecl *vbase) |
| Returns the assumed alignment of a virtual base of a class. | |
| cir::FuncOp | getAddrOfCXXStructor (clang::GlobalDecl gd, const CIRGenFunctionInfo *fnInfo=nullptr, cir::FuncType fnType=nullptr, bool dontDefer=false, ForDefinition_t isForDefinition=NotForDefinition) |
| std::pair< cir::FuncType, cir::FuncOp > | getAddrAndTypeOfCXXStructor (clang::GlobalDecl gd, const CIRGenFunctionInfo *fnInfo=nullptr, cir::FuncType fnType=nullptr, bool dontDefer=false, ForDefinition_t isForDefinition=NotForDefinition) |
| mlir::Type | getVTableComponentType () |
| CIRGenVTables & | getVTables () |
| ItaniumVTableContext & | getItaniumVTableContext () |
| const ItaniumVTableContext & | getItaniumVTableContext () const |
| void | addDeferredDeclToEmit (clang::GlobalDecl GD) |
| void | emitTopLevelDecl (clang::Decl *decl) |
| bool | mustBeEmitted (const clang::ValueDecl *d) |
Determine whether the definition must be emitted; if this returns false, the definition can be emitted lazily if it's used. | |
| bool | mayBeEmittedEagerly (const clang::ValueDecl *d) |
| Determine whether the definition can be emitted eagerly, or should be delayed until the end of the translation unit. | |
| bool | verifyModule () const |
| cir::FuncOp | getAddrOfFunction (clang::GlobalDecl gd, mlir::Type funcType=nullptr, bool forVTable=false, bool dontDefer=false, ForDefinition_t isForDefinition=NotForDefinition) |
| Return the address of the given function. | |
| mlir::Operation * | getAddrOfGlobal (clang::GlobalDecl gd, ForDefinition_t isForDefinition=NotForDefinition) |
| bool | shouldEmitRTTI (bool forEH=false) |
| void | emitExplicitCastExprType (const ExplicitCastExpr *e, CIRGenFunction *cgf=nullptr) |
| Emit type info if type of an expression is a variably modified type. | |
| void | emitGlobal (clang::GlobalDecl gd) |
| Emit code for a single global function or variable declaration. | |
| void | emitAliasForGlobal (llvm::StringRef mangledName, mlir::Operation *op, GlobalDecl aliasGD, cir::FuncOp aliasee, cir::GlobalLinkageKind linkage) |
| mlir::Type | convertType (clang::QualType type) |
| void | setGlobalVisibility (mlir::Operation *op, const NamedDecl *d) const |
| Set the visibility for the given global. | |
| void | setDSOLocal (mlir::Operation *op) const |
| void | setDSOLocal (cir::CIRGlobalValueInterface gv) const |
| void | setGVProperties (mlir::Operation *op, const NamedDecl *d) const |
| Set visibility, dllimport/dllexport and dso_local. | |
| void | setGVPropertiesAux (mlir::Operation *op, const NamedDecl *d) const |
| void | setTLSMode (mlir::Operation *op, const VarDecl &d) |
| Set TLS mode for the given operation based on the given variable declaration. | |
| cir::TLS_Model | getDefaultCIRTLSModel () const |
| Get TLS mode from CodeGenOptions. | |
| void | setFunctionAttributes (GlobalDecl gd, cir::FuncOp f, bool isIncompleteFunction, bool isThunk) |
| Set function attributes for a function declaration. | |
| void | setCIRFunctionAttributesForDefinition (const clang::FunctionDecl *fd, cir::FuncOp f) |
| Set extra attributes (inline, etc.) for a function. | |
| void | emitGlobalDefinition (clang::GlobalDecl gd, mlir::Operation *op=nullptr) |
| void | emitGlobalFunctionDefinition (clang::GlobalDecl gd, mlir::Operation *op) |
| void | emitGlobalVarDefinition (const clang::VarDecl *vd, bool isTentative=false) |
| void | emitCXXGlobalVarDeclInit (const VarDecl *varDecl, cir::GlobalOp addr, bool performInit) |
| Emit the function that initializes the specified global. | |
| void | emitCXXGlobalVarDeclInitFunc (const VarDecl *vd, cir::GlobalOp addr, bool performInit) |
| void | emitGlobalOpenACCDecl (const clang::OpenACCConstructDecl *cd) |
| void | emitGlobalOpenACCRoutineDecl (const clang::OpenACCRoutineDecl *cd) |
| void | emitGlobalOpenACCDeclareDecl (const clang::OpenACCDeclareDecl *cd) |
| template<typename BeforeOpTy, typename DataClauseTy> | |
| void | emitGlobalOpenACCDeclareDataOperands (const Expr *varOperand, DataClauseTy dataClause, OpenACCModifierKind modifiers, bool structured, bool implicit, bool requiresDtor) |
| void | emitOpenACCRoutineDecl (const clang::FunctionDecl *funcDecl, cir::FuncOp func, SourceLocation pragmaLoc, ArrayRef< const OpenACCClause * > clauses) |
| void | emitOMPThreadPrivateDecl (const OMPThreadPrivateDecl *d) |
| void | emitOMPGroupPrivateDecl (const OMPGroupPrivateDecl *d) |
| void | emitOMPCapturedExpr (const OMPCapturedExprDecl *d) |
| void | emitOMPAllocateDecl (const OMPAllocateDecl *d) |
| void | emitOMPDeclareReduction (const OMPDeclareReductionDecl *d) |
| void | emitOMPDeclareMapper (const OMPDeclareMapperDecl *d) |
| void | emitOMPRequiresDecl (const OMPRequiresDecl *d) |
| void | emitDeclContext (const DeclContext *dc) |
| mlir::Value | emitNullConstant (QualType t, mlir::Location loc) |
| Return the result of value-initializing the given type, i.e. | |
| mlir::TypedAttr | emitNullConstantAttr (QualType t) |
| mlir::TypedAttr | emitNullConstantForBase (const CXXRecordDecl *record) |
| Return a null constant appropriate for zero-initializing a base class with the given type. | |
| mlir::Value | emitMemberPointerConstant (const UnaryOperator *e) |
| llvm::StringRef | getMangledName (clang::GlobalDecl gd) |
| std::string | getOpenACCBindMangledName (const IdentifierInfo *bindName, const FunctionDecl *attachedFunction) |
| void | emitTentativeDefinition (const VarDecl *d) |
| void | updateCompletedType (const clang::TagDecl *td) |
| cir::FuncOp | codegenCXXStructor (clang::GlobalDecl gd) |
| bool | supportsCOMDAT () const |
| void | maybeSetTrivialComdat (const clang::Decl &d, mlir::Operation *op) |
| void | replaceUsesOfNonProtoTypeWithRealFunction (mlir::Operation *old, cir::FuncOp newFn) |
| This function is called when we implement a function with no prototype, e.g. | |
| cir::FuncOp | getOrCreateCIRFunction (llvm::StringRef mangledName, mlir::Type funcType, clang::GlobalDecl gd, bool forVTable, bool dontDefer=false, bool isThunk=false, ForDefinition_t isForDefinition=NotForDefinition, mlir::ArrayAttr extraAttrs={}) |
| cir::FuncOp | createCIRFunction (mlir::Location loc, llvm::StringRef name, cir::FuncType funcType, const clang::FunctionDecl *funcDecl) |
| cir::FuncOp | createCIRBuiltinFunction (mlir::Location loc, llvm::StringRef name, cir::FuncType ty, const clang::FunctionDecl *fd) |
| Create a CIR function with builtin attribute set. | |
| void | setCXXSpecialMemberAttr (cir::FuncOp funcOp, const clang::FunctionDecl *funcDecl) |
| Mark the function as a special member (e.g. constructor, destructor) | |
| cir::FuncOp | createRuntimeFunction (cir::FuncType ty, llvm::StringRef name, mlir::ArrayAttr={}, bool isLocal=false, bool assumeConvergent=false) |
| cir::FuncOp | getBuiltinLibFunction (const FunctionDecl *fd, unsigned builtinID) |
| Given a builtin id for a function like "__builtin_fabsf", return a Function* for "fabsf". | |
| mlir::IntegerAttr | getSize (CharUnits size) |
| void | emitDeferred () |
| Emit any needed decls for which code generation was deferred. | |
| void | emitGlobalDecl (const clang::GlobalDecl &d) |
| Helper for emitDeferred to apply actual codegen. | |
| const llvm::Triple & | getTriple () const |
| void | release () |
| cir::VisibilityAttr | getGlobalVisibilityAttrFromDecl (const Decl *decl) |
| cir::GlobalLinkageKind | getFunctionLinkage (GlobalDecl gd) |
| cir::GlobalLinkageKind | getCIRLinkageForDeclarator (const DeclaratorDecl *dd, GVALinkage linkage, bool isConstantVariable) |
| void | setFunctionLinkage (GlobalDecl gd, cir::FuncOp f) |
| cir::GlobalLinkageKind | getCIRLinkageVarDefinition (const VarDecl *vd, bool isConstant) |
| void | addReplacement (llvm::StringRef name, mlir::Operation *op) |
| DiagnosticBuilder | errorNYI (SourceLocation, llvm::StringRef) |
| Helpers to emit "not yet implemented" error diagnostics. | |
| template<typename T> | |
| DiagnosticBuilder | errorNYI (SourceLocation loc, llvm::StringRef feature, const T &name) |
| DiagnosticBuilder | errorNYI (mlir::Location loc, llvm::StringRef feature) |
| DiagnosticBuilder | errorNYI (llvm::StringRef feature) const |
| DiagnosticBuilder | errorNYI (SourceRange, llvm::StringRef) |
| template<typename T> | |
| DiagnosticBuilder | errorNYI (SourceRange loc, llvm::StringRef feature, const T &name) |
| Public Member Functions inherited from clang::CIRGen::CIRGenTypeCache | |
| CIRGenTypeCache () | |
| clang::CharUnits | getSizeSize () const |
| clang::CharUnits | getSizeAlign () const |
| clang::CharUnits | getPointerAlign () const |
| cir::TargetAddressSpaceAttr | getCIRAllocaAddressSpace () const |
Static Public Member Functions | |
| static cir::GlobalOp | createGlobalOp (CIRGenModule &cgm, mlir::Location loc, llvm::StringRef name, mlir::Type t, bool isConstant=false, mlir::Operation *insertPoint=nullptr) |
| static mlir::SymbolTable::Visibility | getMLIRVisibility (Visibility v) |
| static void | setInitializer (cir::GlobalOp &op, mlir::Attribute value) |
| static mlir::SymbolTable::Visibility | getMLIRVisibilityFromCIRLinkage (cir::GlobalLinkageKind GLK) |
| static cir::VisibilityKind | getGlobalVisibilityKindFromClangVisibility (clang::VisibilityAttr::VisibilityType visibility) |
| static mlir::SymbolTable::Visibility | getMLIRVisibility (cir::GlobalOp op) |
Public Attributes | |
| mlir::Operation * | lastGlobalOp = nullptr |
| llvm::DenseMap< const clang::FieldDecl *, llvm::StringRef > | lambdaFieldToName |
| Keep a map between lambda fields and names, this needs to be per module since lambdas might get generated later as part of defered work, and since the pointers are supposed to be uniqued, should be fine. | |
| llvm::DenseMap< cir::BlockAddrInfoAttr, cir::LabelOp > | blockAddressInfoToLabel |
| Map BlockAddrInfoAttr (function name, label name) to the corresponding CIR LabelOp. | |
| llvm::MapVector< cir::BlockAddressOp, cir::LabelOp > | blockAddressToLabel |
| Map CIR BlockAddressOps directly to their resolved LabelOps. | |
| llvm::DenseSet< cir::BlockAddressOp > | unresolvedBlockAddressToLabel |
| Track CIR BlockAddressOps that cannot be resolved immediately because their LabelOp has not yet been emitted. | |
| llvm::DenseMap< const Decl *, cir::GlobalOp > | staticLocalDeclMap |
| llvm::StringMap< unsigned > | cgGlobalNames |
| llvm::DenseMap< mlir::Attribute, cir::GlobalOp > | constantStringMap |
| std::map< llvm::StringRef, clang::GlobalDecl > | deferredDecls |
| This contains all the decls which have definitions but which are deferred for emission and therefore should only be output if they are actually used. | |
| std::vector< clang::GlobalDecl > | deferredDeclsToEmit |
| unsigned | routineCounter = 0 |
| Public Attributes inherited from clang::CIRGen::CIRGenTypeCache | |
| cir::VoidType | voidTy |
| cir::IntType | sInt8Ty |
| cir::IntType | sInt16Ty |
| cir::IntType | sInt32Ty |
| cir::IntType | sInt64Ty |
| cir::IntType | sInt128Ty |
| cir::IntType | uInt8Ty |
| cir::IntType | uInt16Ty |
| cir::IntType | uInt32Ty |
| cir::IntType | uInt64Ty |
| cir::IntType | uInt128Ty |
| cir::FP16Type | fP16Ty |
| cir::BF16Type | bFloat16Ty |
| cir::SingleType | floatTy |
| cir::DoubleType | doubleTy |
| cir::FP80Type | fP80Ty |
| cir::FP128Type | fP128Ty |
| mlir::Type | uCharTy |
| ClangIR char. | |
| union { | |
| mlir::Type uIntPtrTy | |
| mlir::Type sizeTy | |
| }; | |
| intptr_t, size_t, and ptrdiff_t, which we assume are the same size. | |
| mlir::Type | ptrDiffTy |
| cir::PointerType | voidPtrTy |
| void* in address space 0 | |
| cir::PointerType | uInt8PtrTy |
| cir::PointerType | allocaInt8PtrTy |
| void* in alloca address space | |
| union { | |
| unsigned char PointerAlignInBytes | |
| unsigned char PointerSizeInBytes | |
| }; | |
| The size and alignment of a pointer into the generic address space. | |
| union { | |
| unsigned char SizeSizeInBytes | |
| unsigned char SizeAlignInBytes | |
| }; | |
| The size and alignment of size_t. | |
| cir::TargetAddressSpaceAttr | cirAllocaAddressSpace |
Static Public Attributes | |
| static constexpr const char * | builtinCoroId = "__builtin_coro_id" |
| static constexpr const char * | builtinCoroAlloc = "__builtin_coro_alloc" |
| static constexpr const char * | builtinCoroBegin = "__builtin_coro_begin" |
This class organizes the cross-function state that is used while generating CIR code.
Definition at line 56 of file CIRGenModule.h.
| CIRGenModule::CIRGenModule | ( | mlir::MLIRContext & | mlirContext, |
| clang::ASTContext & | astContext, | ||
| const clang::CodeGenOptions & | cgo, | ||
| clang::DiagnosticsEngine & | diags ) |
Definition at line 63 of file CIRGenModule.cpp.
References clang::CIRGen::CIRGenTypeCache::allocaInt8PtrTy, clang::CIRGen::CIRGenTypeCache::bFloat16Ty, clang::CIRGen::CIRGenTypeCache::cirAllocaAddressSpace, createCXXABI(), clang::Default, clang::CIRGen::CIRGenTypeCache::doubleTy, clang::CIRGen::CIRGenTypeCache::floatTy, clang::CIRGen::CIRGenTypeCache::fP128Ty, clang::CIRGen::CIRGenTypeCache::fP16Ty, clang::CIRGen::CIRGenTypeCache::fP80Ty, clang::CIRGen::TargetCIRGenInfo::getCIRAllocaAddressSpace(), getLangOpts(), getMLIRContext(), getTargetCIRGenInfo(), getTriple(), clang::CIRGen::CIRGenTypeCache::PointerAlignInBytes, clang::CIRGen::CIRGenTypeCache::ptrDiffTy, clang::CIRGen::CIRGenTypeCache::sInt128Ty, clang::CIRGen::CIRGenTypeCache::sInt16Ty, clang::CIRGen::CIRGenTypeCache::sInt32Ty, clang::CIRGen::CIRGenTypeCache::sInt64Ty, clang::CIRGen::CIRGenTypeCache::sInt8Ty, clang::CIRGen::CIRGenTypeCache::SizeSizeInBytes, clang::FileEntry::tryGetRealPathName(), clang::CIRGen::CIRGenTypeCache::uCharTy, clang::CIRGen::CIRGenTypeCache::uInt128Ty, clang::CIRGen::CIRGenTypeCache::uInt16Ty, clang::CIRGen::CIRGenTypeCache::uInt32Ty, clang::CIRGen::CIRGenTypeCache::uInt64Ty, clang::CIRGen::CIRGenTypeCache::uInt8PtrTy, clang::CIRGen::CIRGenTypeCache::uInt8Ty, clang::CIRGen::CIRGenTypeCache::uIntPtrTy, clang::CIRGen::CIRGenTypeCache::voidPtrTy, and clang::CIRGen::CIRGenTypeCache::voidTy.
|
default |
|
inline |
Definition at line 388 of file CIRGenModule.h.
References deferredDeclsToEmit.
Referenced by emitGlobal(), and getOrCreateCIRFunction().
| void CIRGenModule::addGlobalCtor | ( | cir::FuncOp | ctor, |
| std::optional< int > | priority = std::nullopt ) |
Add a global constructor or destructor to the module.
Track functions to be called before main() runs.
The priority is optional, if not specified, the default priority is used.
Definition at line 483 of file CIRGenModule.cpp.
References cir::MissingFeatures::globalCtorAssociatedData(), and cir::MissingFeatures::globalCtorLexOrder().
Referenced by emitGlobalFunctionDefinition().
| void CIRGenModule::addGlobalDtor | ( | cir::FuncOp | dtor, |
| std::optional< int > | priority = std::nullopt ) |
Add a function to the list that will be called when the module is unloaded.
Definition at line 497 of file CIRGenModule.cpp.
References errorNYI(), getASTContext(), and getTriple().
Referenced by emitGlobalFunctionDefinition().
| void CIRGenModule::addReplacement | ( | llvm::StringRef | name, |
| mlir::Operation * | op ) |
Definition at line 1056 of file CIRGenModule.cpp.
| cir::FuncOp CIRGenModule::codegenCXXStructor | ( | clang::GlobalDecl | gd | ) |
Definition at line 170 of file CIRGenCXX.cpp.
References clang::CIRGen::CIRGenTypes::arrangeCXXStructorDeclaration(), clang::CIRGen::ForDefinition, clang::CIRGen::CIRGenFunction::generateCode(), getAddrOfCXXStructor(), clang::GlobalDecl::getDecl(), clang::CIRGen::CIRGenTypes::getFunctionType(), getTypes(), setCIRFunctionAttributesForDefinition(), and setFunctionLinkage().
| CharUnits CIRGenModule::computeNonVirtualBaseClassOffset | ( | const CXXRecordDecl * | derivedClass, |
| llvm::iterator_range< CastExpr::path_const_iterator > | path ) |
Definition at line 2657 of file CIRGenModule.cpp.
References getASTContext(), clang::ASTRecordLayout::getBaseClassOffset(), and clang::CharUnits::Zero().
| void CIRGenModule::constructAttributeList | ( | CIRGenCalleeInfo | calleeInfo, |
| mlir::NamedAttrList & | attrs ) |
Get the CIR attributes and calling convention to use for a particular function type.
Construct the CIR attribute list of a function or call.
| calleeInfo | - The callee information these attributes are being constructed for. If valid, the attributes applied to this decl may contribute to the function attributes and calling convention. |
Definition at line 113 of file CIRGenCall.cpp.
References addAttributesFromFunctionProtoType(), clang::CIRGen::Decl, getBuilder(), clang::CIRGen::CIRGenCalleeInfo::getCalleeDecl(), clang::CIRGen::CIRGenCalleeInfo::getCalleeFunctionProtoType(), clang::GlobalDecl::getDecl(), getMLIRContext(), clang::Decl::hasAttr(), cir::MissingFeatures::opCallAttrs(), and cir::MissingFeatures::opCallCallConv().
| mlir::Type CIRGenModule::convertType | ( | clang::QualType | type | ) |
Definition at line 2628 of file CIRGenModule.cpp.
References clang::ast_matchers::type.
Referenced by emitGlobalVarDefinition(), emitMemberPointerConstant(), getAddrOfFunction(), getBuiltinLibFunction(), getConstantArrayFromStringLiteral(), getOrCreateStaticVarDecl(), and setCXXSpecialMemberAttr().
| cir::FuncOp CIRGenModule::createCIRBuiltinFunction | ( | mlir::Location | loc, |
| llvm::StringRef | name, | ||
| cir::FuncType | ty, | ||
| const clang::FunctionDecl * | fd ) |
Create a CIR function with builtin attribute set.
Definition at line 2423 of file CIRGenModule.cpp.
References createCIRFunction().
| cir::FuncOp CIRGenModule::createCIRFunction | ( | mlir::Location | loc, |
| llvm::StringRef | name, | ||
| cir::FuncType | funcType, | ||
| const clang::FunctionDecl * | funcDecl ) |
Definition at line 2371 of file CIRGenModule.cpp.
References clang::CIRGen::CIRGenFunction::curFn, emitOpenACCRoutineDecl(), getLangOpts(), getMLIRContext(), clang::FunctionDecl::hasPrototype(), cir::MissingFeatures::opFuncAstDeclAttr(), cir::MissingFeatures::opFuncExtraAttrs(), setCXXSpecialMemberAttr(), and clang::Decl::specific_attrs().
Referenced by createCIRBuiltinFunction(), emitAliasForGlobal(), and getOrCreateCIRFunction().
|
static |
Definition at line 525 of file CIRGenModule.cpp.
References getBuilder(), getModule(), and lastGlobalOp.
Referenced by createOrReplaceCXXRuntimeVariable(), and generateStringLiteral().
| cir::GlobalOp CIRGenModule::createOrReplaceCXXRuntimeVariable | ( | mlir::Location | loc, |
| llvm::StringRef | name, | ||
| mlir::Type | ty, | ||
| cir::GlobalLinkageKind | linkage, | ||
| clang::CharUnits | alignment ) |
Will return a global variable of the given type.
If a variable with a different type already exists then a new variable with the right type will be created and all uses of the old variable will be replaced with a bitcast to the new variable.
Definition at line 1115 of file CIRGenModule.cpp.
References createGlobalOp(), errorNYI(), getMLIRContext(), getMLIRVisibility(), getSize(), cir::isWeakForLinker(), setDSOLocal(), and supportsCOMDAT().
| cir::FuncOp CIRGenModule::createRuntimeFunction | ( | cir::FuncType | ty, |
| llvm::StringRef | name, | ||
| mlir::ArrayAttr | = {}, | ||
| bool | isLocal = false, | ||
| bool | assumeConvergent = false ) |
Definition at line 2498 of file CIRGenModule.cpp.
References errorNYI(), getOrCreateCIRFunction(), cir::MissingFeatures::opFuncCallingConv(), cir::MissingFeatures::setLLVMFunctionFEnvAttributes(), and setWindowsItaniumDLLImport().
Referenced by getBadCastFn(), getItaniumDynamicCastFn(), and getPersonalityFn().
| void CIRGenModule::emitAliasForGlobal | ( | llvm::StringRef | mangledName, |
| mlir::Operation * | op, | ||
| GlobalDecl | aliasGD, | ||
| cir::FuncOp | aliasee, | ||
| cir::GlobalLinkageKind | linkage ) |
Definition at line 2588 of file CIRGenModule.cpp.
References clang::CIRGen::CIRGenTypes::arrangeCXXStructorDeclaration(), createCIRFunction(), errorNYI(), clang::GlobalDecl::getDecl(), clang::CIRGen::CIRGenTypes::getFunctionType(), getLoc(), clang::Decl::getSourceRange(), getTypes(), cir::MissingFeatures::opGlobalUnnamedAddr(), and setCommonAttributes().
Referenced by emitConstructorDestructorAlias().
| void CIRGenModule::emitCXXGlobalVarDeclInit | ( | const VarDecl * | varDecl, |
| cir::GlobalOp | addr, | ||
| bool | performInit ) |
Emit the function that initializes the specified global.
Definition at line 198 of file CIRGenCXX.cpp.
References cir::MissingFeatures::addressSpace(), cir::MissingFeatures::astVarDeclInterface(), clang::QualType::DK_cxx_destructor, emitDeclDestroy(), emitDeclInit(), errorNYI(), getASTContext(), getLoc(), clang::Type::isReferenceType(), cir::MissingFeatures::openMP(), and clang::ast_matchers::varDecl.
Referenced by emitCXXGlobalVarDeclInitFunc().
| void CIRGenModule::emitCXXGlobalVarDeclInitFunc | ( | const VarDecl * | vd, |
| cir::GlobalOp | addr, | ||
| bool | performInit ) |
Definition at line 20 of file CIRGenDeclCXX.cpp.
References cir::MissingFeatures::cudaSupport(), cir::MissingFeatures::deferredCXXGlobalInit(), and emitCXXGlobalVarDeclInit().
Referenced by emitGlobalVarDefinition().
| void CIRGenModule::emitDeclContext | ( | const DeclContext * | dc | ) |
Definition at line 1533 of file CIRGenModule.cpp.
References clang::CIRGen::Decl, clang::ast_matchers::decl, clang::DeclContext::decls(), emitTopLevelDecl(), and errorNYI().
Referenced by emitTopLevelDecl().
| void CIRGenModule::emitDeferred | ( | ) |
Emit any needed decls for which code generation was deferred.
Definition at line 330 of file CIRGenModule.cpp.
References cir::MissingFeatures::cudaSupport(), deferredDeclsToEmit, cir::MissingFeatures::deferredVtables(), emitDeferred(), emitGlobalDecl(), and cir::MissingFeatures::openMP().
Referenced by emitDeferred(), and release().
| void CIRGenModule::emitExplicitCastExprType | ( | const ExplicitCastExpr * | e, |
| CIRGenFunction * | cgf = nullptr ) |
Emit type info if type of an expression is a variably modified type.
Also emit proper debug info for cast types.
Definition at line 1504 of file CIRGenModule.cpp.
References clang::CIRGen::CIRGenFunction::emitVariablyModifiedType(), cir::MissingFeatures::generateDebugInfo(), clang::Expr::getType(), and clang::Type::isVariablyModifiedType().
| void CIRGenModule::emitGlobal | ( | clang::GlobalDecl | gd | ) |
Emit code for a single global function or variable declaration.
Forward declarations are emitted lazily.
Definition at line 361 of file CIRGenModule.cpp.
References addDeferredDeclToEmit(), clang::cast(), cir::MissingFeatures::deferredCXXGlobalInit(), deferredDecls, clang::VarDecl::Definition, emitGlobalDefinition(), emitGlobalOpenACCDecl(), errorNYI(), getAddrOfGlobalVar(), clang::GlobalDecl::getDecl(), getGlobalValue(), getMangledName(), mayBeEmittedEagerly(), mustBeEmitted(), cir::MissingFeatures::openMP(), and clang::ASTContext::Strong.
Referenced by emitTopLevelDecl().
| void CIRGenModule::emitGlobalDecl | ( | const clang::GlobalDecl & | d | ) |
Helper for emitDeferred to apply actual codegen.
Definition at line 292 of file CIRGenModule.cpp.
References emitGlobalDefinition(), clang::CIRGen::ForDefinition, getAddrOfGlobal(), getGlobalValue(), getMangledName(), getModule(), and cir::MissingFeatures::openMP().
Referenced by emitDeferred().
| void CIRGenModule::emitGlobalDefinition | ( | clang::GlobalDecl | gd, |
| mlir::Operation * | op = nullptr ) |
Definition at line 921 of file CIRGenModule.cpp.
References clang::cast(), clang::ast_matchers::decl, emitGlobalFunctionDefinition(), emitGlobalVarDefinition(), clang::CIRGen::CIRGenVTables::emitThunks(), errorNYI(), clang::GlobalDecl::getDecl(), getVTables(), and clang::isa().
Referenced by emitGlobal(), and emitGlobalDecl().
| void CIRGenModule::emitGlobalFunctionDefinition | ( | clang::GlobalDecl | gd, |
| mlir::Operation * | op ) |
Definition at line 434 of file CIRGenModule.cpp.
References addGlobalCtor(), addGlobalDtor(), clang::CIRGen::CIRGenTypes::arrangeGlobalDeclaration(), clang::cast(), errorNYI(), clang::Expr::EvaluateKnownConstInt(), clang::CIRGen::ForDefinition, clang::CIRGen::CIRGenFunction::generateCode(), getAddrOfFunction(), getASTContext(), clang::GlobalDecl::getDecl(), clang::CIRGen::CIRGenTypes::getFunctionType(), getTypes(), maybeSetTrivialComdat(), cir::MissingFeatures::opFuncMaybeHandleStaticInExternC(), setCIRFunctionAttributesForDefinition(), setFunctionLinkage(), setGVProperties(), and cir::MissingFeatures::setLLVMFunctionFEnvAttributes().
Referenced by emitGlobalDefinition().
| void CIRGenModule::emitGlobalOpenACCDecl | ( | const clang::OpenACCConstructDecl * | cd | ) |
Definition at line 102 of file CIRGenDeclOpenACC.cpp.
References clang::cast(), emitGlobalOpenACCDeclareDecl(), and emitGlobalOpenACCRoutineDecl().
Referenced by emitGlobal().
| void CIRGenModule::emitGlobalOpenACCDeclareDataOperands | ( | const Expr * | varOperand, |
| DataClauseTy | dataClause, | ||
| OpenACCModifierKind | modifiers, | ||
| bool | structured, | ||
| bool | implicit, | ||
| bool | requiresDtor ) |
Definition at line 141 of file CIRGenDeclOpenACC.cpp.
References clang::CIRGen::CIRGenFunction::OpenACCDataOperandInfo::bounds, clang::cast(), clang::CIRGen::convertOpenACCModifiers(), clang::CIRGen::CIRGenFunction::curFn, clang::CIRGen::Decl, clang::Stmt::getBeginLoc(), getDeclareReferencedDecl(), getLoc(), getMangledName(), getMLIRContext(), getModule(), clang::CIRGen::CIRGenFunction::getOpenACCDataOperandInfo(), clang::CIRGen::CIRGenFunction::OpenACCDataOperandInfo::name, and clang::CIRGen::CIRGenFunction::OpenACCDataOperandInfo::varValue.
| void CIRGenModule::emitGlobalOpenACCDeclareDecl | ( | const clang::OpenACCDeclareDecl * | cd | ) |
Definition at line 280 of file CIRGenDeclOpenACC.cpp.
References clang::OpenACCConstructDecl::clauses().
Referenced by emitGlobalOpenACCDecl(), and emitTopLevelDecl().
| void CIRGenModule::emitGlobalOpenACCRoutineDecl | ( | const clang::OpenACCRoutineDecl * | cd | ) |
Definition at line 296 of file CIRGenDeclOpenACC.cpp.
Referenced by emitGlobalOpenACCDecl(), and emitTopLevelDecl().
| void CIRGenModule::emitGlobalVarDefinition | ( | const clang::VarDecl * | vd, |
| bool | isTentative = false ) |
Definition at line 771 of file CIRGenModule.cpp.
References convertType(), clang::CPlusPlus, cir::MissingFeatures::cudaSupport(), cir::MissingFeatures::deferredCXXGlobalInit(), clang::QualType::DK_cxx_destructor, emitCXXGlobalVarDeclInitFunc(), errorNYI(), clang::VarDecl::getAnyInitializer(), getBuilder(), getCIRLinkageVarDefinition(), getLangOpts(), getMLIRVisibilityFromCIRLinkage(), getOrCreateCIRGlobal(), clang::VarDecl::getSourceRange(), clang::Expr::getType(), clang::ValueDecl::getType(), clang::GVA_AvailableExternally, clang::Decl::hasAttr(), clang::VarDecl::hasConstantInitialization(), clang::VarDecl::hasFlexibleArrayInit(), clang::QualType::isConstantStorage(), clang::Type::isIncompleteType(), clang::Type::isReferenceType(), cir::MissingFeatures::maybeHandleStaticInExternC(), maybeSetTrivialComdat(), clang::VarDecl::needsDestruction(), clang::OpenCL, cir::MissingFeatures::opGlobalDLLImportExport(), cir::MissingFeatures::opGlobalSection(), cir::MissingFeatures::opGlobalThreadLocal(), and setInitializer().
Referenced by emitGlobalDefinition(), and emitTentativeDefinition().
| mlir::Value CIRGenModule::emitMemberPointerConstant | ( | const UnaryOperator * | e | ) |
Definition at line 1513 of file CIRGenModule.cpp.
References clang::cast(), convertType(), cir::MissingFeatures::cxxABI(), clang::ast_matchers::decl, errorNYI(), clang::ast_matchers::fieldDecl, getLoc(), clang::Stmt::getSourceRange(), clang::UnaryOperator::getSubExpr(), clang::Expr::getType(), and clang::isa().
| mlir::Value CIRGenModule::emitNullConstant | ( | QualType | t, |
| mlir::Location | loc ) |
Return the result of value-initializing the given type, i.e.
a null expression of the given type.
Definition at line 1934 of file CIRGenExprConstant.cpp.
References emitNullConstantAttr().
| mlir::TypedAttr CIRGenModule::emitNullConstantAttr | ( | QualType | t | ) |
Definition at line 1938 of file CIRGenExprConstant.cpp.
References errorNYI(), clang::Type::getAs(), getASTContext(), getTypes(), and clang::Type::isMemberDataPointerType().
Referenced by emitNullConstant(), and emitNullConstant().
| mlir::TypedAttr CIRGenModule::emitNullConstantForBase | ( | const CXXRecordDecl * | record | ) |
Return a null constant appropriate for zero-initializing a base class with the given type.
This is usually, but not always, an LLVM null constant.
Definition at line 1961 of file CIRGenExprConstant.cpp.
Referenced by emitNullBaseClassInitialization().
| void CIRGenModule::emitOMPAllocateDecl | ( | const OMPAllocateDecl * | d | ) |
Definition at line 67 of file CIRGenDeclOpenMP.cpp.
References errorNYI(), and clang::Decl::getSourceRange().
Referenced by emitTopLevelDecl().
| void CIRGenModule::emitOMPCapturedExpr | ( | const OMPCapturedExprDecl * | d | ) |
Definition at line 51 of file CIRGenDeclOpenMP.cpp.
References errorNYI(), and clang::OMPCapturedExprDecl::getSourceRange().
Referenced by emitTopLevelDecl().
| void CIRGenModule::emitOMPDeclareMapper | ( | const OMPDeclareMapperDecl * | d | ) |
Definition at line 99 of file CIRGenDeclOpenMP.cpp.
References errorNYI(), and clang::Decl::getSourceRange().
Referenced by emitTopLevelDecl().
| void CIRGenModule::emitOMPDeclareReduction | ( | const OMPDeclareReductionDecl * | d | ) |
Definition at line 83 of file CIRGenDeclOpenMP.cpp.
References errorNYI(), and clang::Decl::getSourceRange().
Referenced by emitTopLevelDecl().
| void CIRGenModule::emitOMPGroupPrivateDecl | ( | const OMPGroupPrivateDecl * | d | ) |
Definition at line 35 of file CIRGenDeclOpenMP.cpp.
References errorNYI(), and clang::Decl::getSourceRange().
Referenced by emitTopLevelDecl().
| void CIRGenModule::emitOMPRequiresDecl | ( | const OMPRequiresDecl * | d | ) |
Definition at line 115 of file CIRGenDeclOpenMP.cpp.
References errorNYI(), and clang::Decl::getSourceRange().
Referenced by emitTopLevelDecl().
| void CIRGenModule::emitOMPThreadPrivateDecl | ( | const OMPThreadPrivateDecl * | d | ) |
Definition at line 19 of file CIRGenDeclOpenMP.cpp.
References errorNYI(), and clang::Decl::getSourceRange().
Referenced by emitTopLevelDecl().
| void CIRGenModule::emitOpenACCRoutineDecl | ( | const clang::FunctionDecl * | funcDecl, |
| cir::FuncOp | func, | ||
| SourceLocation | pragmaLoc, | ||
| ArrayRef< const OpenACCClause * > | clauses ) |
Definition at line 388 of file CIRGenDeclOpenACC.cpp.
References getLoc(), getModule(), and routineCounter.
Referenced by createCIRFunction().
| void CIRGenModule::emitTentativeDefinition | ( | const VarDecl * | d | ) |
Definition at line 1871 of file CIRGenModule.cpp.
References deferredDecls, emitGlobalVarDefinition(), getGlobalValue(), clang::VarDecl::getInit(), getMangledName(), and mustBeEmitted().
| void CIRGenModule::emitTopLevelDecl | ( | clang::Decl * | decl | ) |
Definition at line 1548 of file CIRGenModule.cpp.
References clang::cast(), clang::Decl::castToDeclContext(), clang::CIRGen::Decl, clang::ast_matchers::decl, clang::DeclContext::decls(), clang::CIRGen::CIRGenCXXABI::emitCXXConstructors(), clang::CIRGen::CIRGenCXXABI::emitCXXDestructors(), emitDeclContext(), emitGlobal(), emitGlobalOpenACCDeclareDecl(), emitGlobalOpenACCRoutineDecl(), emitOMPAllocateDecl(), emitOMPCapturedExpr(), emitOMPDeclareMapper(), emitOMPDeclareReduction(), emitOMPGroupPrivateDecl(), emitOMPRequiresDecl(), emitOMPThreadPrivateDecl(), emitTopLevelDecl(), errorNYI(), cir::MissingFeatures::generateDebugInfo(), getCXXABI(), and clang::isa().
Referenced by emitDeclContext(), emitTopLevelDecl(), and handleCXXStaticMemberVarInstantiation().
| void CIRGenModule::emitVTable | ( | const CXXRecordDecl * | rd | ) |
This is a callback from Sema to tell us that a particular vtable is required to be emitted in this translation unit.
This is only called for vtables that must be emitted (mainly due to key functions). For weak vtables, CodeGen tracks when they are needed and emits them as-needed.
Definition at line 99 of file CIRGenVTables.cpp.
|
inline |
Definition at line 638 of file CIRGenModule.h.
References clang::DiagnosticsEngine::Error.
|
inline |
Definition at line 631 of file CIRGenModule.h.
References clang::DiagnosticsEngine::Error.
|
inline |
Definition at line 623 of file CIRGenModule.h.
References clang::DiagnosticsEngine::Error, and clang::T.
| DiagnosticBuilder CIRGenModule::errorNYI | ( | SourceLocation | loc, |
| llvm::StringRef | feature ) |
Helpers to emit "not yet implemented" error diagnostics.
Definition at line 2682 of file CIRGenModule.cpp.
References clang::DiagnosticsEngine::Error.
Referenced by addGlobalDtor(), appendParameterTypes(), arrangeFreeFunctionLikeCall(), convertSyncScopeToCIR(), clang::CIRGen::CallArg::copyInto(), createCXXABI(), createOrReplaceCXXRuntimeVariable(), createReferenceTemporary(), createRuntimeFunction(), emitAliasForGlobal(), emitAtomicCmpXchgFailureSet(), emitAtomicFenceOp(), emitAtomicOp(), emitAtomicOp(), emitBuiltinAlloca(), emitCallLikeOp(), emitCatchDispatchBlock(), emitCXXGlobalVarDeclInit(), emitCXXNewAllocSize(), emitDeclContext(), emitDeclDestroy(), emitGlobal(), emitGlobalDefinition(), emitGlobalFunctionDefinition(), emitGlobalVarDeclLValue(), emitGlobalVarDefinition(), clang::CIRGen::CIRGenFunction::emitLabelStmt(), clang::CIRGen::CIRGenFunction::emitLValue(), emitMemberPointerConstant(), emitNullBaseClassInitialization(), emitNullConstant(), emitNullConstantAttr(), emitObjectDelete(), clang::CIRGen::CIRGenFunction::emitOMPAllocateDecl(), emitOMPAllocateDecl(), clang::CIRGen::CIRGenFunction::emitOMPAssumeDirective(), clang::CIRGen::CIRGenFunction::emitOMPAtomicDirective(), clang::CIRGen::CIRGenFunction::emitOMPCancelDirective(), clang::CIRGen::CIRGenFunction::emitOMPCancellationPointDirective(), clang::CIRGen::CIRGenFunction::emitOMPCanonicalLoop(), clang::CIRGen::CIRGenFunction::emitOMPCapturedExpr(), emitOMPCapturedExpr(), clang::CIRGen::CIRGenFunction::emitOMPCriticalDirective(), clang::CIRGen::CIRGenFunction::emitOMPDeclareMapper(), emitOMPDeclareMapper(), clang::CIRGen::CIRGenFunction::emitOMPDeclareReduction(), emitOMPDeclareReduction(), clang::CIRGen::CIRGenFunction::emitOMPDepobjDirective(), clang::CIRGen::CIRGenFunction::emitOMPDispatchDirective(), clang::CIRGen::CIRGenFunction::emitOMPDistributeDirective(), clang::CIRGen::CIRGenFunction::emitOMPDistributeParallelForDirective(), clang::CIRGen::CIRGenFunction::emitOMPDistributeParallelForSimdDirective(), clang::CIRGen::CIRGenFunction::emitOMPDistributeSimdDirective(), clang::CIRGen::CIRGenFunction::emitOMPErrorDirective(), clang::CIRGen::CIRGenFunction::emitOMPFlushDirective(), clang::CIRGen::CIRGenFunction::emitOMPForDirective(), clang::CIRGen::CIRGenFunction::emitOMPForSimdDirective(), clang::CIRGen::CIRGenFunction::emitOMPFuseDirective(), clang::CIRGen::CIRGenFunction::emitOMPGenericLoopDirective(), clang::CIRGen::CIRGenFunction::emitOMPGroupPrivateDecl(), emitOMPGroupPrivateDecl(), clang::CIRGen::CIRGenFunction::emitOMPInterchangeDirective(), clang::CIRGen::CIRGenFunction::emitOMPInteropDirective(), clang::CIRGen::CIRGenFunction::emitOMPMaskedDirective(), clang::CIRGen::CIRGenFunction::emitOMPMaskedTaskLoopDirective(), clang::CIRGen::CIRGenFunction::emitOMPMaskedTaskLoopSimdDirective(), clang::CIRGen::CIRGenFunction::emitOMPMasterDirective(), clang::CIRGen::CIRGenFunction::emitOMPMasterTaskLoopDirective(), clang::CIRGen::CIRGenFunction::emitOMPMasterTaskLoopSimdDirective(), clang::CIRGen::CIRGenFunction::emitOMPMetaDirective(), clang::CIRGen::CIRGenFunction::emitOMPOrderedDirective(), clang::CIRGen::CIRGenFunction::emitOMPParallelDirective(), clang::CIRGen::CIRGenFunction::emitOMPParallelForDirective(), clang::CIRGen::CIRGenFunction::emitOMPParallelForSimdDirective(), clang::CIRGen::CIRGenFunction::emitOMPParallelGenericLoopDirective(), clang::CIRGen::CIRGenFunction::emitOMPParallelMaskedDirective(), clang::CIRGen::CIRGenFunction::emitOMPParallelMaskedTaskLoopDirective(), clang::CIRGen::CIRGenFunction::emitOMPParallelMaskedTaskLoopSimdDirective(), clang::CIRGen::CIRGenFunction::emitOMPParallelMasterDirective(), clang::CIRGen::CIRGenFunction::emitOMPParallelMasterTaskLoopDirective(), clang::CIRGen::CIRGenFunction::emitOMPParallelMasterTaskLoopSimdDirective(), clang::CIRGen::CIRGenFunction::emitOMPParallelSectionsDirective(), clang::CIRGen::CIRGenFunction::emitOMPRequiresDecl(), emitOMPRequiresDecl(), clang::CIRGen::CIRGenFunction::emitOMPReverseDirective(), clang::CIRGen::CIRGenFunction::emitOMPScanDirective(), clang::CIRGen::CIRGenFunction::emitOMPScopeDirective(), clang::CIRGen::CIRGenFunction::emitOMPSectionDirective(), clang::CIRGen::CIRGenFunction::emitOMPSectionsDirective(), clang::CIRGen::CIRGenFunction::emitOMPSimdDirective(), clang::CIRGen::CIRGenFunction::emitOMPSingleDirective(), clang::CIRGen::CIRGenFunction::emitOMPStripeDirective(), clang::CIRGen::CIRGenFunction::emitOMPTargetDataDirective(), clang::CIRGen::CIRGenFunction::emitOMPTargetDirective(), clang::CIRGen::CIRGenFunction::emitOMPTargetEnterDataDirective(), clang::CIRGen::CIRGenFunction::emitOMPTargetExitDataDirective(), clang::CIRGen::CIRGenFunction::emitOMPTargetParallelDirective(), clang::CIRGen::CIRGenFunction::emitOMPTargetParallelForDirective(), clang::CIRGen::CIRGenFunction::emitOMPTargetParallelForSimdDirective(), clang::CIRGen::CIRGenFunction::emitOMPTargetParallelGenericLoopDirective(), clang::CIRGen::CIRGenFunction::emitOMPTargetSimdDirective(), clang::CIRGen::CIRGenFunction::emitOMPTargetTeamsDirective(), clang::CIRGen::CIRGenFunction::emitOMPTargetTeamsDistributeDirective(), clang::CIRGen::CIRGenFunction::emitOMPTargetTeamsDistributeParallelForDirective(), clang::CIRGen::CIRGenFunction::emitOMPTargetTeamsDistributeParallelForSimdDirective(), clang::CIRGen::CIRGenFunction::emitOMPTargetTeamsDistributeSimdDirective(), clang::CIRGen::CIRGenFunction::emitOMPTargetTeamsGenericLoopDirective(), clang::CIRGen::CIRGenFunction::emitOMPTargetUpdateDirective(), clang::CIRGen::CIRGenFunction::emitOMPTaskDirective(), clang::CIRGen::CIRGenFunction::emitOMPTaskgroupDirective(), clang::CIRGen::CIRGenFunction::emitOMPTaskLoopDirective(), clang::CIRGen::CIRGenFunction::emitOMPTaskLoopSimdDirective(), clang::CIRGen::CIRGenFunction::emitOMPTaskwaitDirective(), clang::CIRGen::CIRGenFunction::emitOMPTaskyieldDirective(), clang::CIRGen::CIRGenFunction::emitOMPTeamsDirective(), clang::CIRGen::CIRGenFunction::emitOMPTeamsDistributeDirective(), clang::CIRGen::CIRGenFunction::emitOMPTeamsDistributeParallelForDirective(), clang::CIRGen::CIRGenFunction::emitOMPTeamsDistributeParallelForSimdDirective(), clang::CIRGen::CIRGenFunction::emitOMPTeamsDistributeSimdDirective(), clang::CIRGen::CIRGenFunction::emitOMPTeamsGenericLoopDirective(), clang::CIRGen::CIRGenFunction::emitOMPThreadPrivateDecl(), emitOMPThreadPrivateDecl(), clang::CIRGen::CIRGenFunction::emitOMPTileDirective(), clang::CIRGen::CIRGenFunction::emitOMPUnrollDirective(), emitPointerArithmetic(), emitSuspendExpr(), emitTopLevelDecl(), errorBuiltinNYI(), errorNYI(), errorNYI(), clang::CIRGen::CIRGenFunction::generateCode(), getAddrAndTypeOfCXXStructor(), getAddrOfFunction(), getAddrOfRTTIDescriptor(), getGlobalForStringLiteral(), getLangTempAllocaAddressSpace(), getMangledName(), getMangledNameImpl(), getOrCreateCIRFunction(), getOrCreateStaticVarDecl(), clang::CIRGen::CIRGenFunction::ConstantEmission::getReferenceLValue(), getStaticDeclName(), getVTableLinkage(), initCatchParam(), mayBeEmittedEagerly(), clang::CIRGen::TargetCIRGenInfo::performAddrSpaceCast(), pushTemporaryCleanup(), replaceUsesOfNonProtoTypeWithRealFunction(), setTLSMode(), and shouldAssumeDSOLocal().
|
inline |
Definition at line 648 of file CIRGenModule.h.
References errorNYI(), clang::SourceRange::getBegin(), and clang::T.
| DiagnosticBuilder CIRGenModule::errorNYI | ( | SourceRange | loc, |
| llvm::StringRef | feature ) |
Definition at line 2689 of file CIRGenModule.cpp.
References errorNYI(), and clang::SourceRange::getBegin().
| std::pair< cir::FuncType, cir::FuncOp > CIRGenModule::getAddrAndTypeOfCXXStructor | ( | clang::GlobalDecl | gd, |
| const CIRGenFunctionInfo * | fnInfo = nullptr, | ||
| cir::FuncType | fnType = nullptr, | ||
| bool | dontDefer = false, | ||
| ForDefinition_t | isForDefinition = NotForDefinition ) |
Definition at line 1678 of file CIRGenModule.cpp.
References clang::CIRGen::CIRGenTypes::arrangeCXXStructorDeclaration(), clang::cast(), clang::Dtor_Complete, errorNYI(), getCXXABI(), clang::GlobalDecl::getDecl(), clang::GlobalDecl::getDtorType(), clang::CIRGen::CIRGenTypes::getFunctionType(), getMangledName(), getOrCreateCIRFunction(), getTarget(), getTypes(), and clang::isa().
Referenced by emitDeclDestroy(), and getAddrOfCXXStructor().
| cir::GlobalViewAttr CIRGenModule::getAddrOfConstantStringFromLiteral | ( | const StringLiteral * | s, |
| llvm::StringRef | name = ".str" ) |
Return a global symbol reference to a constant array for the given string literal.
Return a pointer to a constant array for the given string literal.
Definition at line 1476 of file CIRGenModule.cpp.
References cir::MissingFeatures::addressSpace(), getBuilder(), getGlobalForStringLiteral(), cir::CIRBaseBuilderTy::getPointerTo(), and s.
|
inline |
Definition at line 355 of file CIRGenModule.h.
References getAddrAndTypeOfCXXStructor(), and clang::CIRGen::NotForDefinition.
Referenced by codegenCXXStructor(), and getAddrOfGlobal().
| cir::FuncOp CIRGenModule::getAddrOfFunction | ( | clang::GlobalDecl | gd, |
| mlir::Type | funcType = nullptr, | ||
| bool | forVTable = false, | ||
| bool | dontDefer = false, | ||
| ForDefinition_t | isForDefinition = NotForDefinition ) |
Return the address of the given function.
If funcType is non-null, then this function will use the specified type if it has to create it.
Definition at line 1706 of file CIRGenModule.cpp.
References clang::cast(), convertType(), clang::Dtor_Complete, errorNYI(), getCXXABI(), clang::GlobalDecl::getDecl(), clang::GlobalDecl::getDtorType(), getMangledName(), getOrCreateCIRFunction(), and getTarget().
Referenced by emitFunctionDeclPointer(), emitGlobalFunctionDefinition(), emitNewDeleteCall(), and getAddrOfGlobal().
| mlir::Operation * CIRGenModule::getAddrOfGlobal | ( | clang::GlobalDecl | gd, |
| ForDefinition_t | isForDefinition = NotForDefinition ) |
Definition at line 266 of file CIRGenModule.cpp.
References clang::CIRGen::CIRGenTypes::arrangeCXXMethodDeclaration(), clang::CIRGen::CIRGenTypes::arrangeGlobalDeclaration(), clang::cast(), clang::CIRGen::Decl, getAddrOfCXXStructor(), getAddrOfFunction(), getAddrOfGlobalVar(), clang::GlobalDecl::getDecl(), clang::CIRGen::CIRGenTypes::getFunctionType(), getTypes(), and clang::isa().
Referenced by emitConstructorDestructorAlias(), and emitGlobalDecl().
| mlir::Value CIRGenModule::getAddrOfGlobalVar | ( | const VarDecl * | d, |
| mlir::Type | ty = {}, | ||
| ForDefinition_t | isForDefinition = NotForDefinition ) |
Return the mlir::Value for the address of the given global variable.
If Ty is non-null and if the global doesn't exist, then it will be created with the specified type instead of whatever the normal requested type would be. If IsForDefinition is true, it is guaranteed that an actual global with type Ty will be returned, not conversion of a variable with the same mangled name but some other type.
If ty is non-null and if the global doesn't exist, then it will be created with the specified type instead of whatever the normal requested type would be. If isForDefinition is true, it is guaranteed that an actual global with type ty will be returned, not conversion of a variable with the same mangled name but some other type.
Definition at line 747 of file CIRGenModule.cpp.
References clang::CIRGen::CIRGenTypes::convertTypeForMem(), getLoc(), getOrCreateCIRGlobal(), clang::VarDecl::getSourceRange(), clang::VarDecl::getTLSKind(), clang::ValueDecl::getType(), getTypes(), clang::VarDecl::hasGlobalStorage(), and clang::VarDecl::TLS_None.
Referenced by emitDeclInit(), emitGlobal(), emitGlobalVarDeclLValue(), getAddrOfGlobal(), and handleCXXStaticMemberVarInstantiation().
| cir::GlobalViewAttr CIRGenModule::getAddrOfGlobalVarAttr | ( | const VarDecl * | d | ) |
Return the mlir::GlobalViewAttr for the address of the given global.
Definition at line 761 of file CIRGenModule.cpp.
References cir::MissingFeatures::addressSpace(), clang::CIRGen::CIRGenTypes::convertTypeForMem(), getOrCreateCIRGlobal(), clang::ValueDecl::getType(), getTypes(), clang::VarDecl::hasGlobalStorage(), and clang::CIRGen::NotForDefinition.
| mlir::Attribute CIRGenModule::getAddrOfRTTIDescriptor | ( | mlir::Location | loc, |
| QualType | ty, | ||
| bool | forEH = false ) |
Get the address of the RTTI descriptor for the given type.
Definition at line 2639 of file CIRGenModule.cpp.
References errorNYI(), clang::CIRGen::CIRGenCXXABI::getAddrOfRTTIDescriptor(), getCXXABI(), clang::Type::isObjCObjectPointerType(), and shouldEmitRTTI().
Referenced by emitDynamicCastInfo().
|
inline |
Definition at line 102 of file CIRGenModule.h.
Referenced by addGlobalDtor(), computeNonVirtualBaseClassOffset(), clang::CIRGen::CreateCIRGenItaniumCXXABI(), createCXXABI(), emitCXXGlobalVarDeclInit(), emitDeclInit(), emitGlobalFunctionDefinition(), emitNullConstant(), emitNullConstantAttr(), getDynamicOffsetAlignment(), getOpenACCBindMangledName(), getOrCreateStaticVarDecl(), getTypeInfoLinkage(), getVBaseAlignment(), initCatchParam(), mustBeEmitted(), setCXXSpecialMemberAttr(), and shouldBeInCOMDAT().
|
inline |
Definition at line 101 of file CIRGenModule.h.
Referenced by constructAttributeList(), createGlobalOp(), emitArraySubscriptPtr(), emitGlobalVarDefinition(), emitNullConstantForBase(), generateStringLiteral(), getAddrOfConstantStringFromLiteral(), and getPersonalityFn().
| cir::FuncOp CIRGenModule::getBuiltinLibFunction | ( | const FunctionDecl * | fd, |
| unsigned | builtinID ) |
Given a builtin id for a function like "__builtin_fabsf", return a Function* for "fabsf".
Definition at line 1477 of file CIRGenBuiltin.cpp.
References cir::MissingFeatures::asmLabelAttr(), convertType(), getOrCreateCIRFunction(), clang::ValueDecl::getType(), and clang::ast_matchers::type.
| cir::GlobalLinkageKind CIRGenModule::getCIRLinkageForDeclarator | ( | const DeclaratorDecl * | dd, |
| GVALinkage | linkage, | ||
| bool | isConstantVariable ) |
Definition at line 1231 of file CIRGenModule.cpp.
References clang::cast(), clang::CPlusPlus, clang::CUDA, clang::Decl::getAsFunction(), getCodeGenOpts(), getLangOpts(), clang::GVA_AvailableExternally, clang::GVA_DiscardableODR, clang::GVA_Internal, clang::GVA_StrongExternal, clang::GVA_StrongODR, clang::Decl::hasAttr(), clang::isa(), and isVarDeclStrongDefinition().
Referenced by getCIRLinkageVarDefinition(), and getFunctionLinkage().
| cir::GlobalLinkageKind CIRGenModule::getCIRLinkageVarDefinition | ( | const VarDecl * | vd, |
| bool | isConstant ) |
Definition at line 1362 of file CIRGenModule.cpp.
References getCIRLinkageForDeclarator().
Referenced by canEmitSpuriousReferenceToVariable(), and emitGlobalVarDefinition().
| CharUnits CIRGenModule::getClassPointerAlignment | ( | const clang::CXXRecordDecl * | rd | ) |
Return the best known alignment for an unknown pointer to a particular class.
FIXME: this could likely be a common helper and not necessarily related with codegen.
Return the best known alignment for an unknown pointer to a particular class.
Definition at line 150 of file CIRGenModule.cpp.
References clang::CXXRecordDecl::hasDefinition(), clang::CXXRecordDecl::isEffectivelyFinal(), and clang::CharUnits::One().
|
inline |
Definition at line 104 of file CIRGenModule.h.
Referenced by collectClobbers(), emitDeclDestroy(), clang::CIRGen::EHPersonality::get(), getCIRGenToUse(), getCIRLinkageForDeclarator(), getDefaultCIRTLSModel(), inferFlavor(), setWindowsItaniumDLLImport(), and shouldAssumeDSOLocal().
| mlir::Attribute CIRGenModule::getConstantArrayFromStringLiteral | ( | const StringLiteral * | e | ) |
Return a constant array for the given string.
Definition at line 957 of file CIRGenModule.cpp.
References convertType(), clang::StringLiteral::getCharByteWidth(), clang::StringLiteral::getCodeUnit(), clang::StringLiteral::getLength(), getMLIRContext(), clang::StringLiteral::getString(), clang::Expr::getType(), and clang::Type::isPointerType().
Referenced by getGlobalForStringLiteral().
|
inline |
Definition at line 109 of file CIRGenModule.h.
Referenced by calculateCookiePadding(), commonBuildCXXMemberOrOperatorCall(), emitDeclDestroy(), emitDynamicCastToNull(), emitMemberInitializer(), emitObjectDelete(), emitTopLevelDecl(), getAddrAndTypeOfCXXStructor(), getAddrOfFunction(), getAddrOfRTTIDescriptor(), getAddrOfVTTVTable(), getFunctionLinkage(), getGlobalForStringLiteral(), getMangledName(), getMangledNameImpl(), getOrCreateCIRFunction(), and clang::CIRGen::CIRGenCallee::prepareConcreteCallee().
|
inline |
Definition at line 112 of file CIRGenModule.h.
Referenced by computeFullLaneShuffleMask(), emitCXXNewAllocSize(), and isFullSizeType().
| cir::TLS_Model CIRGenModule::getDefaultCIRTLSModel | ( | ) | const |
Get TLS mode from CodeGenOptions.
Definition at line 2088 of file CIRGenModule.cpp.
References clang::CodeGenOptions::GeneralDynamicTLSModel, getCodeGenOpts(), clang::CodeGenOptions::InitialExecTLSModel, clang::CodeGenOptions::LocalDynamicTLSModel, and clang::CodeGenOptions::LocalExecTLSModel.
Referenced by setTLSMode().
|
inline |
Definition at line 105 of file CIRGenModule.h.
Referenced by collectClobbers().
| CharUnits CIRGenModule::getDynamicOffsetAlignment | ( | CharUnits | actualBaseAlign, |
| const CXXRecordDecl * | baseDecl, | ||
| CharUnits | expectedTargetAlign ) |
TODO: Add TBAAAccessInfo.
Definition at line 607 of file CIRGenClass.cpp.
References getASTContext(), clang::ASTContext::getASTRecordLayout(), clang::ASTRecordLayout::getNonVirtualAlignment(), and clang::TagDecl::isCompleteDefinition().
Referenced by getVBaseAlignment().
| cir::GlobalLinkageKind CIRGenModule::getFunctionLinkage | ( | GlobalDecl | gd | ) |
Definition at line 1368 of file CIRGenModule.cpp.
References clang::cast(), getCIRLinkageForDeclarator(), getCXXABI(), clang::CIRGen::CIRGenCXXABI::getCXXDestructorLinkage(), clang::GlobalDecl::getDecl(), and clang::GlobalDecl::getDtorType().
Referenced by emitConstructorDestructorAlias(), getCIRGenToUse(), setFunctionAttributes(), and setFunctionLinkage().
| cir::GlobalOp CIRGenModule::getGlobalForStringLiteral | ( | const StringLiteral * | s, |
| llvm::StringRef | name = ".str" ) |
Return a global symbol reference to a constant array for the given string literal.
Return a pointer to a constant array for the given string literal.
Definition at line 1430 of file CIRGenModule.cpp.
References c, constantStringMap, errorNYI(), generateStringLiteral(), getConstantArrayFromStringLiteral(), getCXXABI(), getLangOpts(), getLoc(), clang::CharUnits::getQuantity(), getSize(), getUniqueGlobalName(), s, cir::MissingFeatures::sanitizers(), and setDSOLocal().
Referenced by getAddrOfConstantStringFromLiteral().
| mlir::Operation * CIRGenModule::getGlobalValue | ( | llvm::StringRef | ref | ) |
Definition at line 521 of file CIRGenModule.cpp.
Referenced by emitConstructorDestructorAlias(), emitGlobal(), emitGlobalDecl(), emitTentativeDefinition(), and getOrCreateCIRFunction().
| cir::VisibilityAttr CIRGenModule::getGlobalVisibilityAttrFromDecl | ( | const Decl * | decl | ) |
Definition at line 2565 of file CIRGenModule.cpp.
References clang::CIRGen::Decl, clang::ast_matchers::decl, getGlobalVisibilityKindFromClangVisibility(), and getMLIRContext().
Referenced by setFunctionAttributes().
|
static |
Definition at line 2551 of file CIRGenModule.cpp.
Referenced by getGlobalVisibilityAttrFromDecl().
|
inline |
Definition at line 372 of file CIRGenModule.h.
Referenced by emitDynamicCastToVoid().
|
inline |
Definition at line 375 of file CIRGenModule.h.
|
inline |
Definition at line 107 of file CIRGenModule.h.
Referenced by callBeginCatch(), CIRGenModule(), createCIRFunction(), emitGlobalVarDefinition(), generateStringLiteral(), clang::CIRGen::EHPersonality::get(), getCIRLinkageForDeclarator(), getGlobalForStringLiteral(), getLangTempAllocaAddressSpace(), getMangledNameImpl(), getOrCreateCIRFunction(), getStaticDeclName(), getTypeInfoLinkage(), shouldAssumeDSOLocal(), shouldEmitRTTI(), and shouldZeroInitPadding().
| LangAS CIRGenModule::getLangTempAllocaAddressSpace | ( | ) | const |
Returns the address space for temporary allocations in the language.
This ensures that the allocated variable's address space matches the expectations of the AST, rather than using the target's allocation address space, which may lead to type mismatches in other parts of the IR.
Definition at line 1488 of file CIRGenModule.cpp.
References clang::Default, errorNYI(), getLangOpts(), clang::OpenCL, and clang::opencl_private.
| mlir::Location CIRGenModule::getLoc | ( | clang::SourceLocation | cLoc | ) |
Helpers to convert the presumed location of Clang's SourceLocation to an MLIR Location.
Definition at line 248 of file CIRGenModule.cpp.
References clang::PresumedLoc::getColumn(), clang::PresumedLoc::getFilename(), clang::PresumedLoc::getLine(), clang::SourceManager::getPresumedLoc(), and clang::SourceLocation::isValid().
Referenced by emitAliasForGlobal(), emitCXXGlobalVarDeclInit(), emitGlobalOpenACCDeclareDataOperands(), emitMemberPointerConstant(), emitOpenACCRoutineDecl(), emitStoresForConstant(), getAddrOfGlobalVar(), getGlobalForStringLiteral(), getLoc(), getOrCreateCIRFunction(), and getOrCreateStaticVarDecl().
| mlir::Location CIRGenModule::getLoc | ( | clang::SourceRange | cRange | ) |
Definition at line 257 of file CIRGenModule.cpp.
References clang::SourceRange::getBegin(), clang::SourceRange::getEnd(), getLoc(), and clang::SourceRange::isValid().
| StringRef CIRGenModule::getMangledName | ( | clang::GlobalDecl | gd | ) |
Definition at line 1850 of file CIRGenModule.cpp.
References clang::cast(), errorNYI(), clang::GlobalDecl::getCanonicalDecl(), getCXXABI(), clang::GlobalDecl::getDecl(), getMangledNameImpl(), and getTarget().
Referenced by emitConstructorDestructorAlias(), emitGlobal(), emitGlobalDecl(), emitGlobalOpenACCDeclareDataOperands(), emitTentativeDefinition(), getAddrAndTypeOfCXXStructor(), getAddrOfFunction(), getOrCreateCIRGlobal(), and getStaticDeclName().
|
inline |
Definition at line 110 of file CIRGenModule.h.
Referenced by CIRGenModule(), constructAttributeList(), createCIRFunction(), createOrReplaceCXXRuntimeVariable(), emitGlobalOpenACCDeclareDataOperands(), emitStoresForConstant(), getConstantArrayFromStringLiteral(), getGlobalVisibilityAttrFromDecl(), and setFunctionLinkage().
|
static |
Definition at line 2520 of file CIRGenModule.cpp.
References getMLIRVisibilityFromCIRLinkage().
|
inlinestatic |
Definition at line 282 of file CIRGenModule.h.
References clang::DefaultVisibility, clang::HiddenVisibility, and clang::ProtectedVisibility.
Referenced by createOrReplaceCXXRuntimeVariable(), and clang::CIRGen::CIRGenVTables::emitVTTDefinition().
|
static |
Definition at line 2529 of file CIRGenModule.cpp.
Referenced by emitGlobalVarDefinition(), getMLIRVisibility(), getOrCreateStaticVarDecl(), and setFunctionLinkage().
|
inline |
Definition at line 100 of file CIRGenModule.h.
Referenced by createGlobalOp(), emitGlobalDecl(), emitGlobalOpenACCDeclareDataOperands(), emitOpenACCRoutineDecl(), emitStoresForConstant(), and getOrCreateStaticVarDecl().
| CharUnits CIRGenModule::getNaturalTypeAlignment | ( | clang::QualType | t, |
| LValueBaseInfo * | baseInfo ) |
FIXME: this could likely be a common helper and not necessarily related with codegen.
Definition at line 165 of file CIRGenModule.cpp.
References cir::MissingFeatures::alignCXXRecordDecl(), clang::CIRGen::AttributedType, clang::CharUnits::fromQuantity(), clang::Type::getAs(), clang::QualType::getQualifiers(), clang::CharUnits::getQuantity(), clang::Qualifiers::hasUnaligned(), clang::Type::isIncompleteType(), clang::CharUnits::One(), cir::MissingFeatures::opTBAA(), and clang::CIRGen::Type.
| std::string CIRGenModule::getOpenACCBindMangledName | ( | const IdentifierInfo * | bindName, |
| const FunctionDecl * | attachedFunction ) |
Definition at line 1836 of file CIRGenModule.cpp.
References createOpenACCBindTempFunction(), clang::ASTContext::Deallocate(), getASTContext(), and getMangledNameImpl().
| cir::FuncOp CIRGenModule::getOrCreateCIRFunction | ( | llvm::StringRef | mangledName, |
| mlir::Type | funcType, | ||
| clang::GlobalDecl | gd, | ||
| bool | forVTable, | ||
| bool | dontDefer = false, | ||
| bool | isThunk = false, | ||
| ForDefinition_t | isForDefinition = NotForDefinition, | ||
| mlir::ArrayAttr | extraAttrs = {} ) |
Definition at line 2225 of file CIRGenModule.cpp.
References addDeferredDeclToEmit(), clang::cast(), clang::CPlusPlus, createCIRFunction(), clang::CIRGen::Decl, deferredDecls, errorNYI(), getCXXABI(), clang::GlobalDecl::getDecl(), clang::GlobalDecl::getDtorType(), getGlobalValue(), getLangOpts(), getLoc(), clang::Decl::getSourceRange(), clang::GlobalDecl::getWithDecl(), clang::Decl::hasAttr(), clang::isa(), replaceUsesOfNonProtoTypeWithRealFunction(), cir::MissingFeatures::setDLLStorageClass(), setDSOLocal(), setFunctionAttributes(), and cir::MissingFeatures::weakRefReference().
Referenced by createRuntimeFunction(), getAddrAndTypeOfCXXStructor(), getAddrOfFunction(), and getBuiltinLibFunction().
| cir::GlobalOp CIRGenModule::getOrCreateCIRGlobal | ( | const VarDecl * | d, |
| mlir::Type | ty, | ||
| ForDefinition_t | isForDefinition ) |
Definition at line 729 of file CIRGenModule.cpp.
References clang::CIRGen::CIRGenTypes::convertTypeForMem(), clang::QualType::getAddressSpace(), getMangledName(), getOrCreateCIRGlobal(), clang::ValueDecl::getType(), getTypes(), and clang::VarDecl::hasGlobalStorage().
| cir::GlobalOp clang::CIRGen::CIRGenModule::getOrCreateCIRGlobal | ( | llvm::StringRef | mangledName, |
| mlir::Type | ty, | ||
| LangAS | langAS, | ||
| const VarDecl * | d, | ||
| ForDefinition_t | isForDefinition ) |
If the specified mangled name is not in the module, create and return an mlir::GlobalOp value.
Referenced by emitGlobalVarDefinition(), getAddrOfGlobalVar(), getAddrOfGlobalVarAttr(), and getOrCreateCIRGlobal().
| cir::GlobalOp CIRGenModule::getOrCreateStaticVarDecl | ( | const VarDecl & | d, |
| cir::GlobalLinkageKind | linkage ) |
Definition at line 419 of file CIRGenDecl.cpp.
References cir::MissingFeatures::addressSpace(), clang::cast(), convertType(), clang::CIRGen::CIRGenTypes::convertTypeForMem(), clang::CIRGen::Decl, errorNYI(), getASTContext(), clang::GlobalDecl::getDecl(), clang::Decl::getDeclContext(), getLoc(), clang::Decl::getLocation(), getMLIRVisibilityFromCIRLinkage(), getModule(), clang::Decl::getNonClosureContext(), clang::VarDecl::getSourceRange(), getStaticDeclName(), getStaticLocalDeclAddress(), clang::VarDecl::getTLSKind(), clang::ValueDecl::getType(), getTypes(), clang::Decl::hasAttr(), clang::isa(), clang::Type::isConstantSizeType(), cir::MissingFeatures::openMP(), setGVProperties(), and supportsCOMDAT().
|
inline |
Definition at line 578 of file CIRGenModule.h.
Referenced by createOrReplaceCXXRuntimeVariable(), emitAtomicUpdate(), generateStringLiteral(), and getGlobalForStringLiteral().
|
inline |
Definition at line 153 of file CIRGenModule.h.
References staticLocalDeclMap.
Referenced by getOrCreateStaticVarDecl().
|
inline |
Definition at line 103 of file CIRGenModule.h.
Referenced by clang::CIRGen::EHPersonality::get(), getAddrAndTypeOfCXXStructor(), getAddrOfFunction(), getCIRGenToUse(), getMangledName(), getTargetCIRGenInfo(), and setWindowsItaniumDLLImport().
| const TargetCIRGenInfo & CIRGenModule::getTargetCIRGenInfo | ( | ) |
Definition at line 220 of file CIRGenModule.cpp.
References clang::CIRGen::createX8664TargetCIRGenInfo(), getTarget(), clang::TargetInfo::getTriple(), cir::MissingFeatures::targetCIRGenInfoArch(), and cir::MissingFeatures::targetCIRGenInfoOS().
Referenced by arrangeFreeFunctionLikeCall(), and CIRGenModule().
|
inline |
Definition at line 588 of file CIRGenModule.h.
Referenced by addGlobalDtor(), CIRGenModule(), getTypeInfoLinkage(), shouldAssumeDSOLocal(), shouldEmitRTTI(), and supportsCOMDAT().
|
inline |
Definition at line 106 of file CIRGenModule.h.
Referenced by codegenCXXStructor(), emitAliasForGlobal(), emitGlobalFunctionDefinition(), emitNewDeleteCall(), emitNullConstant(), emitNullConstantAttr(), emitNullConstantForBase(), getAddrAndTypeOfCXXStructor(), getAddrOfGlobal(), getAddrOfGlobalVar(), getAddrOfGlobalVarAttr(), getOrCreateCIRGlobal(), and getOrCreateStaticVarDecl().
| std::string CIRGenModule::getUniqueGlobalName | ( | const std::string & | baseName | ) |
Definition at line 1413 of file CIRGenModule.cpp.
References cgGlobalNames.
Referenced by getGlobalForStringLiteral().
| clang::CharUnits CIRGenModule::getVBaseAlignment | ( | CharUnits | derivedAlign, |
| const CXXRecordDecl * | derived, | ||
| const CXXRecordDecl * | vbase ) |
Returns the assumed alignment of a virtual base of a class.
Return the best known alignment for a pointer to a virtual base, given the alignment of a pointer to the derived class.
Definition at line 649 of file CIRGenClass.cpp.
References getASTContext(), clang::ASTContext::getASTRecordLayout(), getDynamicOffsetAlignment(), clang::ASTRecordLayout::getNonVirtualAlignment(), and clang::TagDecl::isCompleteDefinition().
| mlir::Type CIRGenModule::getVTableComponentType | ( | ) |
Definition at line 29 of file CIRGenVTables.cpp.
References cir::MissingFeatures::vtableRelativeLayout().
| cir::GlobalLinkageKind CIRGenModule::getVTableLinkage | ( | const CXXRecordDecl * | rd | ) |
Return the appropriate linkage for the vtable, VTT, and type information of the given class.
Compute the required linkage of the vtable for the given class.
Note that we only call this at the end of the translation unit.
Definition at line 285 of file CIRGenVTables.cpp.
References cir::MissingFeatures::appleKext(), clang::cast(), errorNYI(), clang::TagDecl::getSourceRange(), clang::CXXRecordDecl::getTemplateSpecializationKind(), clang::FunctionDecl::getTemplateSpecializationKind(), clang::Decl::hasAttr(), clang::FunctionDecl::hasBody(), clang::NamedDecl::isExternallyVisible(), clang::FunctionDecl::isInlined(), clang::TSK_ExplicitInstantiationDeclaration, clang::TSK_ExplicitInstantiationDefinition, clang::TSK_ExplicitSpecialization, clang::TSK_ImplicitInstantiation, and clang::TSK_Undeclared.
Referenced by getTypeInfoLinkage().
|
inline |
Definition at line 370 of file CIRGenModule.h.
Referenced by emitGlobalDefinition().
| void CIRGenModule::handleCXXStaticMemberVarInstantiation | ( | VarDecl * | vd | ) |
Tell the consumer that this variable has been instantiated.
Definition at line 507 of file CIRGenModule.cpp.
References clang::VarDecl::Definition, emitTopLevelDecl(), getAddrOfGlobalVar(), clang::VarDecl::getDefinition(), clang::VarDecl::getTemplateSpecializationKind(), clang::Decl::hasAttr(), clang::VarDecl::isThisDeclarationADefinition(), and clang::TSK_ExplicitInstantiationDefinition.
| cir::LabelOp CIRGenModule::lookupBlockAddressInfo | ( | cir::BlockAddrInfoAttr | blockInfo | ) |
Definition at line 2726 of file CIRGenModule.cpp.
References blockAddressInfoToLabel.
| void CIRGenModule::mapBlockAddress | ( | cir::BlockAddrInfoAttr | blockInfo, |
| cir::LabelOp | label ) |
Definition at line 2694 of file CIRGenModule.cpp.
References blockAddressInfoToLabel.
| void CIRGenModule::mapResolvedBlockAddress | ( | cir::BlockAddressOp | op, |
| cir::LabelOp | label ) |
Definition at line 2708 of file CIRGenModule.cpp.
References blockAddressToLabel.
| void CIRGenModule::mapUnresolvedBlockAddress | ( | cir::BlockAddressOp | op | ) |
Definition at line 2702 of file CIRGenModule.cpp.
References unresolvedBlockAddressToLabel.
| bool CIRGenModule::mayBeEmittedEagerly | ( | const clang::ValueDecl * | d | ) |
Determine whether the definition can be emitted eagerly, or should be delayed until the end of the translation unit.
This is relevant for definitions whose linkage can change, e.g. implicit function instantiations which may later be explicitly instantiated.
Definition at line 1911 of file CIRGenModule.cpp.
References errorNYI(), clang::ValueDecl::getType(), clang::isa(), clang::QualType::isConstantStorage(), clang::TSK_ImplicitInstantiation, and clang::ASTContext::WeakUnknown.
Referenced by emitGlobal().
| void CIRGenModule::maybeSetTrivialComdat | ( | const clang::Decl & | d, |
| mlir::Operation * | op ) |
Definition at line 1040 of file CIRGenModule.cpp.
References clang::cast(), clang::CIRGen::Decl, and shouldBeInCOMDAT().
Referenced by emitGlobalFunctionDefinition(), and emitGlobalVarDefinition().
| bool CIRGenModule::mustBeEmitted | ( | const clang::ValueDecl * | d | ) |
Determine whether the definition must be emitted; if this returns false, the definition can be emitted lazily if it's used.
Definition at line 1894 of file CIRGenModule.cpp.
References clang::ASTContext::DeclMustBeEmitted(), getASTContext(), clang::SD_Static, and clang::SD_Thread.
Referenced by emitGlobal(), and emitTentativeDefinition().
| void CIRGenModule::release | ( | ) |
Definition at line 2577 of file CIRGenModule.cpp.
References cir::MissingFeatures::cgmRelease(), and emitDeferred().
| void CIRGenModule::replaceUsesOfNonProtoTypeWithRealFunction | ( | mlir::Operation * | old, |
| cir::FuncOp | newFn ) |
This function is called when we implement a function with no prototype, e.g.
"int foo() {}". If there are existing call uses of the old function in the module, this adjusts them to call the new function directly.
This is not just a cleanup: the always_inline pass requires direct calls to functions to be able to inline them. If there is a bitcast in the way, it won't inline them. Instcombine normally deletes these calls, but it isn't run at -O0.
Definition at line 1315 of file CIRGenModule.cpp.
References errorNYI(), cir::MissingFeatures::opFuncExceptions(), cir::MissingFeatures::opFuncOperandBundles(), and cir::MissingFeatures::opFuncParameterAttributes().
Referenced by getOrCreateCIRFunction().
| void CIRGenModule::setCIRFunctionAttributesForDefinition | ( | const clang::FunctionDecl * | fd, |
| cir::FuncOp | f ) |
Set extra attributes (inline, etc.) for a function.
Definition at line 2147 of file CIRGenModule.cpp.
References clang::ast_matchers::decl, cir::MissingFeatures::hlsl(), clang::CodeGenOptions::OnlyAlwaysInlining, clang::CodeGenOptions::OnlyHintInlining, cir::MissingFeatures::opFuncArmNewAttr(), cir::MissingFeatures::opFuncArmStreamingAttr(), cir::MissingFeatures::opFuncColdHotAttr(), cir::MissingFeatures::opFuncMinSizeAttr(), cir::MissingFeatures::opFuncNakedAttr(), cir::MissingFeatures::opFuncNoDuplicateAttr(), cir::MissingFeatures::opFuncOptNoneAttr(), cir::MissingFeatures::opFuncUnwindTablesAttr(), clang::FunctionDecl::redecls(), and cir::MissingFeatures::stackProtector().
Referenced by codegenCXXStructor(), and emitGlobalFunctionDefinition().
| void CIRGenModule::setCommonAttributes | ( | GlobalDecl | gd, |
| mlir::Operation * | op ) |
Set attributes which are common to any form of a global definition (alias, Objective-C method, function, global variable).
NOTE: This should only be called for definitions.
Definition at line 560 of file CIRGenModule.cpp.
References clang::CIRGen::Decl, cir::MissingFeatures::defaultVisibility(), clang::GlobalDecl::getDecl(), cir::MissingFeatures::opGlobalUsedOrCompilerUsed(), and setGVProperties().
Referenced by emitAliasForGlobal().
| void CIRGenModule::setCXXSpecialMemberAttr | ( | cir::FuncOp | funcOp, |
| const clang::FunctionDecl * | funcDecl ) |
Mark the function as a special member (e.g. constructor, destructor)
Definition at line 2449 of file CIRGenModule.cpp.
References convertType(), getAssignKindFromDecl(), getASTContext(), and getCtorKindFromDecl().
Referenced by createCIRFunction().
| void CIRGenModule::setDSOLocal | ( | cir::CIRGlobalValueInterface | gv | ) | const |
Definition at line 2066 of file CIRGenModule.cpp.
References shouldAssumeDSOLocal().
| void CIRGenModule::setDSOLocal | ( | mlir::Operation * | op | ) | const |
Definition at line 2070 of file CIRGenModule.cpp.
References setDSOLocal().
Referenced by createOrReplaceCXXRuntimeVariable(), generateStringLiteral(), getGlobalForStringLiteral(), getOrCreateCIRFunction(), setDSOLocal(), and setGVPropertiesAux().
| void CIRGenModule::setFunctionAttributes | ( | GlobalDecl | gd, |
| cir::FuncOp | f, | ||
| bool | isIncompleteFunction, | ||
| bool | isThunk ) |
Set function attributes for a function declaration.
Definition at line 2115 of file CIRGenModule.cpp.
References cir::MissingFeatures::attributeNoBuiltin(), clang::cast(), clang::CIRGen::Decl, clang::ast_matchers::decl, clang::GlobalDecl::getDecl(), getFunctionLinkage(), getGlobalVisibilityAttrFromDecl(), clang::FunctionDecl::hasBody(), cir::MissingFeatures::setFunctionAttributes(), and cir::MissingFeatures::setTargetAttributes().
Referenced by getOrCreateCIRFunction().
|
inline |
Definition at line 607 of file CIRGenModule.h.
References getFunctionLinkage(), getMLIRContext(), and getMLIRVisibilityFromCIRLinkage().
Referenced by codegenCXXStructor(), and emitGlobalFunctionDefinition().
| void CIRGenModule::setGlobalVisibility | ( | mlir::Operation * | op, |
| const NamedDecl * | d ) const |
Set the visibility for the given global.
Definition at line 2061 of file CIRGenModule.cpp.
References cir::MissingFeatures::opGlobalVisibility().
Referenced by setGVPropertiesAux().
| void CIRGenModule::setGVProperties | ( | mlir::Operation * | op, |
| const NamedDecl * | d ) const |
Set visibility, dllimport/dllexport and dso_local.
This must be called after dllimport/dllexport is set.
Definition at line 2075 of file CIRGenModule.cpp.
References cir::MissingFeatures::opGlobalDLLImportExport(), and setGVPropertiesAux().
Referenced by emitGlobalFunctionDefinition(), getOrCreateStaticVarDecl(), and setCommonAttributes().
| void CIRGenModule::setGVPropertiesAux | ( | mlir::Operation * | op, |
| const NamedDecl * | d ) const |
Definition at line 2081 of file CIRGenModule.cpp.
References cir::MissingFeatures::opGlobalPartition(), setDSOLocal(), and setGlobalVisibility().
Referenced by setGVProperties().
|
static |
Definition at line 1672 of file CIRGenModule.cpp.
References cir::MissingFeatures::opGlobalVisibility().
Referenced by emitGlobalVarDefinition(), and generateStringLiteral().
|
inline |
Definition at line 157 of file CIRGenModule.h.
References c, and staticLocalDeclMap.
| void CIRGenModule::setTLSMode | ( | mlir::Operation * | op, |
| const VarDecl & | d ) |
Set TLS mode for the given operation based on the given variable declaration.
Definition at line 2102 of file CIRGenModule.cpp.
References clang::cast(), errorNYI(), clang::Decl::getAttr(), getDefaultCIRTLSModel(), clang::VarDecl::getSourceRange(), and clang::VarDecl::getTLSKind().
Definition at line 419 of file CIRGenModule.h.
References getLangOpts(), and getTriple().
Referenced by getAddrOfRTTIDescriptor().
|
inline |
Definition at line 185 of file CIRGenModule.h.
References getLangOpts().
| bool CIRGenModule::supportsCOMDAT | ( | ) | const |
Definition at line 1010 of file CIRGenModule.cpp.
References getTriple().
Referenced by createOrReplaceCXXRuntimeVariable(), generateStringLiteral(), getOrCreateStaticVarDecl(), and shouldBeInCOMDAT().
| void CIRGenModule::updateCompletedType | ( | const clang::TagDecl * | td | ) |
Definition at line 1051 of file CIRGenModule.cpp.
| void CIRGenModule::updateResolvedBlockAddress | ( | cir::BlockAddressOp | op, |
| cir::LabelOp | newLabel ) |
Definition at line 2715 of file CIRGenModule.cpp.
References blockAddressToLabel.
| bool CIRGenModule::verifyModule | ( | ) | const |
Definition at line 2632 of file CIRGenModule.cpp.
| llvm::DenseMap<cir::BlockAddrInfoAttr, cir::LabelOp> clang::CIRGen::CIRGenModule::blockAddressInfoToLabel |
Map BlockAddrInfoAttr (function name, label name) to the corresponding CIR LabelOp.
This provides the main lookup table used to resolve block addresses into their label operations.
Definition at line 132 of file CIRGenModule.h.
Referenced by lookupBlockAddressInfo(), and mapBlockAddress().
| llvm::MapVector<cir::BlockAddressOp, cir::LabelOp> clang::CIRGen::CIRGenModule::blockAddressToLabel |
Map CIR BlockAddressOps directly to their resolved LabelOps.
Used once a block address has been successfully lowered to a label.
Definition at line 135 of file CIRGenModule.h.
Referenced by mapResolvedBlockAddress(), and updateResolvedBlockAddress().
|
staticconstexpr |
Definition at line 571 of file CIRGenModule.h.
|
staticconstexpr |
Definition at line 572 of file CIRGenModule.h.
|
staticconstexpr |
Definition at line 570 of file CIRGenModule.h.
| llvm::StringMap<unsigned> clang::CIRGen::CIRGenModule::cgGlobalNames |
Definition at line 235 of file CIRGenModule.h.
Referenced by getUniqueGlobalName().
| llvm::DenseMap<mlir::Attribute, cir::GlobalOp> clang::CIRGen::CIRGenModule::constantStringMap |
Definition at line 300 of file CIRGenModule.h.
Referenced by getGlobalForStringLiteral().
| std::map<llvm::StringRef, clang::GlobalDecl> clang::CIRGen::CIRGenModule::deferredDecls |
This contains all the decls which have definitions but which are deferred for emission and therefore should only be output if they are actually used.
If a decl is in this, then it is known to have not been referenced yet.
Definition at line 383 of file CIRGenModule.h.
Referenced by emitGlobal(), emitTentativeDefinition(), and getOrCreateCIRFunction().
| std::vector<clang::GlobalDecl> clang::CIRGen::CIRGenModule::deferredDeclsToEmit |
Definition at line 387 of file CIRGenModule.h.
Referenced by addDeferredDeclToEmit(), and emitDeferred().
| llvm::DenseMap<const clang::FieldDecl *, llvm::StringRef> clang::CIRGen::CIRGenModule::lambdaFieldToName |
Keep a map between lambda fields and names, this needs to be per module since lambdas might get generated later as part of defered work, and since the pointers are supposed to be uniqued, should be fine.
Revisit this if it ends up taking too much memory.
Definition at line 128 of file CIRGenModule.h.
| mlir::Operation* clang::CIRGen::CIRGenModule::lastGlobalOp = nullptr |
| unsigned clang::CIRGen::CIRGenModule::routineCounter = 0 |
Definition at line 489 of file CIRGenModule.h.
Referenced by emitOpenACCRoutineDecl().
| llvm::DenseMap<const Decl *, cir::GlobalOp> clang::CIRGen::CIRGenModule::staticLocalDeclMap |
Definition at line 149 of file CIRGenModule.h.
Referenced by getStaticLocalDeclAddress(), and setStaticLocalDeclAddress().
| llvm::DenseSet<cir::BlockAddressOp> clang::CIRGen::CIRGenModule::unresolvedBlockAddressToLabel |
Track CIR BlockAddressOps that cannot be resolved immediately because their LabelOp has not yet been emitted.
These entries are solved later once the corresponding label is available.
Definition at line 139 of file CIRGenModule.h.
Referenced by mapUnresolvedBlockAddress().