|
clang 24.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 () |
| void | addRecordLayout (mlir::StringAttr name, cir::RecordLayoutAttr attr) |
| Queue a record layout entry for materialization in release(). | |
| 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 |
| clang::AtomicOptions | getAtomicOpts () const |
| The atomic options in effect at the point currently being emitted. | |
| void | setAtomicOpts (clang::AtomicOptions opts) |
| CIRGenCXXABI & | getCXXABI () const |
| mlir::MLIRContext & | getMLIRContext () |
| const cir::CIRDataLayout & | getDataLayout () const |
| void | addUsedGlobal (cir::CIRGlobalValueInterface gv) |
| Add a global value to the llvmUsed list. | |
| void | addCompilerUsedGlobal (cir::CIRGlobalValueInterface gv) |
| Add a global value to the llvmCompilerUsed list. | |
| void | addUsedOrCompilerUsedGlobal (cir::CIRGlobalValueInterface gv) |
| Add a global to a list to be added to the llvm.compiler.used metadata. | |
| void | emitLLVMUsed () |
| Emit llvm.used and llvm.compiler.used globals. | |
| void | handleCXXStaticMemberVarInstantiation (VarDecl *vd) |
| Tell the consumer that this variable has been instantiated. | |
| mlir::Operation * | getGlobalValue (llvm::StringRef ref) |
| cir::FuncOp | lookupFuncOp (llvm::StringRef name) |
| O(1) lookup of a FuncOp by name in the symbol cache. | |
| void | insertGlobalSymbol (mlir::Operation *op) |
| void | eraseGlobalSymbol (mlir::Operation *op) |
| cir::GlobalOp | getStaticLocalDeclAddress (const VarDecl *d) |
| void | setStaticLocalDeclAddress (const VarDecl *d, cir::GlobalOp c) |
| cir::GlobalOp | getOrCreateStaticVarDecl (const VarDecl &d, cir::GlobalLinkageKind linkage) |
| Address | createUnnamedGlobalFrom (const VarDecl &d, mlir::Attribute constAttr, CharUnits align) |
| cir::GlobalOp | getOrCreateCIRGlobal (llvm::StringRef mangledName, mlir::Type ty, LangAS langAS, mlir::Location loc, 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) |
| mlir::Operation * | getWeakRefReference (const clang::ValueDecl *vd) |
| Return the symbol that a weakref declaration refers to: the cir.func or cir.global named by its alias target, declared extern_weak if it did not already exist. | |
| cir::GlobalOp | createGlobalOp (mlir::Location loc, llvm::StringRef name, mlir::Type t, bool isConstant=false, mlir::ptr::MemorySpaceAttrInterface addrSpace={}, mlir::Operation *insertPoint=nullptr) |
| 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. | |
| mlir::Value | castGlobalToDeclAddrSpace (mlir::Value addr, const VarDecl &vd) |
Cast addr, the address of the global vd, to the address space of the declared type of vd if they differ. | |
| cir::FuncOp | getAddrOfThunk (StringRef name, mlir::Type fnTy, GlobalDecl gd) |
| Get or create a thunk function with the given name and type. | |
| cir::GlobalViewAttr | getAddrOfGlobalVarAttr (const VarDecl *d) |
| Return the mlir::GlobalViewAttr for the address of the given global. | |
| cir::GlobalOp | getAddrOfTemplateParamObject (const TemplateParamObjectDecl *tpo) |
| Get the GlobalOp of a template parameter object. | |
| cir::GlobalOp | getAddrOfUnnamedGlobalConstantDecl (const UnnamedGlobalConstantDecl *gcd) |
| CharUnits | computeNonVirtualBaseClassOffset (const CXXRecordDecl *derivedClass, llvm::iterator_range< CastExpr::path_const_iterator > path) |
| void | constructAttributeList (llvm::StringRef name, const CIRGenFunctionInfo &info, CIRGenCalleeInfo calleeInfo, mlir::NamedAttrList &attrs, llvm::MutableArrayRef< mlir::NamedAttrList > argAttrs, mlir::NamedAttrList &retAttrs, cir::CallingConv &callingConv, bool attrOnCallSite, bool isThunk) |
| Get the CIR attributes and calling convention to use for a particular function type. | |
| void | addDefaultFunctionAttributes (StringRef name, bool hasOptNoneAttr, bool attrOnCallSite, mlir::NamedAttrList &attrs) |
| Helper function for constructAttributeList/others. | |
| 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. | |
| cir::GlobalOp | getAddrOfConstantCompoundLiteralIfEmitted (const CompoundLiteralExpr *e) |
| void | setAddrOfConstantCompoundLiteral (const CompoundLiteralExpr *e, cir::GlobalOp gv) |
| 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. | |
| cir::GlobalOp | createGlobalString (mlir::Location loc, llvm::StringRef str, llvm::StringRef name) |
Create a private constant global holding the null-terminated string str, mirroring llvm::IRBuilder::CreateGlobalString. | |
| LangAS | getLangTempAllocaAddressSpace () const |
| Returns the address space for temporary allocations in the language. | |
| LangAS | getGlobalVarAddressSpace (const VarDecl *decl) |
| Return the AST address space of the underlying global variable for D, as determined by its declaration. | |
| mlir::ptr::MemorySpaceAttrInterface | getGlobalCIRAddressSpace (LangAS as) |
Return the CIR address space attribute for a global in as, honoring the target address space map where the LangAS fold would lose it. | |
| 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=nullptr, bool forPointeeType=false) |
| FIXME: this could likely be a common helper and not necessarily related with codegen. | |
| clang::CharUnits | getNaturalPointeeTypeAlignment (clang::QualType t, LValueBaseInfo *baseInfo=nullptr) |
| CharUnits | getMinimumClassObjectSize (const CXXRecordDecl *cd) |
| Returns the minimum object size for an object of the given class type (or a class derived from it). | |
| CharUnits | getMinimumObjectSize (QualType ty) |
| Returns the minimum object size for an object of the given type. | |
| 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 | shouldEmitFunction (clang::GlobalDecl gd) |
| Check if fd ends up calling itself directly through asm label or builtin-pointer-to-self trickery (e.g., glibc's extern inline libc wrappers that call __builtin_strrchr, which the codegen lowers to a call on the same asm-named symbol). | |
| 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) |
| cir::FuncOp | getRawFunctionPointer (GlobalDecl GD) |
| Return a function pointer for a reference to the given function. | |
| cir::FuncOp | getFunctionPointer (GlobalDecl GD) |
| Return the ABI-correct function pointer value for a reference to the given function. | |
| bool | mayVTableBeDuplicated (cir::GlobalLinkageKind linkage) const |
| Return true if a vtable with the given linkage may have more than one address in the program, in which case its address is insignificant and it can be marked unnamed_addr. | |
| 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 | addDeferredVTable (const CXXRecordDecl *rd) |
| void | emitGlobal (clang::GlobalDecl gd) |
| Emit code for a single global function or variable declaration. | |
| cir::FuncOp | emitAliasForGlobal (llvm::StringRef mangledName, mlir::Operation *op, GlobalDecl aliasGD, cir::FuncOp aliasee, cir::GlobalLinkageKind linkage) |
| Emit aliasGD as an alias of aliasee, replacing any existing declaration op, and return the alias. | |
| void | emitAliasDefinition (GlobalDecl gd) |
| Emit a definition for an __attribute__((alias)) declaration. | |
| mlir::Type | convertType (clang::QualType type) |
| void | setGlobalVisibility (cir::CIRGlobalValueInterface gv, 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, bool isExtendingDecl=false) |
| Set TLS mode for the given operation based on the given variable declaration. | |
| cir::TLSModel | 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 | setCIRFunctionAttributes (GlobalDecl gd, const CIRGenFunctionInfo &info, cir::FuncOp func, bool isThunk) |
| Set the CIR function attributes (Sext, zext, etc). | |
| void | setCIRFunctionAttributesForDefinition (const clang::Decl *decl, cir::FuncOp f) |
| Set extra attributes (inline, etc.) for a function. | |
| void | emitOpenCLKernelArgMetadata (cir::FuncOp func, const clang::FunctionDecl *fd) |
| Generate OpenCL kernel argument metadata for a kernel function. | |
| void | emitGlobalDefinition (clang::GlobalDecl gd, mlir::Operation *op=nullptr) |
| void | emitGlobalFunctionDefinition (clang::GlobalDecl gd, mlir::Operation *op) |
| void | emitSYCLKernelCaller (const clang::FunctionDecl *kernelEntryPointFn, clang::ASTContext &ctx) |
| Emit the SYCL kernel caller offload entry point function generated for a function declared with the sycl_kernel_entry_point attribute. | |
| void | addSYCLModuleIdAttr (cir::FuncOp fn) |
| void | emitGlobalVarDefinition (const clang::VarDecl *vd, bool isTentative=false) |
| void | emitCXXSpecialVarDeclInit (const VarDecl *varDecl, cir::GlobalOp addr, bool performInit, mlir::Region &ctorRegion, mlir::Region &dtorRegion) |
| Helper function for the below two that will create the constructor/destructor in specified regions, rather than in the GlobalOp. | |
| void | emitCXXStaticLocalVarDeclInit (const VarDecl *varDecl, cir::GlobalOp addr, bool performInit) |
| Emit the function that initializes the specified static-local variable. | |
| void | emitCXXGlobalVarDeclInit (const VarDecl *varDecl, cir::GlobalOp addr, bool performInit) |
| Emit the function that initializes the specified global. | |
| void | setGlobalTlsReferences (const VarDecl &vd, cir::GlobalOp globalOp) |
| 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::Value | getNullPointer (cir::PointerType ptrTy, QualType qt, mlir::Location loc) |
| Get target specific null pointer. | |
| 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) |
| mlir::TypedAttr | emitNullMemberAttr (QualType t, const MemberPointerType *mpt) |
| Returns a null attribute to represent either a null method or null data member, depending on the type of mpt. | |
| std::optional< llvm::SmallVector< int32_t > > | buildMemberPath (const CXXRecordDecl *destClass, const ValueDecl *decl) |
Build a GEP-style field-index path from destClass to decl. | |
| bool | isEmptyFieldForMemberPointer (const FieldDecl *field) |
Returns true if field is a potentially-overlapping field with no CIR field index (e.g. | |
| 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 | lookupRepresentativeDecl (llvm::StringRef mangledName, clang::GlobalDecl &gd) const |
| bool | supportsCOMDAT () const |
| void | maybeSetTrivialComdat (const clang::Decl &d, mlir::Operation *op) |
| void | printPostfixForExternalizedDecl (llvm::raw_ostream &os, const Decl *d) |
| Print the postfix for externalized static variable or kernels for single source offloading languages CUDA and HIP. | |
| void | replaceGlobal (cir::GlobalOp oldGV, cir::GlobalOp newGV) |
| Replace all uses of the old global with the new global, updating types and references as needed. | |
| 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::NamedAttrList extraAttrs={}) |
| cir::FuncOp | getOrCreateCIRFunction (llvm::StringRef mangledName, mlir::Type funcType, clang::GlobalDecl gd, bool forVTable, mlir::NamedAttrList 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 | setFuncInfoAttr (cir::FuncOp funcOp, const clang::FunctionDecl *funcDecl) |
| Record the func_info tag for a function, either a C++ special member form (constructor, destructor, assignment) or a known standard library entity that passes can recognize without the AST. | |
| cir::FuncOp | createRuntimeFunction (cir::FuncType ty, llvm::StringRef name, mlir::NamedAttrList extraAttrs={}, 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". | |
| CIRGenCUDARuntime & | getCUDARuntime () |
| CIRGenOpenMPRuntime & | getOpenMPRuntime () |
| bool | isPaddedAtomicType (QualType type) |
| bool | isPaddedAtomicType (const AtomicType *type) |
| mlir::IntegerAttr | getSize (CharUnits size) |
| void | emitDeferred () |
| Emit any needed decls for which code generation was deferred. | |
| bool | shouldOpportunisticallyEmitVTables () |
| void | emitDeferredVTables () |
| Emit any vtables which we deferred and still have a use for. | |
| void | emitVTablesOpportunistically () |
| Try to emit external vtables as available_externally if they have emitted all inlined virtual functions. | |
| void | emitGlobalDecl (const clang::GlobalDecl &d) |
| Helper for emitDeferred to apply actual codegen. | |
| const llvm::Triple & | getTriple () const |
| void | release () |
| mlir::Operation * | getAddrOfGlobalTemporary (const MaterializeTemporaryExpr *mte, const Expr *init) |
| Returns a pointer to a global variable representing a temporary with static or thread storage duration. | |
| cir::GlobalLinkageKind | getFunctionLinkage (GlobalDecl gd) |
| cir::GlobalLinkageKind | getCIRLinkageForDeclarator (const DeclaratorDecl *dd, GVALinkage linkage) |
| void | setFunctionLinkage (GlobalDecl gd, cir::FuncOp f) |
| cir::GlobalLinkageKind | getCIRLinkageVarDefinition (const VarDecl *vd) |
| 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) |
| void | error (SourceLocation loc, llvm::StringRef error) |
| Emit a general error that something can't be done. | |
| void | errorUnsupported (const Stmt *s, llvm::StringRef type) |
| Print out an error that codegen doesn't support the specified stmt yet. | |
| void | errorUnsupported (const Decl *d, llvm::StringRef type) |
| Print out an error that codegen doesn't support the specified decl yet. | |
| void | emitAMDGPUMetadata () |
| Emits AMDGPU specific Metadata. | |
| mlir::ArrayAttr | getOrCreateAnnotationArgs (const clang::AnnotateAttr *attr) |
| Build (or fetch from the dedup cache) the args ArrayAttr for an annotation. | |
| cir::AnnotationAttr | emitAnnotateAttr (const clang::AnnotateAttr *aa) |
| Create cir::AnnotationAttr for a single AnnotateAttr. | |
| void | addGlobalAnnotations (const clang::ValueDecl *d, mlir::Operation *gv) |
| Add global annotations for a global value (GlobalOp or FuncOp). | |
| Public Member Functions inherited from clang::CIRGen::CIRGenTypeCache | |
| CIRGenTypeCache () | |
| clang::CharUnits | getSizeSize () const |
| clang::CharUnits | getSizeAlign () const |
| clang::CharUnits | getPointerAlign () const |
| mlir::ptr::MemorySpaceAttrInterface | getCIRAllocaAddressSpace () const |
Static Public Member Functions | |
| static std::optional< cir::FramePointerKind > | getFramePointerKind (CodeGenOptions::FramePointerKind kind) |
Returns the frame pointer kind to record on functions and on the module, or std::nullopt when kind is CodeGenOptions::FramePointerKind::None, the default, which is left implicit. | |
| static cir::VisibilityKind | getCIRVisibilityKind (Visibility v) |
| static void | setInitializer (cir::GlobalOp &op, mlir::Attribute value) |
| static mlir::SymbolTable::Visibility | getMLIRVisibilityFromCIRLinkage (cir::GlobalLinkageKind GLK) |
| 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< const Decl *, cir::GlobalOp > | staticLocalDeclMap |
| llvm::DenseMap< const VarDecl *, cir::GlobalOp > | initializerConstants |
| llvm::StringMap< mlir::Operation * > | symbolLookupCache |
| Cache for O(1) symbol lookups by name, replacing the O(N) linear scan in SymbolTable::lookupSymbolIn that getGlobalValue used previously. | |
| llvm::StringMap< unsigned > | cgGlobalNames |
| llvm::DenseMap< mlir::Attribute, cir::GlobalOp > | constantStringMap |
| llvm::DenseMap< const UnnamedGlobalConstantDecl *, cir::GlobalOp > | unnamedGlobalConstantDeclMap |
| llvm::DenseMap< const CompoundLiteralExpr *, cir::GlobalOp > | emittedCompoundLiterals |
| std::vector< cir::CIRGlobalValueInterface > | llvmUsed |
| List of global values which are required to be present in the object file; This is used for forcing visibility of symbols which may otherwise be optimized out. | |
| std::vector< cir::CIRGlobalValueInterface > | llvmCompilerUsed |
| 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 |
| cir::MFloat8Type | mFloat8Ty |
| 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. | |
| mlir::ptr::MemorySpaceAttrInterface | cirAllocaAddressSpace |
This class organizes the cross-function state that is used while generating CIR code.
Definition at line 66 of file CIRGenModule.h.
| CIRGenModule::CIRGenModule | ( | mlir::MLIRContext & | mlirContext, |
| clang::ASTContext & | astContext, | ||
| const clang::CodeGenOptions & | cgo, | ||
| clang::DiagnosticsEngine & | diags ) |
Definition at line 84 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::LangOptionsBase::FPE_Ignore, clang::CIRGen::TargetCIRGenInfo::getCIRAllocaAddressSpace(), getCXXABI(), getDefaultCIRTLSModel(), clang::MangleContext::getKind(), getLangOpts(), clang::CIRGen::CIRGenCXXABI::getMangleContext(), getMLIRContext(), getModule(), clang::TargetCXXABI::getSpelling(), getTarget(), getTargetCIRGenInfo(), getTriple(), clang::CIRGen::CIRGenTypeCache::mFloat8Ty, clang::MangleContext::MK_Itanium, 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 |
References clang::CIRGen::Decl.
| void CIRGenModule::addCompilerUsedGlobal | ( | cir::CIRGlobalValueInterface | gv | ) |
Add a global value to the llvmCompilerUsed list.
Definition at line 1569 of file CIRGenModule.cpp.
References llvmCompilerUsed.
Referenced by release().
| void CIRGenModule::addDefaultFunctionAttributes | ( | StringRef | name, |
| bool | hasOptNoneAttr, | ||
| bool | attrOnCallSite, | ||
| mlir::NamedAttrList & | attrs ) |
Helper function for constructAttributeList/others.
This function matches the behavior of 'getDefaultFunctionAttributes' from classic codegen, despite the similarity of its name to 'addDefaultFunctionDefinitionAttributes', which is a caller of this function.
Builds a set of function attributes to add to a function based on language opts, codegen opts, and some small properties.
Definition at line 334 of file CIRGenCall.cpp.
References addMergeableDefaultFunctionAttributes(), addTrivialDefaultFunctionAttributes(), and getMLIRContext().
Referenced by constructAttributeList().
|
inline |
Definition at line 610 of file CIRGenModule.h.
References deferredDeclsToEmit.
Referenced by emitGlobal().
|
inline |
Definition at line 676 of file CIRGenModule.h.
| void CIRGenModule::addGlobalAnnotations | ( | const clang::ValueDecl * | d, |
| mlir::Operation * | gv ) |
Add global annotations for a global value (GlobalOp or FuncOp).
Definition at line 4786 of file CIRGenModule.cpp.
References emitAnnotateAttr(), clang::Decl::hasAttr(), clang::isa(), and clang::Decl::specific_attrs().
Referenced by emitGlobalVarDefinition().
| 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 788 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 802 of file CIRGenModule.cpp.
References errorNYI(), getASTContext(), and getTriple().
Referenced by emitGlobalFunctionDefinition().
|
inline |
Queue a record layout entry for materialization in release().
Definition at line 200 of file CIRGenModule.h.
| void CIRGenModule::addReplacement | ( | llvm::StringRef | name, |
| mlir::Operation * | op ) |
Definition at line 1999 of file CIRGenModule.cpp.
| void CIRGenModule::addSYCLModuleIdAttr | ( | cir::FuncOp | fn | ) |
Definition at line 88 of file CIRGenSYCL.cpp.
References getLangOpts(), getMLIRContext(), and getModule().
Referenced by emitSYCLKernelCaller(), and setCIRFunctionAttributesForDefinition().
| void CIRGenModule::addUsedGlobal | ( | cir::CIRGlobalValueInterface | gv | ) |
Add a global value to the llvmUsed list.
Definition at line 1562 of file CIRGenModule.cpp.
References llvmUsed.
| void CIRGenModule::addUsedOrCompilerUsedGlobal | ( | cir::CIRGlobalValueInterface | gv | ) |
Add a global to a list to be added to the llvm.compiler.used metadata.
Definition at line 1575 of file CIRGenModule.cpp.
References getTriple(), llvmCompilerUsed, and llvmUsed.
Referenced by setCommonAttributes().
| std::optional< llvm::SmallVector< int32_t > > CIRGenModule::buildMemberPath | ( | const CXXRecordDecl * | destClass, |
| const ValueDecl * | decl ) |
Build a GEP-style field-index path from destClass to decl.
decl may be a FieldDecl, or an IndirectFieldDecl(in the case of an anonymous struct/union). Returns std::nullopt and emits errorNYI for virtual-base paths.
Definition at line 2572 of file CIRGenModule.cpp.
References clang::cast(), and clang::ast_matchers::decl.
Referenced by emitMemberPointerConstant().
| mlir::Value CIRGenModule::castGlobalToDeclAddrSpace | ( | mlir::Value | addr, |
| const VarDecl & | vd ) |
Cast addr, the address of the global vd, to the address space of the declared type of vd if they differ.
Definition at line 1538 of file CIRGenModule.cpp.
References clang::CIRGen::CIRGenTypes::getPointerAddressSpace(), clang::ValueDecl::getType(), and getTypes().
Referenced by getAddrOfGlobalVar().
| cir::FuncOp CIRGenModule::codegenCXXStructor | ( | clang::GlobalDecl | gd | ) |
Definition at line 246 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 4464 of file CIRGenModule.cpp.
References getASTContext(), clang::ASTRecordLayout::getBaseClassOffset(), and clang::CharUnits::Zero().
| void CIRGenModule::constructAttributeList | ( | llvm::StringRef | name, |
| const CIRGenFunctionInfo & | info, | ||
| CIRGenCalleeInfo | calleeInfo, | ||
| mlir::NamedAttrList & | attrs, | ||
| llvm::MutableArrayRef< mlir::NamedAttrList > | argAttrs, | ||
| mlir::NamedAttrList & | retAttrs, | ||
| cir::CallingConv & | callingConv, | ||
| bool | attrOnCallSite, | ||
| bool | isThunk ) |
Get the CIR attributes and calling convention to use for a particular function type.
Construct the CIR attribute list of a function or call.
| name | - The function name. |
| info | - The function type information. |
| 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. |
| attrs | [out] - On return, the attribute list to use. |
| callingConv | [out] - On return, the calling convention to use. |
| attrOnCallSite | - Whether or not the attributes are on a call site. |
| isThunk | - Whether the function is a thunk. |
Definition at line 352 of file CIRGenCall.cpp.
References addAttributesFromFunctionProtoType(), addDefaultFunctionAttributes(), addNoBuiltinAttributes(), clang::CIRGen::Decl, clang::Decl::getAttr(), getBuilder(), clang::CIRGen::CIRGenCalleeInfo::getCalleeDecl(), clang::CIRGen::CIRGenCalleeInfo::getCalleeFunctionProtoType(), clang::GlobalDecl::getDecl(), getLangOpts(), getMLIRContext(), clang::Decl::hasAttr(), clang::CXXMethodDecl::isVirtual(), isVirtualCall(), kind, cir::MissingFeatures::opCallAttrs(), and clang::ast_matchers::type.
Referenced by setCIRFunctionAttributes().
| mlir::Type CIRGenModule::convertType | ( | clang::QualType | type | ) |
Definition at line 4435 of file CIRGenModule.cpp.
References clang::ast_matchers::type.
Referenced by createGlobalString(), emitGlobalVarDefinition(), emitMemberPointerConstant(), emitNullMemberAttr(), getAddrOfFunction(), getBuiltinLibFunction(), getConstantArrayFromStringLiteral(), getWeakRefReference(), and setFuncInfoAttr().
| 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 4041 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 3992 of file CIRGenModule.cpp.
References emitOpenACCRoutineDecl(), getLangOpts(), getMLIRContext(), getModule(), clang::FunctionDecl::hasPrototype(), cir::MissingFeatures::opFuncAstDeclAttr(), cir::MissingFeatures::opFuncExtraAttrs(), setFuncInfoAttr(), clang::Decl::specific_attrs(), and symbolLookupCache.
Referenced by createCIRBuiltinFunction(), emitAliasDefinition(), emitAliasForGlobal(), and emitSYCLKernelCaller().
| cir::GlobalOp CIRGenModule::createGlobalOp | ( | mlir::Location | loc, |
| llvm::StringRef | name, | ||
| mlir::Type | t, | ||
| bool | isConstant = false, | ||
| mlir::ptr::MemorySpaceAttrInterface | addrSpace = {}, | ||
| mlir::Operation * | insertPoint = nullptr ) |
Definition at line 833 of file CIRGenModule.cpp.
References getBuilder(), getModule(), lastGlobalOp, and symbolLookupCache.
Referenced by createOrReplaceCXXRuntimeVariable(), emitAliasDefinition(), emitAMDGPUWorkGroupSize(), emitUsed(), generateStringLiteral(), getAddrOfGlobalTemporary(), getAddrOfTemplateParamObject(), getAddrOfUnnamedGlobalConstantDecl(), release(), and tryEmitGlobalCompoundLiteral().
| cir::GlobalOp CIRGenModule::createGlobalString | ( | mlir::Location | loc, |
| llvm::StringRef | str, | ||
| llvm::StringRef | name ) |
Create a private constant global holding the null-terminated string str, mirroring llvm::IRBuilder::CreateGlobalString.
Definition at line 2462 of file CIRGenModule.cpp.
References convertType(), generateStringLiteral(), getUniqueGlobalName(), and clang::CharUnits::One().
| 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 2095 of file CIRGenModule.cpp.
References createGlobalOp(), errorNYI(), getGlobalValue(), getMLIRContext(), getMLIRVisibility(), getSize(), cir::isWeakForLinker(), setDSOLocal(), and supportsCOMDAT().
| cir::FuncOp CIRGenModule::createRuntimeFunction | ( | cir::FuncType | ty, |
| llvm::StringRef | name, | ||
| mlir::NamedAttrList | extraAttrs = {}, | ||
| bool | isLocal = false, | ||
| bool | assumeConvergent = false ) |
Definition at line 4143 of file CIRGenModule.cpp.
References errorNYI(), getMLIRContext(), getOrCreateCIRFunction(), cir::MissingFeatures::opFuncCallingConv(), cir::MissingFeatures::setLLVMFunctionFEnvAttributes(), and setWindowsItaniumDLLImport().
Referenced by emitAtomicIsLockFree(), emitAtomicLibCall(), getBadCastFn(), getItaniumDynamicCastFn(), and getPersonalityFn().
| Address CIRGenModule::createUnnamedGlobalFrom | ( | const VarDecl & | d, |
| mlir::Attribute | constAttr, | ||
| CharUnits | align ) |
Definition at line 770 of file CIRGenDecl.cpp.
References cir::MissingFeatures::addressSpace(), getLoc(), clang::Decl::getLocation(), getMangledName(), getMLIRVisibilityFromCIRLinkage(), getModule(), clang::NamedDecl::getName(), clang::Decl::getParentFunctionOrMethod(), clang::VarDecl::hasGlobalStorage(), initializerConstants, insertGlobalSymbol(), and clang::isa().
| void CIRGenModule::emitAliasDefinition | ( | GlobalDecl | gd | ) |
Emit a definition for an __attribute__((alias)) declaration.
Definition at line 4307 of file CIRGenModule.cpp.
References clang::cast(), cir::MissingFeatures::checkAliases(), clang::CIRGen::CIRGenTypes::convertTypeForMem(), createCIRFunction(), createGlobalOp(), eraseGlobalSymbol(), cir::MissingFeatures::generateDebugInfo(), clang::Decl::getAttr(), getCIRLinkageVarDefinition(), clang::GlobalDecl::getDecl(), getFunctionLinkage(), clang::CIRGen::CIRGenTypes::getFunctionType(), getGlobalValue(), getLoc(), getMangledName(), getMLIRVisibilityFromCIRLinkage(), clang::Decl::getSourceRange(), getTypes(), clang::Decl::hasAttr(), clang::isa(), clang::Decl::isWeakImported(), cir::MissingFeatures::opGlobalThreadLocal(), replaceUsesOfNonProtoTypeWithRealFunction(), and setCommonAttributes().
Referenced by emitGlobal().
| cir::FuncOp CIRGenModule::emitAliasForGlobal | ( | llvm::StringRef | mangledName, |
| mlir::Operation * | op, | ||
| GlobalDecl | aliasGD, | ||
| cir::FuncOp | aliasee, | ||
| cir::GlobalLinkageKind | linkage ) |
Emit aliasGD as an alias of aliasee, replacing any existing declaration op, and return the alias.
Definition at line 4389 of file CIRGenModule.cpp.
References clang::CIRGen::CIRGenTypes::arrangeCXXStructorDeclaration(), clang::cast(), createCIRFunction(), eraseGlobalSymbol(), clang::GlobalDecl::getDecl(), clang::CIRGen::CIRGenTypes::getFunctionType(), getLoc(), clang::Decl::getSourceRange(), getTypes(), and setCommonAttributes().
Referenced by emitConstructorDestructorAlias().
| void CIRGenModule::emitAMDGPUMetadata | ( | ) |
Emits AMDGPU specific Metadata.
Definition at line 21 of file CIRGenAMDGPU.cpp.
References clang::TargetOptions::Any, clang::TargetOptions::Enabled, getModule(), and clang::TargetOptions::Hostcall.
Referenced by release().
| cir::AnnotationAttr CIRGenModule::emitAnnotateAttr | ( | const clang::AnnotateAttr * | aa | ) |
Create cir::AnnotationAttr for a single AnnotateAttr.
Definition at line 4780 of file CIRGenModule.cpp.
References getMLIRContext(), and getOrCreateAnnotationArgs().
Referenced by addGlobalAnnotations().
| void CIRGenModule::emitCXXGlobalVarDeclInit | ( | const VarDecl * | varDecl, |
| cir::GlobalOp | addr, | ||
| bool | performInit ) |
Emit the function that initializes the specified global.
Definition at line 423 of file CIRGenCXX.cpp.
References emitCXXSpecialVarDeclInit(), clang::LangOptionsBase::FPE_Ignore, clang::LangOptions::getDefaultExceptionMode(), clang::LangOptions::getDefaultRoundingMode(), getLangOpts(), and clang::ast_matchers::varDecl.
Referenced by emitCXXGlobalVarDeclInitFunc().
| void CIRGenModule::emitCXXGlobalVarDeclInitFunc | ( | const VarDecl * | vd, |
| cir::GlobalOp | addr, | ||
| bool | performInit ) |
Definition at line 97 of file CIRGenDeclCXX.cpp.
References emitCXXGlobalVarDeclInit(), clang::CIRGen::CIRGenFunction::emitCXXGuardedInit(), getLangOpts(), clang::VarDecl::getTemplateSpecializationKind(), clang::VarDecl::getTLSKind(), clang::Decl::hasAttr(), clang::isTemplateInstantiation(), cir::MissingFeatures::msabi(), and clang::VarDecl::TLS_Dynamic.
Referenced by emitGlobalVarDefinition().
| void CIRGenModule::emitCXXSpecialVarDeclInit | ( | const VarDecl * | varDecl, |
| cir::GlobalOp | addr, | ||
| bool | performInit, | ||
| mlir::Region & | ctorRegion, | ||
| mlir::Region & | dtorRegion ) |
Helper function for the below two that will create the constructor/destructor in specified regions, rather than in the GlobalOp.
Definition at line 305 of file CIRGenCXX.cpp.
References cir::MissingFeatures::addressSpace(), clang::cast(), clang::QualType::DK_cxx_destructor, emitDeclDestroy(), emitDeclInit(), emitDeclInvariant(), clang::CIRGen::CIRGenFunction::emitReferenceBindingToExpr(), clang::CIRGen::CIRGenFunction::emitStoreOfScalar(), getASTContext(), clang::CIRGen::CIRGenFunction::getBuilder(), getCIRTemplateSpecializationKind(), getCIRTLSKind(), getMLIRContext(), clang::CIRGen::RValue::getValue(), clang::isa(), clang::Type::isReferenceType(), needsDtor(), cir::MissingFeatures::openMP(), clang::CIRGen::CIRGenFunction::LexicalScope::setAsGlobalInit(), clang::ast_matchers::varDecl, and wrapMultiBlockRegionInScope().
Referenced by emitCXXGlobalVarDeclInit(), and emitCXXStaticLocalVarDeclInit().
| void CIRGenModule::emitCXXStaticLocalVarDeclInit | ( | const VarDecl * | varDecl, |
| cir::GlobalOp | addr, | ||
| bool | performInit ) |
Emit the function that initializes the specified static-local variable.
Definition at line 455 of file CIRGenCXX.cpp.
References emitCXXSpecialVarDeclInit(), clang::VarDecl::TLS_None, and clang::ast_matchers::varDecl.
| void CIRGenModule::emitDeclContext | ( | const DeclContext * | dc | ) |
Definition at line 2673 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 510 of file CIRGenModule.cpp.
References clang::CUDA, deferredDeclsToEmit, emitDeferred(), emitDeferredVTables(), emitGlobalDecl(), emitSYCLKernelCaller(), getASTContext(), getLangOpts(), and cir::MissingFeatures::openMP().
Referenced by emitDeferred(), and release().
| void CIRGenModule::emitDeferredVTables | ( | ) |
Emit any vtables which we deferred and still have a use for.
Given that at some point we emitted a reference to one or more vtables, and that we are now at the end of the translation unit, decide whether we should emit them.
Definition at line 1078 of file CIRGenVTables.cpp.
References shouldEmitVTableAtEndOfTranslationUnit(), and shouldOpportunisticallyEmitVTables().
Referenced by emitDeferred().
| 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 2500 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 625 of file CIRGenModule.cpp.
References addDeferredDeclToEmit(), clang::CIRGen::CIRGenTypes::arrangeGlobalDeclaration(), clang::cast(), cir::MissingFeatures::deferredCXXGlobalInit(), deferredDecls, clang::VarDecl::Definition, emitAliasDefinition(), emitGlobalDefinition(), emitGlobalOpenACCDecl(), emitOMPDeclareMapper(), emitOMPDeclareReduction(), getAddrOfFunction(), getASTContext(), clang::GlobalDecl::getDecl(), clang::CIRGen::CIRGenTypes::getFunctionType(), getGlobalValue(), getMangledName(), getOrCreateCIRGlobal(), getTarget(), getTriple(), getTypes(), mayBeEmittedEagerly(), mustBeEmitted(), clang::CIRGen::NotForDefinition, cir::MissingFeatures::openMP(), shouldSkipAliasEmission(), and clang::ASTContext::Strong.
Referenced by emitTopLevelDecl().
| void CIRGenModule::emitGlobalDecl | ( | const clang::GlobalDecl & | d | ) |
Helper for emitDeferred to apply actual codegen.
Definition at line 471 of file CIRGenModule.cpp.
References emitGlobalDefinition(), clang::CIRGen::ForDefinition, getAddrOfGlobal(), getGlobalValue(), getMangledName(), and cir::MissingFeatures::openMP().
Referenced by emitDeferred().
| void CIRGenModule::emitGlobalDefinition | ( | clang::GlobalDecl | gd, |
| mlir::Operation * | op = nullptr ) |
Definition at line 1892 of file CIRGenModule.cpp.
References clang::cast(), clang::ast_matchers::decl, emitGlobalFunctionDefinition(), emitGlobalVarDefinition(), clang::CIRGen::CIRGenVTables::emitThunks(), errorNYI(), clang::GlobalDecl::getDecl(), getVTables(), clang::isa(), and shouldEmitFunction().
Referenced by emitGlobal(), and emitGlobalDecl().
| void CIRGenModule::emitGlobalFunctionDefinition | ( | clang::GlobalDecl | gd, |
| mlir::Operation * | op ) |
Definition at line 736 of file CIRGenModule.cpp.
References addGlobalCtor(), addGlobalDtor(), clang::CIRGen::CIRGenTypes::arrangeGlobalDeclaration(), clang::cast(), clang::CIRGen::CIRGenOpenMPRuntime::emitDeclareTargetFunction(), clang::Expr::EvaluateKnownConstInt(), clang::CIRGen::ForDefinition, clang::CIRGen::CIRGenFunction::generateCode(), getAddrOfFunction(), getASTContext(), clang::GlobalDecl::getDecl(), clang::CIRGen::CIRGenTypes::getFunctionType(), getLangOpts(), getMangledName(), getOpenMPRuntime(), 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::Stmt::getSourceRange(), clang::CIRGen::CIRGenFunction::OpenACCDataOperandInfo::name, and clang::CIRGen::CIRGenFunction::OpenACCDataOperandInfo::varValue.
| void CIRGenModule::emitGlobalOpenACCDeclareDecl | ( | const clang::OpenACCDeclareDecl * | cd | ) |
Definition at line 284 of file CIRGenDeclOpenACC.cpp.
References clang::OpenACCConstructDecl::clauses().
Referenced by emitGlobalOpenACCDecl(), and emitTopLevelDecl().
| void CIRGenModule::emitGlobalOpenACCRoutineDecl | ( | const clang::OpenACCRoutineDecl * | cd | ) |
Definition at line 300 of file CIRGenDeclOpenACC.cpp.
Referenced by emitGlobalOpenACCDecl(), and emitTopLevelDecl().
| void CIRGenModule::emitGlobalVarDefinition | ( | const clang::VarDecl * | vd, |
| bool | isTentative = false ) |
Definition at line 1621 of file CIRGenModule.cpp.
References addGlobalAnnotations(), convertType(), clang::CPlusPlus, clang::CUDA, cir::MissingFeatures::deferredCXXGlobalInit(), clang::QualType::DK_cxx_destructor, emitCXXGlobalVarDeclInitFunc(), emitNullConstantAttr(), errorNYI(), clang::VarDecl::getAnyInitializer(), clang::Decl::getAttr(), getBuilder(), getCIRLinkageVarDefinition(), getCUDARuntime(), getLangOpts(), getMLIRContext(), getMLIRVisibilityFromCIRLinkage(), getModule(), getOrCreateCIRGlobal(), getSize(), clang::VarDecl::getSourceRange(), clang::VarDecl::getTLSKind(), clang::Expr::getType(), clang::ValueDecl::getType(), clang::GVA_AvailableExternally, clang::CIRGen::CIRGenCUDARuntime::handleVarRegistration(), clang::Decl::hasAttr(), clang::VarDecl::hasConstantInitialization(), clang::VarDecl::hasFlexibleArrayInit(), clang::CIRGen::CIRGenCUDARuntime::internalizeDeviceSideVar(), clang::QualType::isConstantStorage(), clang::VarDecl::isConstexpr(), clang::QualType::isConstQualified(), clang::Type::isCUDADeviceBuiltinSurfaceType(), clang::Type::isCUDADeviceBuiltinTextureType(), clang::Type::isIncompleteType(), clang::Type::isReferenceType(), clang::Type::isSamplerT(), clang::VarDecl::isStaticLocal(), lastGlobalOp, cir::MissingFeatures::maybeHandleStaticInExternC(), maybeSetTrivialComdat(), clang::VarDecl::needsDestruction(), clang::OpenCL, cir::MissingFeatures::opGlobalDLLImportExport(), clang::ASTContext::PSF_Write, clang::ASTContext::SectionInfo::SectionFlags, setInitializer(), and setTLSMode().
Referenced by emitGlobalDefinition(), and emitTentativeDefinition().
| void CIRGenModule::emitLLVMUsed | ( | ) |
Emit llvm.used and llvm.compiler.used globals.
Definition at line 1616 of file CIRGenModule.cpp.
References emitUsed(), llvmCompilerUsed, and llvmUsed.
Referenced by release().
| mlir::Value CIRGenModule::emitMemberPointerConstant | ( | const UnaryOperator * | e | ) |
Definition at line 2520 of file CIRGenModule.cpp.
References clang::CIRGen::CIRGenTypes::arrangeCXXMethodDeclaration(), buildMemberPath(), clang::cast(), clang::Type::castAs(), convertType(), cir::MissingFeatures::cxxABI(), clang::ast_matchers::decl, clang::ast_matchers::fieldDecl, getAddrOfFunction(), getCXXABI(), clang::CIRGen::CIRGenTypes::getFunctionType(), getLoc(), clang::MemberPointerType::getMostRecentCXXRecordDecl(), clang::Stmt::getSourceRange(), clang::UnaryOperator::getSubExpr(), clang::Expr::getType(), getTypes(), and isEmptyFieldForMemberPointer().
| 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 1655 of file CIRGenExprConstant.cpp.
References emitNullConstantAttr().
| mlir::TypedAttr CIRGenModule::emitNullConstantAttr | ( | QualType | t | ) |
Definition at line 1664 of file CIRGenExprConstant.cpp.
References clang::Type::castAs(), emitNullConstantAttr(), emitNullMemberAttr(), clang::Type::getAs(), getASTContext(), getTypes(), and clang::Type::isMemberDataPointerType().
Referenced by emitGlobalVarDefinition(), emitNullConstant(), emitNullConstant(), emitNullConstantAttr(), and getOrCreateStaticVarDecl().
| 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 1699 of file CIRGenExprConstant.cpp.
Referenced by emitNullBaseClassInitialization().
| mlir::TypedAttr CIRGenModule::emitNullMemberAttr | ( | QualType | t, |
| const MemberPointerType * | mpt ) |
Returns a null attribute to represent either a null method or null data member, depending on the type of mpt.
Definition at line 2509 of file CIRGenModule.cpp.
References convertType(), and clang::Type::isMemberFunctionPointerType().
Referenced by emitNullConstantAttr().
| 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 emitGlobal(), and emitTopLevelDecl().
| void CIRGenModule::emitOMPDeclareReduction | ( | const OMPDeclareReductionDecl * | d | ) |
Definition at line 83 of file CIRGenDeclOpenMP.cpp.
References errorNYI(), and clang::Decl::getSourceRange().
Referenced by emitGlobal(), and 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 392 of file CIRGenDeclOpenACC.cpp.
References getLoc(), getModule(), and routineCounter.
Referenced by createCIRFunction().
| void CIRGenModule::emitOpenCLKernelArgMetadata | ( | cir::FuncOp | func, |
| const clang::FunctionDecl * | fd ) |
Generate OpenCL kernel argument metadata for a kernel function.
Definition at line 3729 of file CIRGenModule.cpp.
References errorNYI(), getASTContext(), getCodeGenOpts(), getMLIRContext(), getOpenCLKernelArgAddressSpace(), clang::ASTContext::getPrintingPolicy(), clang::opencl_constant, clang::FunctionDecl::parameters(), clang::pointeeType(), and clang::ast_matchers::type.
| void CIRGenModule::emitSYCLKernelCaller | ( | const clang::FunctionDecl * | kernelEntryPointFn, |
| clang::ASTContext & | ctx ) |
Emit the SYCL kernel caller offload entry point function generated for a function declared with the sycl_kernel_entry_point attribute.
Definition at line 99 of file CIRGenSYCL.cpp.
References addSYCLModuleIdAttr(), clang::CIRGen::CIRGenTypes::arrangeDeviceKernelCallerDeclaration(), clang::cast(), createCIRFunction(), clang::CIRGen::CIRGenFunction::emitSYCLKernelCaller(), clang::Decl::getAttr(), clang::FunctionDecl::getBody(), clang::ASTContext::getCanonicalType(), clang::CIRGen::CIRGenTypes::getFunctionType(), clang::SYCLKernelInfo::GetKernelName(), clang::ASTContext::getLangOpts(), getLoc(), clang::SYCLKernelCallStmt::getOutlinedFunctionDecl(), clang::FunctionDecl::getSourceRange(), clang::ASTContext::getSYCLKernelInfo(), getTargetCIRGenInfo(), getTypes(), clang::OutlinedFunctionDecl::param_begin(), clang::OutlinedFunctionDecl::param_end(), setCIRFunctionAttributes(), setCIRFunctionAttributesForDefinition(), setDSOLocal(), cir::MissingFeatures::setLLVMFunctionFEnvAttributes(), setSYCLKernelAttributes(), and clang::ASTContext::VoidTy.
Referenced by emitDeferred().
| void CIRGenModule::emitTentativeDefinition | ( | const VarDecl * | d | ) |
Definition at line 3103 of file CIRGenModule.cpp.
References deferredDecls, emitGlobalVarDefinition(), errorNYI(), getGlobalValue(), clang::VarDecl::getInit(), getMangledName(), clang::VarDecl::getSourceRange(), and mustBeEmitted().
| void CIRGenModule::emitTopLevelDecl | ( | clang::Decl * | decl | ) |
Definition at line 2688 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(), clang::isa(), clang::Module::isNamedModule(), and clang::Module::submodules().
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 125 of file CIRGenVTables.cpp.
| void CIRGenModule::emitVTablesOpportunistically | ( | ) |
Try to emit external vtables as available_externally if they have emitted all inlined virtual functions.
It runs after EmitDeferred() and therefore is not allowed to create new references to things that need to be emitted lazily.
Definition at line 1096 of file CIRGenVTables.cpp.
References getCXXABI(), getVTables(), and shouldOpportunisticallyEmitVTables().
Referenced by release().
|
inline |
Definition at line 272 of file CIRGenModule.h.
References symbolLookupCache.
Referenced by emitAliasDefinition(), emitAliasForGlobal(), getAddrOfGlobalTemporary(), and replaceGlobal().
| void CIRGenModule::error | ( | SourceLocation | loc, |
| llvm::StringRef | error ) |
Emit a general error that something can't be done.
Definition at line 4501 of file CIRGenModule.cpp.
References clang::DiagnosticsEngine::Error, error(), clang::DiagnosticsEngine::getCustomDiagID(), getDiags(), and clang::DiagnosticsEngine::Report().
Referenced by createCoroData(), and error().
|
inline |
Definition at line 986 of file CIRGenModule.h.
References clang::DiagnosticsEngine::Error.
|
inline |
Definition at line 979 of file CIRGenModule.h.
References clang::DiagnosticsEngine::Error.
|
inline |
Definition at line 971 of file CIRGenModule.h.
References clang::DiagnosticsEngine::Error.
| DiagnosticBuilder CIRGenModule::errorNYI | ( | SourceLocation | loc, |
| llvm::StringRef | feature ) |
Helpers to emit "not yet implemented" error diagnostics.
Definition at line 4489 of file CIRGenModule.cpp.
References clang::DiagnosticsEngine::Error.
Referenced by addGlobalDtor(), arrangeFreeFunctionLikeCall(), canEmitDelegateCallArgs(), checkSynthesizedClauses(), clang::CIRGen::CallArg::copyInto(), createCXXABI(), createNewGlobalView(), createOrReplaceCXXRuntimeVariable(), createRuntimeFunction(), decodeFixedType(), emitAtomicOp(), emitBinaryExpMaybeConstrainedFPBuiltin(), emitBuiltinAlloca(), emitCommonNeonBuiltinExpr(), emitCommonNeonSISDBuiltinExpr(), emitDeclContext(), emitDeclTargetVarDeclLValue(), emitGlobalDefinition(), emitGlobalVarDefinition(), clang::CIRGen::CIRGenFunction::emitLabelStmt(), emitLibCallForAtomicExpr(), emitLoadOfMatrixLValue(), clang::CIRGen::CIRGenFunction::emitLValue(), emitNeonCallToOp(), emitNullBaseClassInitialization(), emitNullConstant(), 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::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::emitOMPFlattenDirective(), clang::CIRGen::CIRGenFunction::emitOMPFlushDirective(), 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::emitOMPMasterTaskLoopDirective(), clang::CIRGen::CIRGenFunction::emitOMPMasterTaskLoopSimdDirective(), clang::CIRGen::CIRGenFunction::emitOMPMetaDirective(), clang::CIRGen::CIRGenFunction::emitOMPOrderedBlockAssocDirective(), clang::CIRGen::CIRGenFunction::emitOMPOrderedStandaloneDirective(), clang::CIRGen::CIRGenFunction::emitOMPParallelForSimdDirective(), clang::CIRGen::CIRGenFunction::emitOMPParallelGenericLoopDirective(), clang::CIRGen::CIRGenFunction::emitOMPParallelMaskedDirective(), clang::CIRGen::CIRGenFunction::emitOMPParallelMaskedTaskLoopDirective(), clang::CIRGen::CIRGenFunction::emitOMPParallelMaskedTaskLoopSimdDirective(), 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::emitOMPSplitDirective(), clang::CIRGen::CIRGenFunction::emitOMPStripeDirective(), clang::CIRGen::CIRGenFunction::emitOMPTargetDataDirective(), clang::CIRGen::CIRGenFunction::emitOMPTargetEnterDataDirective(), clang::CIRGen::CIRGenFunction::emitOMPTargetExitDataDirective(), emitOMPTargetImplicitCaptures(), 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(), emitOMPWorksharingLoop(), emitOpenCLKernelArgMetadata(), emitParallelOp(), emitPointerArithmetic(), clang::CIRGen::emitPseudoObjectExpr(), emitSuspendExpression(), emitTentativeDefinition(), emitTopLevelDecl(), errorBuiltinNYI(), errorNYI(), errorNYI(), errorStdcBitOpWidthNYI(), getAddrAndTypeOfCXXStructor(), getAddrOfFunction(), getAddrOfGlobalTemporary(), getAddrOfRTTIDescriptor(), getAddrOfUnnamedGlobalConstantDecl(), getGlobalForStringLiteral(), getGlobalVarAddressSpace(), getMangledName(), getMangledNameImpl(), getNewInitValue(), getOrCreateAnnotationArgs(), getOrCreateCriticalDeclare(), getOrCreateStaticVarDecl(), getStaticDeclName(), getWeakRefReference(), printPostfixForExternalizedDecl(), pushTemporaryCleanup(), setGlobalTlsReferences(), and shouldAssumeDSOLocal().
|
inline |
Definition at line 996 of file CIRGenModule.h.
References errorNYI(), and clang::SourceRange::getBegin().
| DiagnosticBuilder CIRGenModule::errorNYI | ( | SourceRange | loc, |
| llvm::StringRef | feature ) |
Definition at line 4496 of file CIRGenModule.cpp.
References errorNYI(), and clang::SourceRange::getBegin().
| void CIRGenModule::errorUnsupported | ( | const Decl * | d, |
| llvm::StringRef | type ) |
Print out an error that codegen doesn't support the specified decl yet.
Definition at line 4515 of file CIRGenModule.cpp.
References clang::CIRGen::Decl, clang::DiagnosticsEngine::Error, clang::Decl::getLocation(), and clang::ast_matchers::type.
| void CIRGenModule::errorUnsupported | ( | const Stmt * | s, |
| llvm::StringRef | type ) |
Print out an error that codegen doesn't support the specified stmt yet.
Definition at line 4507 of file CIRGenModule.cpp.
References clang::DiagnosticsEngine::Error, clang::Stmt::getBeginLoc(), clang::Stmt::getSourceRange(), and clang::ast_matchers::type.
Referenced by getAddrOfTemplateParamObject().
| 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 2880 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(), getAddrOfCXXStructor(), and pushTemporaryCleanup().
|
inline |
Definition at line 475 of file CIRGenModule.h.
References emittedCompoundLiterals.
Referenced by tryEmitGlobalCompoundLiteral().
| 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 2450 of file CIRGenModule.cpp.
References getBuilder(), getGlobalForStringLiteral(), cir::CIRBaseBuilderTy::getPointerTo(), clang::Expr::getType(), and getTypes().
|
inline |
Definition at line 571 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 2908 of file CIRGenModule.cpp.
References clang::cast(), convertType(), clang::Dtor_Complete, errorNYI(), getCUDARuntime(), getCXXABI(), clang::GlobalDecl::getDecl(), clang::GlobalDecl::getDtorType(), clang::CIRGen::CIRGenCUDARuntime::getKernelHandle(), getMangledName(), getOrCreateCIRFunction(), and getTarget().
Referenced by emitGlobal(), emitGlobalFunctionDefinition(), emitMemberPointerConstant(), emitNewDeleteCall(), getAddrOfGlobal(), and getRawFunctionPointer().
| mlir::Operation * CIRGenModule::getAddrOfGlobal | ( | clang::GlobalDecl | gd, |
| ForDefinition_t | isForDefinition = NotForDefinition ) |
Definition at line 445 of file CIRGenModule.cpp.
References clang::CIRGen::CIRGenTypes::arrangeCXXMethodDeclaration(), clang::CIRGen::CIRGenTypes::arrangeGlobalDeclaration(), clang::cast(), clang::CIRGen::Decl, getAddrOfCXXStructor(), getAddrOfFunction(), clang::GlobalDecl::getDecl(), clang::CIRGen::CIRGenTypes::getFunctionType(), getOrCreateCIRGlobal(), getTypes(), and clang::isa().
Referenced by emitConstructorDestructorAlias(), emitGlobalDecl(), and getOrCreateStaticVarDecl().
| mlir::Operation * CIRGenModule::getAddrOfGlobalTemporary | ( | const MaterializeTemporaryExpr * | mte, |
| const Expr * | init ) |
Returns a pointer to a global variable representing a temporary with static or thread storage duration.
Definition at line 4522 of file CIRGenModule.cpp.
References cir::MissingFeatures::addressSpace(), clang::cast(), clang::CIRGen::CIRGenTypes::convertTypeForMem(), createGlobalOp(), eraseGlobalSymbol(), errorNYI(), clang::Expr::EvaluateAsRValue(), getASTContext(), getCIRLinkageVarDefinition(), getCXXABI(), clang::MaterializeTemporaryExpr::getExtendingDecl(), clang::Decl::getLexicalDeclContext(), getLoc(), clang::CIRGen::CIRGenCXXABI::getMangleContext(), clang::MaterializeTemporaryExpr::getManglingNumber(), getMLIRVisibilityFromCIRLinkage(), clang::MaterializeTemporaryExpr::getOrCreateValue(), clang::Stmt::getSourceRange(), clang::MaterializeTemporaryExpr::getStorageDuration(), clang::Expr::getType(), clang::ASTContext::getTypeAlignInChars(), getTypes(), clang::Expr::EvalStatus::hasSideEffects(), clang::isa(), clang::QualType::isConstantStorage(), clang::MangleContext::mangleReferenceTemporary(), clang::out, clang::SD_Static, clang::SD_Thread, cir::MissingFeatures::setDLLStorageClass(), setGVProperties(), setTLSMode(), supportsCOMDAT(), clang::ast_matchers::type, clang::Expr::EvalResult::Val, and clang::ast_matchers::varDecl.
Referenced by createReferenceTemporary(), and pushTemporaryCleanup().
| 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 1520 of file CIRGenModule.cpp.
References castGlobalToDeclAddrSpace(), clang::CIRGen::CIRGenTypes::convertTypeForMem(), getLoc(), getOrCreateCIRGlobal(), clang::VarDecl::getSourceRange(), clang::VarDecl::getTLSKind(), clang::ValueDecl::getType(), getTypes(), clang::VarDecl::hasGlobalStorage(), clang::VarDecl::isLocalVarDecl(), and clang::VarDecl::TLS_None.
Referenced by emitDeclDestroy(), emitDeclInit(), emitDeclInvariant(), and emitGlobalVarDeclLValue().
| cir::GlobalViewAttr CIRGenModule::getAddrOfGlobalVarAttr | ( | const VarDecl * | d | ) |
Return the mlir::GlobalViewAttr for the address of the given global.
Definition at line 1552 of file CIRGenModule.cpp.
References 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 4446 of file CIRGenModule.cpp.
References errorNYI(), clang::CIRGen::CIRGenCXXABI::getAddrOfRTTIDescriptor(), getCXXABI(), clang::Type::isObjCObjectPointerType(), and shouldEmitRTTI().
Referenced by emitDynamicCastInfo().
| cir::GlobalOp CIRGenModule::getAddrOfTemplateParamObject | ( | const TemplateParamObjectDecl * | tpo | ) |
Get the GlobalOp of a template parameter object.
Definition at line 4701 of file CIRGenModule.cpp.
References cir::MissingFeatures::addressSpace(), clang::cast(), createGlobalOp(), clang::CIRGen::ConstantEmitter::emitForInitializer(), errorUnsupported(), clang::CIRGen::ConstantEmitter::finalize(), clang::CharUnits::getAsAlign(), getGlobalValue(), clang::LinkageInfo::getLinkage(), clang::NamedDecl::getLinkageAndVisibility(), getMangledName(), getNaturalTypeAlignment(), clang::ValueDecl::getType(), clang::TemplateParamObjectDecl::getValue(), insertGlobalSymbol(), clang::isExternallyVisible(), setInitializer(), and supportsCOMDAT().
| cir::FuncOp CIRGenModule::getAddrOfThunk | ( | StringRef | name, |
| mlir::Type | fnTy, | ||
| GlobalDecl | gd ) |
Get or create a thunk function with the given name and type.
Definition at line 29 of file CIRGenVTables.cpp.
References getOrCreateCIRFunction().
| cir::GlobalOp CIRGenModule::getAddrOfUnnamedGlobalConstantDecl | ( | const UnnamedGlobalConstantDecl * | gcd | ) |
Definition at line 4655 of file CIRGenModule.cpp.
References cir::MissingFeatures::addressSpace(), createGlobalOp(), clang::CIRGen::ConstantEmitter::emitForInitializer(), errorNYI(), clang::CIRGen::ConstantEmitter::finalize(), clang::CharUnits::getAsAlign(), getASTContext(), clang::Decl::getSourceRange(), clang::ValueDecl::getType(), clang::ASTContext::getTypeAlignInChars(), clang::UnnamedGlobalConstantDecl::getValue(), clang::APValue::isAbsent(), setInitializer(), and unnamedGlobalConstantDeclMap.
|
inline |
Definition at line 203 of file CIRGenModule.h.
Referenced by addGlobalDtor(), checkAtomicAlignment(), computeNonVirtualBaseClassOffset(), clang::CIRGen::CreateCIRGenItaniumCXXABI(), createCXXABI(), emitCXXSpecialVarDeclInit(), emitDeclInit(), emitDeferred(), emitGlobal(), emitGlobalFunctionDefinition(), emitNullConstant(), emitNullConstantAttr(), emitOpenCLKernelArgMetadata(), emitUsed(), getAddrOfGlobalTemporary(), getAddrOfUnnamedGlobalConstantDecl(), getDynamicOffsetAlignment(), getFeatureDeltaFromDefault(), getMangledNameImpl(), getMinimumClassObjectSize(), getMinimumObjectSize(), getOpenACCBindMangledName(), getOrCreateStaticVarDecl(), getTypeInfoLinkage(), getVBaseAlignment(), handleCXXStaticMemberVarInstantiation(), initCatchParam(), maybeSetTrivialComdat(), mustBeEmitted(), printPostfixForExternalizedDecl(), release(), clang::CIRGen::setAMDGPUTargetFunctionAttributes(), setCIRFunctionAttributesForDefinition(), setFuncInfoAttr(), setGlobalVisibility(), shouldEmitFunction(), and tryEmitGlobalCompoundLiteral().
|
inline |
The atomic options in effect at the point currently being emitted.
clang::atomic adjusts these for the extent of the statement it is attached to, so they are module state rather than a fixed language option.
Definition at line 213 of file CIRGenModule.h.
Referenced by setAMDGPUAtomicMetadata().
|
inline |
Definition at line 197 of file CIRGenModule.h.
Referenced by constructAttributeList(), createGlobalOp(), createNewGlobalView(), createReferenceTemporary(), emitArraySubscriptPtr(), emitGlobalVarDefinition(), emitNullConstant(), emitNullConstantForBase(), emitUsed(), generateStringLiteral(), getAddrOfConstantStringFromLiteral(), getNewInitValue(), clang::CIRGen::TargetCIRGenInfo::getNullPointer(), getOrCreateCopyThunk(), getPersonalityFn(), pushTemporaryCleanup(), clang::CIRGen::setAMDGPUTargetFunctionAttributes(), and tryEmitGlobalCompoundLiteral().
| 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 3537 of file CIRGenBuiltin.cpp.
References convertType(), getMangledName(), getOrCreateCIRFunction(), getTarget(), clang::CodeGenUtils::getTargetBuiltinLibFunctionName(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), and clang::ast_matchers::type.
| cir::GlobalLinkageKind CIRGenModule::getCIRLinkageForDeclarator | ( | const DeclaratorDecl * | dd, |
| GVALinkage | linkage ) |
Definition at line 2135 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 clang::CodeGenUtils::isVarDeclStrongDefinition().
Referenced by getCIRLinkageVarDefinition(), and getFunctionLinkage().
| cir::GlobalLinkageKind CIRGenModule::getCIRLinkageVarDefinition | ( | const VarDecl * | vd | ) |
Definition at line 2333 of file CIRGenModule.cpp.
References getCIRLinkageForDeclarator().
Referenced by canEmitSpuriousReferenceToVariable(), emitAliasDefinition(), emitGlobalVarDefinition(), and getAddrOfGlobalTemporary().
|
inlinestatic |
Definition at line 455 of file CIRGenModule.h.
References clang::DefaultVisibility, clang::HiddenVisibility, and clang::ProtectedVisibility.
Referenced by setGlobalVisibility().
| 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 287 of file CIRGenModule.cpp.
References clang::CXXRecordDecl::hasDefinition(), clang::CXXRecordDecl::isEffectivelyFinal(), and clang::CharUnits::One().
Referenced by getNaturalTypeAlignment(), and performReturnAdjustment().
|
inline |
Definition at line 205 of file CIRGenModule.h.
Referenced by collectClobbers(), emitDeclDestroy(), emitNewDeleteCall(), emitOpenCLKernelArgMetadata(), getCIRGenToUse(), getCIRLinkageForDeclarator(), getDefaultCIRTLSModel(), clang::CIRGen::getEHPersonality(), inferFlavor(), setWindowsItaniumDLLImport(), shouldAssumeDSOLocal(), shouldCIREmitFPMathIntrinsic(), shouldEmitAvailableExternallyVTable(), and shouldEmitVTableThunk().
| mlir::Attribute CIRGenModule::getConstantArrayFromStringLiteral | ( | const StringLiteral * | e | ) |
Return a constant array for the given string.
Definition at line 1928 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 903 of file CIRGenModule.h.
Referenced by emitFunctionDeclLValue(), emitGlobalVarDefinition(), getAddrOfFunction(), release(), and replaceGlobal().
|
inline |
Definition at line 216 of file CIRGenModule.h.
Referenced by calculateCookiePadding(), CIRGenModule(), commonBuildCXXMemberOrOperatorCall(), emitCXXTypeidOperand(), emitDeclDestroy(), emitDestroyingObjectDelete(), emitDynamicCastToNull(), emitMemberInitializer(), emitMemberPointerConstant(), emitObjectDelete(), emitTopLevelDecl(), emitVTablesOpportunistically(), getAddrAndTypeOfCXXStructor(), getAddrOfFunction(), getAddrOfGlobalTemporary(), getAddrOfRTTIDescriptor(), getAddrOfVTTVTable(), getFunctionLinkage(), getGlobalForStringLiteral(), getMangledName(), getMangledNameImpl(), getOrCreateCopyThunk(), getVTableLinkage(), performReturnAdjustment(), clang::CIRGen::CIRGenCallee::prepareConcreteCallee(), setCIRFunctionAttributesForDefinition(), setFunctionAttributes(), setGlobalTlsReferences(), setThunkProperties(), shouldEmitAvailableExternallyVTable(), and shouldEmitFunction().
|
inline |
Definition at line 219 of file CIRGenModule.h.
References getModule().
Referenced by checkAtomicAlignment(), computeFullLaneShuffleMask(), createNewGlobalView(), deriveNeonSISDIntrinsicOperandTypes(), emitAsmStores(), emitAtomicCmpXchg(), emitCommonNeonSISDBuiltinExpr(), emitCXXNewAllocSize(), emitNeonMultiVecLoadCall(), emitNeonRShiftImm(), emitUsed(), enterNewDeleteCleanup(), getSVEVectorForElementType(), getVTableEntryIndex(), and isFullSizeType().
| cir::TLSModel CIRGenModule::getDefaultCIRTLSModel | ( | ) | const |
Get TLS mode from CodeGenOptions.
Definition at line 3402 of file CIRGenModule.cpp.
References clang::CodeGenOptions::GeneralDynamicTLSModel, getCodeGenOpts(), clang::CodeGenOptions::InitialExecTLSModel, clang::CodeGenOptions::LocalDynamicTLSModel, and clang::CodeGenOptions::LocalExecTLSModel.
Referenced by CIRGenModule(), and setTLSMode().
|
inline |
Definition at line 206 of file CIRGenModule.h.
Referenced by checkAtomicAlignment(), collectClobbers(), emitAsmStores(), and error().
| CharUnits CIRGenModule::getDynamicOffsetAlignment | ( | CharUnits | actualBaseAlign, |
| const CXXRecordDecl * | baseDecl, | ||
| CharUnits | expectedTargetAlign ) |
TODO: Add TBAAAccessInfo.
Definition at line 885 of file CIRGenClass.cpp.
References getASTContext(), clang::ASTContext::getASTRecordLayout(), clang::ASTRecordLayout::getNonVirtualAlignment(), and clang::TagDecl::isCompleteDefinition().
Referenced by getVBaseAlignment().
|
static |
Returns the frame pointer kind to record on functions and on the module, or std::nullopt when kind is CodeGenOptions::FramePointerKind::None, the default, which is left implicit.
Definition at line 208 of file CIRGenCall.cpp.
References clang::CodeGenOptions::All, kind, clang::CodeGenOptions::None, clang::CodeGenOptions::NonLeaf, clang::CodeGenOptions::NonLeafNoReserve, and clang::CodeGenOptions::Reserved.
Referenced by addTrivialDefaultFunctionAttributes(), and release().
| cir::GlobalLinkageKind CIRGenModule::getFunctionLinkage | ( | GlobalDecl | gd | ) |
Definition at line 2338 of file CIRGenModule.cpp.
References clang::cast(), getCIRLinkageForDeclarator(), getCXXABI(), clang::CIRGen::CIRGenCXXABI::getCXXDestructorLinkage(), clang::GlobalDecl::getDecl(), and clang::GlobalDecl::getDtorType().
Referenced by emitAliasDefinition(), emitConstructorDestructorAlias(), getCIRGenToUse(), setFunctionLinkage(), and shouldEmitFunction().
| cir::FuncOp CIRGenModule::getFunctionPointer | ( | GlobalDecl | GD | ) |
Return the ABI-correct function pointer value for a reference to the given function.
This will apply a pointer signature if necessary, caching the result for the given function.
Definition at line 24 of file CIRGenPointerAuth.cpp.
References getRawFunctionPointer(), and cir::MissingFeatures::pointerAuthentication().
Referenced by emitFunctionDeclLValue().
| mlir::ptr::MemorySpaceAttrInterface CIRGenModule::getGlobalCIRAddressSpace | ( | LangAS | as | ) |
Return the CIR address space attribute for a global in as, honoring the target address space map where the LangAS fold would lose it.
Definition at line 2476 of file CIRGenModule.cpp.
References clang::CIRGen::TargetCIRGenInfo::getGlobalCIRAddressSpace(), and getTargetCIRGenInfo().
Referenced by generateStringLiteral(), getOrCreateStaticVarDecl(), and release().
| 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 2404 of file CIRGenModule.cpp.
References constantStringMap, errorNYI(), generateStringLiteral(), clang::StringLiteral::getBeginLoc(), getConstantArrayFromStringLiteral(), getCXXABI(), getLangOpts(), getLoc(), clang::CharUnits::getQuantity(), getSize(), clang::Stmt::getSourceRange(), clang::Expr::getType(), getUniqueGlobalName(), clang::SourceLocation::isValid(), cir::MissingFeatures::sanitizers(), and setDSOLocal().
Referenced by getAddrOfConstantStringFromLiteral().
| mlir::Operation * CIRGenModule::getGlobalValue | ( | llvm::StringRef | ref | ) |
Definition at line 827 of file CIRGenModule.cpp.
References symbolLookupCache.
Referenced by createOrReplaceCXXRuntimeVariable(), emitAliasDefinition(), emitAMDGPUWorkGroupSize(), emitConstructorDestructorAlias(), emitGlobal(), emitGlobalDecl(), emitScalarPrivatizer(), emitTentativeDefinition(), getAddrOfTemplateParamObject(), getUniqueGlobalName(), getWeakRefReference(), and lookupFuncOp().
Return the AST address space of the underlying global variable for D, as determined by its declaration.
Normally this is the same as the address space of D's type, but in CUDA, address spaces are associated with declarations, not types. If D is nullptr, return the default address space for global variable.
For languages without explicit address spaces, if D has default address space, target-specific global or constant address space may be returned.
Definition at line 1068 of file CIRGenModule.cpp.
References clang::cuda_constant, clang::cuda_device, clang::cuda_shared, clang::Default, errorNYI(), clang::FirstTargetAddressSpace, clang::QualType::getAddressSpace(), clang::CIRGen::TargetCIRGenInfo::getGlobalVarAddressSpace(), clang::VarDecl::getSourceRange(), getTargetCIRGenInfo(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), clang::QualType::isConstQualified(), clang::opencl_constant, clang::opencl_global, clang::opencl_global_device, clang::opencl_global_host, clang::opencl_local, and clang::sycl_global.
Referenced by getOrCreateCIRGlobal(), getOrCreateStaticVarDecl(), and release().
|
inline |
Definition at line 594 of file CIRGenModule.h.
|
inline |
Definition at line 597 of file CIRGenModule.h.
|
inline |
Definition at line 208 of file CIRGenModule.h.
Referenced by addSYCLModuleIdAttr(), CIRGenModule(), constructAttributeList(), createCIRFunction(), emitCXXGlobalVarDeclInit(), emitCXXGlobalVarDeclInitFunc(), emitDeferred(), emitFunctionDeclLValue(), emitGlobalFunctionDefinition(), emitGlobalVarDefinition(), generateStringLiteral(), getCIRLinkageForDeclarator(), clang::CIRGen::getEHPersonality(), getGlobalForStringLiteral(), clang::CIRGen::TargetCIRGenInfo::getGlobalVarAddressSpace(), getLangTempAllocaAddressSpace(), getMangledNameImpl(), getOrCreateStaticVarDecl(), getStaticDeclName(), getTypeInfoLinkage(), printPostfixForExternalizedDecl(), release(), replaceGlobal(), clang::CIRGen::setAMDGPUTargetFunctionAttributes(), setCIRFunctionAttributesForDefinition(), setGlobalTlsReferences(), setGlobalVisibility(), shouldAssumeDSOLocal(), shouldEmitBuiltinAsIR(), shouldEmitRTTI(), shouldSkipAliasEmission(), 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 2481 of file CIRGenModule.cpp.
References clang::Default, getLangOpts(), clang::OpenCL, clang::opencl_private, and cir::MissingFeatures::openMP().
| mlir::Location CIRGenModule::getLoc | ( | clang::SourceLocation | cLoc | ) |
Helpers to convert the presumed location of Clang's SourceLocation to an MLIR Location.
Definition at line 427 of file CIRGenModule.cpp.
References clang::PresumedLoc::getColumn(), clang::PresumedLoc::getFilename(), clang::PresumedLoc::getLine(), clang::SourceManager::getPresumedLoc(), and clang::SourceLocation::isValid().
Referenced by createUnnamedGlobalFrom(), emitAliasDefinition(), emitAliasForGlobal(), emitGlobalOpenACCDeclareDataOperands(), emitMemberPointerConstant(), emitOpenACCRoutineDecl(), emitStoresForConstant(), emitSYCLKernelCaller(), getAddrOfGlobalTemporary(), getAddrOfGlobalVar(), getGlobalForStringLiteral(), getLoc(), getOrCreateCIRGlobal(), getOrCreateStaticVarDecl(), getWeakRefReference(), pushTemporaryCleanup(), release(), and tryEmitGlobalCompoundLiteral().
| mlir::Location CIRGenModule::getLoc | ( | clang::SourceRange | cRange | ) |
Definition at line 436 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 3072 of file CIRGenModule.cpp.
References clang::cast(), errorNYI(), clang::GlobalDecl::getCanonicalDecl(), getCXXABI(), clang::GlobalDecl::getDecl(), getMangledNameImpl(), and getTarget().
Referenced by createUnnamedGlobalFrom(), emitAliasDefinition(), emitConstructorDestructorAlias(), emitGlobal(), emitGlobalDecl(), emitGlobalFunctionDefinition(), emitGlobalOpenACCDeclareDataOperands(), emitTentativeDefinition(), getAddrAndTypeOfCXXStructor(), getAddrOfFunction(), getAddrOfTemplateParamObject(), getBuiltinLibFunction(), getOrCreateCIRGlobal(), getOrCreateStaticVarDecl(), and getStaticDeclName().
| CharUnits CIRGenModule::getMinimumClassObjectSize | ( | const CXXRecordDecl * | rd | ) |
Returns the minimum object size for an object of the given class type (or a class derived from it).
Return the smallest possible amount of storage that might be allocated starting from the beginning of an object of a particular class.
This may be smaller than sizeof(RD) if RD has virtual base classes.
Definition at line 298 of file CIRGenClass.cpp.
References getASTContext(), clang::ASTContext::getASTRecordLayout(), clang::ASTRecordLayout::getSize(), clang::CXXRecordDecl::hasDefinition(), clang::CXXRecordDecl::isEffectivelyFinal(), and clang::CharUnits::One().
Referenced by getMinimumObjectSize().
Returns the minimum object size for an object of the given type.
Definition at line 554 of file CIRGenModule.h.
References clang::Type::getAsCXXRecordDecl(), getASTContext(), getMinimumClassObjectSize(), and clang::ASTContext::getTypeSizeInChars().
|
inline |
Definition at line 217 of file CIRGenModule.h.
Referenced by addDefaultFunctionAttributes(), addSYCLModuleIdAttr(), CIRGenModule(), constructAttributeList(), createCIRFunction(), createOrReplaceCXXRuntimeVariable(), createRuntimeFunction(), emitAMDGPUWorkGroupSize(), emitAnnotateAttr(), emitCallToBadCast(), emitCXXSpecialVarDeclInit(), emitGlobalOpenACCDeclareDataOperands(), emitGlobalVarDefinition(), emitOpenCLKernelArgMetadata(), emitStoresForConstant(), emitUsed(), getConstantArrayFromStringLiteral(), release(), setCIRFunctionAttributesForDefinition(), setFuncInfoAttr(), setFunctionAttributes(), setFunctionLinkage(), setGlobalTlsReferences(), and setLinkageForFunction().
|
static |
Definition at line 4168 of file CIRGenModule.cpp.
References getMLIRVisibilityFromCIRLinkage().
Referenced by createOrReplaceCXXRuntimeVariable(), clang::CIRGen::CIRGenVTables::emitVTTDefinition(), and clang::CIRGen::CIRGenVTables::generateConstructionVTable().
|
static |
Definition at line 4177 of file CIRGenModule.cpp.
Referenced by createUnnamedGlobalFrom(), emitAliasDefinition(), emitGlobalVarDefinition(), getAddrOfGlobalTemporary(), getMLIRVisibility(), getOrCreateStaticVarDecl(), setFunctionLinkage(), and setLinkageForFunction().
|
inline |
Definition at line 196 of file CIRGenModule.h.
Referenced by addSYCLModuleIdAttr(), CIRGenModule(), createCIRFunction(), createGlobalOp(), createUnnamedGlobalFrom(), emitAMDGPUMetadata(), emitGlobalOpenACCDeclareDataOperands(), emitGlobalVarDefinition(), emitOpenACCRoutineDecl(), emitScalarPrivatizer(), emitStoresForConstant(), getDataLayout(), getOrCreateCopyThunk(), getOrCreateCriticalDeclare(), getOrCreateStaticVarDecl(), getVTableEntryIndex(), release(), replaceGlobal(), and verifyModule().
| CharUnits CIRGenModule::getNaturalPointeeTypeAlignment | ( | clang::QualType | t, |
| LValueBaseInfo * | baseInfo = nullptr ) |
Definition at line 364 of file CIRGenModule.cpp.
References getNaturalTypeAlignment(), and clang::Type::getPointeeType().
| CharUnits CIRGenModule::getNaturalTypeAlignment | ( | clang::QualType | t, |
| LValueBaseInfo * | baseInfo = nullptr, | ||
| bool | forPointeeType = false ) |
FIXME: this could likely be a common helper and not necessarily related with codegen.
Definition at line 302 of file CIRGenModule.cpp.
References clang::CIRGen::AttributedType, clang::CharUnits::fromQuantity(), clang::Type::getAs(), clang::Type::getAsCXXRecordDecl(), getClassPointerAlignment(), clang::QualType::getQualifiers(), clang::CharUnits::getQuantity(), clang::Qualifiers::hasUnaligned(), clang::Type::isArrayType(), clang::Type::isIncompleteType(), clang::CharUnits::One(), cir::MissingFeatures::opTBAA(), and clang::CIRGen::Type.
Referenced by getAddrOfTemplateParamObject(), and getNaturalPointeeTypeAlignment().
| mlir::Value CIRGenModule::getNullPointer | ( | cir::PointerType | ptrTy, |
| QualType | qt, | ||
| mlir::Location | loc ) |
Get target specific null pointer.
Definition at line 1659 of file CIRGenExprConstant.cpp.
References getTargetCIRGenInfo().
| std::string CIRGenModule::getOpenACCBindMangledName | ( | const IdentifierInfo * | bindName, |
| const FunctionDecl * | attachedFunction ) |
Definition at line 3058 of file CIRGenModule.cpp.
References createOpenACCBindTempFunction(), clang::ASTContext::Deallocate(), getASTContext(), and getMangledNameImpl().
|
inline |
Definition at line 908 of file CIRGenModule.h.
Referenced by emitDeclTargetVarDeclLValue(), and emitGlobalFunctionDefinition().
| mlir::ArrayAttr CIRGenModule::getOrCreateAnnotationArgs | ( | const clang::AnnotateAttr * | attr | ) |
Build (or fetch from the dedup cache) the args ArrayAttr for an annotation.
Returns the empty ArrayAttr when the annotation has none.
Definition at line 4748 of file CIRGenModule.cpp.
References clang::cast(), and errorNYI().
Referenced by emitAnnotateAttr().
| cir::FuncOp clang::CIRGen::CIRGenModule::getOrCreateCIRFunction | ( | llvm::StringRef | mangledName, |
| mlir::Type | funcType, | ||
| clang::GlobalDecl | gd, | ||
| bool | forVTable, | ||
| bool | dontDefer = false, | ||
| bool | isThunk = false, | ||
| ForDefinition_t | isForDefinition = NotForDefinition, | ||
| mlir::NamedAttrList | extraAttrs = {} ) |
|
inline |
Definition at line 871 of file CIRGenModule.h.
References getOrCreateCIRFunction(), and clang::CIRGen::NotForDefinition.
| cir::GlobalOp CIRGenModule::getOrCreateCIRGlobal | ( | const VarDecl * | d, |
| mlir::Type | ty, | ||
| ForDefinition_t | isForDefinition ) |
Definition at line 1502 of file CIRGenModule.cpp.
References clang::CIRGen::CIRGenTypes::convertTypeForMem(), getGlobalVarAddressSpace(), getLoc(), getMangledName(), getOrCreateCIRGlobal(), clang::VarDecl::getSourceRange(), clang::ValueDecl::getType(), getTypes(), and clang::VarDecl::hasGlobalStorage().
| cir::GlobalOp clang::CIRGen::CIRGenModule::getOrCreateCIRGlobal | ( | llvm::StringRef | mangledName, |
| mlir::Type | ty, | ||
| LangAS | langAS, | ||
| mlir::Location | loc, | ||
| 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 emitGlobal(), emitGlobalVarDefinition(), getAddrOfGlobal(), getAddrOfGlobalVar(), getAddrOfGlobalVarAttr(), getOrCreateCIRGlobal(), getWeakRefReference(), and handleCXXStaticMemberVarInstantiation().
| cir::GlobalOp CIRGenModule::getOrCreateStaticVarDecl | ( | const VarDecl & | d, |
| cir::GlobalLinkageKind | linkage ) |
Definition at line 678 of file CIRGenDecl.cpp.
References clang::cast(), clang::CIRGen::CIRGenTypes::convertTypeForMem(), clang::Ctor_Base, clang::CIRGen::Decl, clang::Dtor_Base, emitNullConstantAttr(), errorNYI(), clang::QualType::getAddressSpace(), getAddrOfGlobal(), getASTContext(), clang::GlobalDecl::getDecl(), clang::Decl::getDeclContext(), getGlobalCIRAddressSpace(), getGlobalVarAddressSpace(), getLangOpts(), getLoc(), clang::Decl::getLocation(), getMangledName(), getMLIRVisibilityFromCIRLinkage(), getModule(), clang::Decl::getNonClosureContext(), clang::VarDecl::getSourceRange(), getStaticDeclName(), getStaticLocalDeclAddress(), clang::VarDecl::getTLSKind(), clang::ValueDecl::getType(), getTypes(), clang::Decl::hasAttr(), insertGlobalSymbol(), clang::isa(), clang::Type::isConstantSizeType(), clang::opencl_local, setGVProperties(), setStaticLocalDeclAddress(), setTLSMode(), and supportsCOMDAT().
| cir::FuncOp CIRGenModule::getRawFunctionPointer | ( | GlobalDecl | GD | ) |
Return a function pointer for a reference to the given function.
This correctly handles weak references, but does not apply a pointer signature.
Definition at line 978 of file CIRGenExpr.cpp.
References clang::cast(), getAddrOfFunction(), clang::GlobalDecl::getDecl(), and getWeakRefReference().
Referenced by getFunctionPointer().
|
inline |
Definition at line 916 of file CIRGenModule.h.
Referenced by createOrReplaceCXXRuntimeVariable(), emitAtomicUpdate(), emitGlobalVarDefinition(), generateStringLiteral(), and getGlobalForStringLiteral().
|
inline |
Definition at line 280 of file CIRGenModule.h.
References staticLocalDeclMap.
Referenced by getOrCreateStaticVarDecl().
|
inline |
Definition at line 204 of file CIRGenModule.h.
Referenced by CIRGenModule(), emitGlobal(), generateStringLiteral(), getAddrAndTypeOfCXXStructor(), getAddrOfFunction(), getBuiltinLibFunction(), getCIRGenToUse(), clang::CIRGen::getEHPersonality(), getFeatureDeltaFromDefault(), getMangledName(), getTargetCIRGenInfo(), getVTableLinkage(), mayVTableBeDuplicated(), setCIRFunctionAttributesForDefinition(), setWindowsItaniumDLLImport(), and shouldEmitVTableThunk().
| const TargetCIRGenInfo & CIRGenModule::getTargetCIRGenInfo | ( | ) |
Definition at line 370 of file CIRGenModule.cpp.
References clang::CIRGen::createAArch64TargetCIRGenInfo(), clang::CIRGen::createAMDGPUTargetCIRGenInfo(), clang::CIRGen::createCommonSPIRTargetCIRGenInfo(), clang::CIRGen::createNVPTXTargetCIRGenInfo(), clang::CIRGen::createSystemZTargetCIRGenInfo(), clang::CIRGen::createX8664TargetCIRGenInfo(), getTarget(), clang::TargetInfo::getTriple(), cir::MissingFeatures::targetCIRGenInfoArch(), and cir::MissingFeatures::targetCIRGenInfoOS().
Referenced by arrangeFreeFunctionLikeCall(), CIRGenModule(), emitAsmStores(), emitSYCLKernelCaller(), getGlobalCIRAddressSpace(), getGlobalVarAddressSpace(), getNullPointer(), setCUDAKernelCallingConvention(), setFunctionAttributes(), and shouldEmitBuiltinAsIR().
|
inline |
Definition at line 936 of file CIRGenModule.h.
Referenced by addGlobalDtor(), addUsedOrCompilerUsedGlobal(), CIRGenModule(), emitGlobal(), getTypeInfoLinkage(), release(), setAMDGPUAtomicMetadata(), setFunctionAttributes(), shouldAssumeDSOLocal(), shouldCIREmitFPMathIntrinsic(), shouldEmitRTTI(), and supportsCOMDAT().
|
inline |
Definition at line 207 of file CIRGenModule.h.
Referenced by castGlobalToDeclAddrSpace(), codegenCXXStructor(), emitAliasDefinition(), emitAliasForGlobal(), emitAtomicLibCall(), emitDeclDestroy(), emitFunctionDeclLValue(), emitGlobal(), emitGlobalFunctionDefinition(), emitMemberPointerConstant(), emitNewDeleteCall(), emitNullConstant(), emitNullConstantAttr(), emitNullConstantForBase(), emitSYCLKernelCaller(), emitUsed(), getAddrAndTypeOfCXXStructor(), getAddrOfConstantStringFromLiteral(), getAddrOfGlobal(), getAddrOfGlobalTemporary(), getAddrOfGlobalVar(), getAddrOfGlobalVarAttr(), getOrCreateCIRGlobal(), getOrCreateStaticVarDecl(), getWeakRefReference(), isEmptyFieldForMemberPointer(), and setFunctionAttributes().
| std::string CIRGenModule::getUniqueGlobalName | ( | const std::string & | baseName | ) |
Definition at line 2387 of file CIRGenModule.cpp.
References cgGlobalNames, and getGlobalValue().
Referenced by createGlobalString(), getGlobalForStringLiteral(), and tryEmitGlobalCompoundLiteral().
| 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 927 of file CIRGenClass.cpp.
References getASTContext(), clang::ASTContext::getASTRecordLayout(), getDynamicOffsetAlignment(), clang::ASTRecordLayout::getNonVirtualAlignment(), and clang::TagDecl::isCompleteDefinition().
| mlir::Type CIRGenModule::getVTableComponentType | ( | ) |
Definition at line 54 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 383 of file CIRGenVTables.cpp.
References cir::MissingFeatures::appleKext(), clang::cast(), getCXXABI(), getTarget(), clang::CXXRecordDecl::getTemplateSpecializationKind(), clang::FunctionDecl::getTemplateSpecializationKind(), clang::Decl::hasAttr(), clang::FunctionDecl::hasBody(), clang::NamedDecl::isExternallyVisible(), clang::FunctionDecl::isInlined(), shouldEmitAvailableExternallyVTable(), clang::TSK_ExplicitInstantiationDeclaration, clang::TSK_ExplicitInstantiationDefinition, clang::TSK_ExplicitSpecialization, clang::TSK_ImplicitInstantiation, and clang::TSK_Undeclared.
Referenced by getTypeInfoLinkage().
|
inline |
Definition at line 592 of file CIRGenModule.h.
Referenced by emitGlobalDefinition(), emitVTablesOpportunistically(), and shouldEmitVTableAtEndOfTranslationUnit().
| mlir::Operation * CIRGenModule::getWeakRefReference | ( | const clang::ValueDecl * | vd | ) |
Return the symbol that a weakref declaration refers to: the cir.func or cir.global named by its alias target, declared extern_weak if it did not already exist.
Definition at line 1457 of file CIRGenModule.cpp.
References convertType(), clang::Default, errorNYI(), clang::Decl::getAttr(), getGlobalValue(), getLoc(), getOrCreateCIRFunction(), getOrCreateCIRGlobal(), clang::Decl::getSourceRange(), clang::ValueDecl::getType(), getTypes(), and clang::CIRGen::NotForDefinition.
Referenced by getRawFunctionPointer().
| void CIRGenModule::handleCXXStaticMemberVarInstantiation | ( | VarDecl * | vd | ) |
Tell the consumer that this variable has been instantiated.
Definition at line 812 of file CIRGenModule.cpp.
References clang::VarDecl::Definition, emitTopLevelDecl(), getASTContext(), clang::VarDecl::getDefinition(), getOrCreateCIRGlobal(), clang::VarDecl::getTemplateSpecializationKind(), clang::Decl::hasAttr(), clang::VarDecl::isThisDeclarationADefinition(), clang::CIRGen::NotForDefinition, and clang::TSK_ExplicitInstantiationDefinition.
|
inline |
Definition at line 268 of file CIRGenModule.h.
References symbolLookupCache.
Referenced by createUnnamedGlobalFrom(), emitScalarPrivatizer(), getAddrOfTemplateParamObject(), getOrCreateCopyThunk(), and getOrCreateStaticVarDecl().
Returns true if field is a potentially-overlapping field with no CIR field index (e.g.
a [[no_unique_address]] member that is empty for both layout and the ABI). Such fields have no entry in the CIR record, so a pointer-to-data-member to them is represented by an explicit byte offset (#cir.data_member_offset) rather than a field-index path.
Definition at line 2659 of file CIRGenModule.cpp.
References clang::CIRGen::CIRGenTypes::getCIRGenRecordLayout(), clang::FieldDecl::getParent(), getTypes(), clang::CIRGen::CIRGenRecordLayout::hasCIRField(), clang::CodeGenUtils::isEmptyFieldForLayout(), clang::FieldDecl::isPotentiallyOverlapping(), and clang::TagDecl::isUnion().
Referenced by emitMemberPointerConstant().
| bool CIRGenModule::isPaddedAtomicType | ( | const AtomicType * | type | ) |
Definition at line 236 of file CIRGenTypes.cpp.
References clang::ast_matchers::type.
Definition at line 232 of file CIRGenTypes.cpp.
References isPaddedAtomicType(), and clang::ast_matchers::type.
Referenced by isPaddedAtomicType().
|
inline |
O(1) lookup of a FuncOp by name in the symbol cache.
Returns nullptr if the name is not found or is not a FuncOp.
Definition at line 263 of file CIRGenModule.h.
References getGlobalValue().
Referenced by getOrCreateCopyThunk().
| bool CIRGenModule::lookupRepresentativeDecl | ( | llvm::StringRef | mangledName, |
| clang::GlobalDecl & | gd ) const |
Definition at line 3385 of file CIRGenModule.cpp.
Referenced by shouldSkipAliasEmission().
| 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 3151 of file CIRGenModule.cpp.
References 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 1983 of file CIRGenModule.cpp.
References clang::cast(), clang::CIRGen::Decl, getASTContext(), and clang::CodeGenUtils::shouldBeInCOMDAT().
Referenced by emitGlobalFunctionDefinition(), and emitGlobalVarDefinition().
| bool CIRGenModule::mayVTableBeDuplicated | ( | cir::GlobalLinkageKind | linkage | ) | const |
Return true if a vtable with the given linkage may have more than one address in the program, in which case its address is insignificant and it can be marked unnamed_addr.
Definition at line 1119 of file CIRGenVTables.cpp.
References getTarget(), clang::TargetInfo::getVTableUniqueness(), cir::isWeakForLinker(), and clang::UniqueIfStrongLinkage.
| 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 3134 of file CIRGenModule.cpp.
References clang::ASTContext::DeclMustBeEmitted(), getASTContext(), clang::SD_Static, and clang::SD_Thread.
Referenced by emitGlobal(), and emitTentativeDefinition().
| void CIRGenModule::printPostfixForExternalizedDecl | ( | llvm::raw_ostream & | os, |
| const Decl * | d ) |
Print the postfix for externalized static variable or kernels for single source offloading languages CUDA and HIP.
The unique postfix is created using either the CUID argument, or the file's UniqueID and active macros. The fallback method without a CUID requires that the offloading toolchain does not define separate macros via the -cc1 options.
Definition at line 573 of file CIRGenModule.cpp.
References clang::LangOptions::CUID, clang::CIRGen::Decl, errorNYI(), getASTContext(), clang::ASTContext::getCUIDHash(), getLangOpts(), and clang::Decl::getSourceRange().
| void CIRGenModule::release | ( | ) |
Definition at line 4207 of file CIRGenModule.cpp.
References addCompilerUsedGlobal(), cir::MissingFeatures::cgmRelease(), cir::MissingFeatures::checkAliases(), createGlobalOp(), clang::Module::DefinitionLoc, emitAMDGPUMetadata(), emitDeferred(), emitLLVMUsed(), cir::MissingFeatures::emitModuleLinkOptions(), emitVTablesOpportunistically(), clang::CIRGen::CIRGenCUDARuntime::finalizeModule(), getASTContext(), getCUDARuntime(), clang::ASTContext::getCUIDHash(), getFramePointerKind(), getGlobalCIRAddressSpace(), getGlobalVarAddressSpace(), getLangOpts(), getLoc(), getMLIRContext(), getModule(), getTriple(), clang::HIP, clang::CodeGenUtils::importedModulesToInitialize(), clang::Module::isModuleImplementation(), and kind.
| void CIRGenModule::replaceGlobal | ( | cir::GlobalOp | oldGV, |
| cir::GlobalOp | newGV ) |
Replace all uses of the old global with the new global, updating types and references as needed.
Erases the old global when done.
Definition at line 1235 of file CIRGenModule.cpp.
References cir::MissingFeatures::addressSpace(), clang::cast(), clang::CUDA, eraseGlobalSymbol(), getCUDARuntime(), getLangOpts(), getModule(), getNewInitValue(), clang::CIRGen::CIRGenCUDARuntime::handleGlobalReplace(), and lastGlobalOp.
| 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 2216 of file CIRGenModule.cpp.
References getType(), cir::MissingFeatures::opFuncExceptions(), cir::MissingFeatures::opFuncOperandBundles(), and cir::MissingFeatures::opFuncParameterAttributes().
Referenced by emitAliasDefinition().
|
inline |
Definition at line 478 of file CIRGenModule.h.
References emittedCompoundLiterals.
Referenced by tryEmitGlobalCompoundLiteral().
|
inline |
Definition at line 214 of file CIRGenModule.h.
| void CIRGenModule::setCIRFunctionAttributes | ( | GlobalDecl | gd, |
| const CIRGenFunctionInfo & | info, | ||
| cir::FuncOp | func, | ||
| bool | isThunk ) |
Set the CIR function attributes (Sext, zext, etc).
Definition at line 3443 of file CIRGenModule.cpp.
References constructAttributeList(), and cir::MissingFeatures::opFuncExtraAttrs().
Referenced by emitSYCLKernelCaller(), and setFunctionAttributes().
| void CIRGenModule::setCIRFunctionAttributesForDefinition | ( | const clang::Decl * | decl, |
| cir::FuncOp | f ) |
Set extra attributes (inline, etc.) for a function.
Definition at line 3542 of file CIRGenModule.cpp.
References addSYCLModuleIdAttr(), clang::ast_matchers::decl, getASTContext(), getCharWidth(), getCXXABI(), getLangOpts(), getMLIRContext(), getTarget(), clang::CodeGenUtils::hasUnwindExceptions(), cir::MissingFeatures::hlsl(), clang::isa(), clang::CodeGenOptions::OnlyAlwaysInlining, clang::CodeGenOptions::OnlyHintInlining, cir::MissingFeatures::opFuncArmNewAttr(), cir::MissingFeatures::opFuncArmStreamingAttr(), clang::FunctionDecl::redecls(), and cir::MissingFeatures::stackProtector().
Referenced by codegenCXXStructor(), emitGlobalFunctionDefinition(), and emitSYCLKernelCaller().
| 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 869 of file CIRGenModule.cpp.
References addUsedOrCompilerUsedGlobal(), clang::CIRGen::Decl, cir::MissingFeatures::defaultVisibility(), clang::GlobalDecl::getDecl(), clang::Decl::hasAttr(), clang::SD_Static, clang::SD_Thread, and setGVProperties().
Referenced by emitAliasDefinition(), and emitAliasForGlobal().
| void CIRGenModule::setDSOLocal | ( | cir::CIRGlobalValueInterface | gv | ) | const |
Definition at line 3363 of file CIRGenModule.cpp.
References shouldAssumeDSOLocal().
| void CIRGenModule::setDSOLocal | ( | mlir::Operation * | op | ) | const |
Definition at line 3367 of file CIRGenModule.cpp.
References setDSOLocal().
Referenced by createOrReplaceCXXRuntimeVariable(), emitSYCLKernelCaller(), generateStringLiteral(), getGlobalForStringLiteral(), setDSOLocal(), setGVPropertiesAux(), and setThunkProperties().
| void CIRGenModule::setFuncInfoAttr | ( | cir::FuncOp | funcOp, |
| const clang::FunctionDecl * | funcDecl ) |
Record the func_info tag for a function, either a C++ special member form (constructor, destructor, assignment) or a known standard library entity that passes can recognize without the AST.
Definition at line 4067 of file CIRGenModule.cpp.
References convertType(), getAssignKindFromDecl(), getASTContext(), getCtorKindFromDecl(), clang::NamedDecl::getIdentifier(), getMLIRContext(), clang::NamedDecl::getName(), clang::Decl::isInStdNamespace(), and kind.
Referenced by createCIRFunction().
| void CIRGenModule::setFunctionAttributes | ( | GlobalDecl | gd, |
| cir::FuncOp | f, | ||
| bool | isIncompleteFunction, | ||
| bool | isThunk ) |
Set function attributes for a function declaration.
Definition at line 3476 of file CIRGenModule.cpp.
References cir::MissingFeatures::attributeNoBuiltin(), clang::cast(), getCXXABI(), clang::GlobalDecl::getDecl(), getMLIRContext(), getTargetCIRGenInfo(), getTriple(), getTypes(), clang::FunctionDecl::hasBody(), clang::isa(), setCIRFunctionAttributes(), setLinkageForFunction(), and clang::CIRGen::TargetCIRGenInfo::setTargetAttributes().
|
inline |
Definition at line 956 of file CIRGenModule.h.
References getFunctionLinkage(), getMLIRContext(), and getMLIRVisibilityFromCIRLinkage().
Referenced by codegenCXXStructor(), emitGlobalFunctionDefinition(), and setThunkProperties().
| void CIRGenModule::setGlobalTlsReferences | ( | const VarDecl & | vd, |
| cir::GlobalOp | globalOp ) |
Definition at line 57 of file CIRGenDeclCXX.cpp.
References clang::cast(), clang::CPlusPlus, errorNYI(), getCXXABI(), getKind(), getLangOpts(), clang::CIRGen::CIRGenCXXABI::getMangleContext(), getMLIRContext(), clang::VarDecl::getSourceRange(), clang::VarDecl::getTemplateSpecializationKind(), clang::VarDecl::getTLSKind(), clang::VarDecl::isStaticLocal(), clang::isTemplateInstantiation(), clang::MangleContext::mangleStaticGuardVariable(), clang::MangleContext::MK_Itanium, and clang::VarDecl::TLS_Dynamic.
Referenced by setTLSMode().
| void CIRGenModule::setGlobalVisibility | ( | cir::CIRGlobalValueInterface | gv, |
| const NamedDecl * | d ) const |
Set the visibility for the given global.
Definition at line 3302 of file CIRGenModule.cpp.
References getASTContext(), clang::Decl::getAttr(), getCIRVisibilityKind(), getLangOpts(), clang::NamedDecl::getLinkageAndVisibility(), clang::LinkageInfo::getVisibility(), clang::Decl::hasAttr(), clang::HiddenVisibility, clang::HLSL, clang::isa(), clang::Decl::isInExportDeclContext(), clang::LinkageInfo::isVisibilityExplicit(), and cir::MissingFeatures::opGlobalDLLImportExport().
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 3372 of file CIRGenModule.cpp.
References cir::MissingFeatures::opGlobalDLLImportExport(), and setGVPropertiesAux().
Referenced by emitGlobalFunctionDefinition(), getAddrOfGlobalTemporary(), getOrCreateStaticVarDecl(), setCommonAttributes(), and setThunkProperties().
| void CIRGenModule::setGVPropertiesAux | ( | mlir::Operation * | op, |
| const NamedDecl * | d ) const |
Definition at line 3378 of file CIRGenModule.cpp.
References clang::cast(), cir::MissingFeatures::opGlobalPartition(), setDSOLocal(), and setGlobalVisibility().
Referenced by setGVProperties().
|
static |
Definition at line 2874 of file CIRGenModule.cpp.
References cir::MissingFeatures::opGlobalVisibility().
Referenced by emitGlobalVarDefinition(), generateStringLiteral(), getAddrOfTemplateParamObject(), getAddrOfUnnamedGlobalConstantDecl(), and tryEmitGlobalCompoundLiteral().
|
inline |
Definition at line 284 of file CIRGenModule.h.
References staticLocalDeclMap.
Referenced by getOrCreateStaticVarDecl().
| void CIRGenModule::setTLSMode | ( | mlir::Operation * | op, |
| const VarDecl & | d, | ||
| bool | isExtendingDecl = false ) |
Set TLS mode for the given operation based on the given variable declaration.
If isExtendingDecl is true, then the operation is a temporary whose lifetime is extended by the variable declared by d.
Definition at line 3416 of file CIRGenModule.cpp.
References clang::cast(), clang::Decl::getAttr(), getCIRTLSModel(), getDefaultCIRTLSModel(), clang::VarDecl::getTLSKind(), clang::VarDecl::isStaticLocal(), and setGlobalTlsReferences().
Referenced by emitGlobalVarDefinition(), getAddrOfGlobalTemporary(), and getOrCreateStaticVarDecl().
| bool CIRGenModule::shouldEmitFunction | ( | clang::GlobalDecl | gd | ) |
Check if fd ends up calling itself directly through asm label or builtin-pointer-to-self trickery (e.g., glibc's extern inline libc wrappers that call __builtin_strrchr, which the codegen lowers to a call on the same asm-named symbol).
Emitting an available_externally body for such a function feeds the LLVM Decide whether to emit the body of gd to CIR. Returns false for available_externally functions that are trivially recursive (PR9614). Mirrors classic CodeGen's CodeGenModule::shouldEmitFunction.
Definition at line 1849 of file CIRGenModule.cpp.
References clang::cast(), getASTContext(), getCXXABI(), clang::GlobalDecl::getDecl(), getFunctionLinkage(), clang::CIRGen::CIRGenCXXABI::getMangleContext(), clang::Module::getTopLevelModule(), clang::Module::isNamedModule(), and clang::MangleContext::isTriviallyRecursive().
Referenced by emitGlobalDefinition().
Definition at line 666 of file CIRGenModule.h.
References getLangOpts(), getTriple(), and clang::LangOptions::isTargetDevice().
Referenced by getAddrOfRTTIDescriptor().
| bool CIRGenModule::shouldOpportunisticallyEmitVTables | ( | ) |
Definition at line 1115 of file CIRGenVTables.cpp.
Referenced by emitDeferredVTables(), and emitVTablesOpportunistically().
|
inline |
Definition at line 322 of file CIRGenModule.h.
References getLangOpts().
| bool CIRGenModule::supportsCOMDAT | ( | ) | const |
Definition at line 1979 of file CIRGenModule.cpp.
References getTriple().
Referenced by createOrReplaceCXXRuntimeVariable(), generateStringLiteral(), getAddrOfGlobalTemporary(), getAddrOfTemplateParamObject(), getOrCreateStaticVarDecl(), and setThunkProperties().
| void CIRGenModule::updateCompletedType | ( | const clang::TagDecl * | td | ) |
Definition at line 1994 of file CIRGenModule.cpp.
| bool CIRGenModule::verifyModule | ( | ) | const |
Definition at line 4439 of file CIRGenModule.cpp.
References getModule().
| llvm::StringMap<unsigned> clang::CIRGen::CIRGenModule::cgGlobalNames |
Definition at line 372 of file CIRGenModule.h.
Referenced by getUniqueGlobalName().
| llvm::DenseMap<mlir::Attribute, cir::GlobalOp> clang::CIRGen::CIRGenModule::constantStringMap |
Definition at line 468 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 605 of file CIRGenModule.h.
Referenced by emitGlobal(), and emitTentativeDefinition().
| std::vector<clang::GlobalDecl> clang::CIRGen::CIRGenModule::deferredDeclsToEmit |
Definition at line 609 of file CIRGenModule.h.
Referenced by addDeferredDeclToEmit(), and emitDeferred().
| llvm::DenseMap<const CompoundLiteralExpr *, cir::GlobalOp> clang::CIRGen::CIRGenModule::emittedCompoundLiterals |
Definition at line 472 of file CIRGenModule.h.
Referenced by getAddrOfConstantCompoundLiteralIfEmitted(), and setAddrOfConstantCompoundLiteral().
| llvm::DenseMap<const VarDecl *, cir::GlobalOp> clang::CIRGen::CIRGenModule::initializerConstants |
Definition at line 253 of file CIRGenModule.h.
Referenced by createUnnamedGlobalFrom().
| 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 235 of file CIRGenModule.h.
| mlir::Operation* clang::CIRGen::CIRGenModule::lastGlobalOp = nullptr |
Definition at line 229 of file CIRGenModule.h.
Referenced by createGlobalOp(), emitGlobalVarDefinition(), and replaceGlobal().
| std::vector<cir::CIRGlobalValueInterface> clang::CIRGen::CIRGenModule::llvmCompilerUsed |
Definition at line 589 of file CIRGenModule.h.
Referenced by addCompilerUsedGlobal(), addUsedOrCompilerUsedGlobal(), and emitLLVMUsed().
| std::vector<cir::CIRGlobalValueInterface> clang::CIRGen::CIRGenModule::llvmUsed |
List of global values which are required to be present in the object file; This is used for forcing visibility of symbols which may otherwise be optimized out.
Definition at line 588 of file CIRGenModule.h.
Referenced by addUsedGlobal(), addUsedOrCompilerUsedGlobal(), and emitLLVMUsed().
| unsigned clang::CIRGen::CIRGenModule::routineCounter = 0 |
Definition at line 772 of file CIRGenModule.h.
Referenced by emitOpenACCRoutineDecl().
| llvm::DenseMap<const Decl *, cir::GlobalOp> clang::CIRGen::CIRGenModule::staticLocalDeclMap |
Definition at line 252 of file CIRGenModule.h.
Referenced by getStaticLocalDeclAddress(), and setStaticLocalDeclAddress().
| llvm::StringMap<mlir::Operation *> clang::CIRGen::CIRGenModule::symbolLookupCache |
Cache for O(1) symbol lookups by name, replacing the O(N) linear scan in SymbolTable::lookupSymbolIn that getGlobalValue used previously.
Definition at line 257 of file CIRGenModule.h.
Referenced by createCIRFunction(), createGlobalOp(), eraseGlobalSymbol(), getGlobalValue(), and insertGlobalSymbol().
| llvm::DenseMap<const UnnamedGlobalConstantDecl *, cir::GlobalOp> clang::CIRGen::CIRGenModule::unnamedGlobalConstantDeclMap |
Definition at line 470 of file CIRGenModule.h.
Referenced by getAddrOfUnnamedGlobalConstantDecl().