12#include "llvm/ADT/SetVector.h"
21 if (LangOpts.SYCLIsDevice)
23 if (LangOpts.HIP && LangOpts.CUDAIsDevice &&
Target.getTriple().isSPIRV())
31 if (
auto AS =
Target.getConstantAddressSpace())
38 if (!LangOpts.Exceptions)
42 if (LangOpts.CXXExceptions)
46 if (LangOpts.ObjCExceptions) {
57 if ((NoCommon || D->
hasAttr<NoCommonAttr>()) && !D->
hasAttr<CommonAttr>())
74 if (D->
hasAttr<PragmaClangBSSSectionAttr>() ||
75 D->
hasAttr<PragmaClangDataSectionAttr>() ||
76 D->
hasAttr<PragmaClangRelroSectionAttr>() ||
77 D->
hasAttr<PragmaClangRodataSectionAttr>())
85 if (D->
hasAttr<WeakImportAttr>())
102 for (
const FieldDecl *FD : RD->fields()) {
103 if (FD->isBitField())
105 if (FD->hasAttr<AlignedAttr>())
131 if (D.
hasAttr<SelectAnyAttr>())
135 if (
auto *VD = dyn_cast<VarDecl>(&D))
149 llvm_unreachable(
"No such linkage");
158 for (
auto I : Primary->
Exports)
159 Candidates.insert(I.first);
161 Candidates.insert_range(Primary->
Imports);
166 (SubM->isGlobalModule() || SubM->isPrivateModule()) &&
167 "The sub modules of C++20 module unit should only be global module "
168 "fragments or private module fragments.");
169 assert(SubM->Exports.empty() &&
170 "The global module fragments and the private module fragments are "
171 "not allowed to export import modules.");
172 Candidates.insert_range(SubM->Imports);
175 Candidates.insert_range(Imported);
179 for (
Module *M : Candidates) {
181 if (M->isHeaderLikeModule())
184 if (!M->isNamedModuleInterfaceHasInit())
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
GVALinkage GetGVALinkageForFunction(const FunctionDecl *FD) const
bool isAlignmentRequired(const Type *T) const
Determine if the alignment the type has was required using an alignment attribute.
int64_t toBits(CharUnits CharSize) const
Convert a size in characters to a size in bits.
GVALinkage GetGVALinkageForVariable(const VarDecl *VD) const
unsigned getTypeAlignIfKnown(QualType T, bool NeedsPreferredAlignment=false) const
Return the alignment of a type, in bits, or 0 if the type is incomplete and we cannot determine the a...
const TargetInfo & getTargetInfo() const
static CharUnits fromQuantity(QuantityType Quantity)
Construct a CharUnits quantity from a raw integer type.
Decl - This represents one declaration (or definition), e.g.
Represents a member of a struct/union/class.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
clang::ObjCRuntime ObjCRuntime
Describes a module or submodule.
SmallVector< ExportDecl, 2 > Exports
The set of export declarations.
bool isInterfaceOrPartition() const
llvm::iterator_range< submodule_iterator > submodules()
llvm::SmallVector< ModuleRef, 2 > Imports
The set of modules imported by this module, and on which this module depends.
bool hasUnwindExceptions() const
Does this runtime use zero-cost exceptions?
A (possibly-)qualified type.
bool isMicrosoft() const
Is this ABI an MSVC-compatible ABI?
Exposes information about the current target.
const llvm::Triple & getTriple() const
Returns the target triple of the primary target.
TargetCXXABI getCXXABI() const
Get the C++ ABI currently in use.
RecordDecl * getAsRecordDecl() const
Retrieves the RecordDecl this type refers to.
Represents a variable declaration or definition.
TLSKind getTLSKind() const
const Expr * getInit() const
bool hasExternalStorage() const
Returns true if a variable has extern or private_extern storage.
Defines the clang::TargetInfo interface.
LangAS getGlobalConstantAddressSpace(const LangOptions &LangOpts, const TargetInfo &Target)
Determines whether the language options require us to model unwind exceptions.
bool isVarDeclStrongDefinition(const ASTContext &Ctx, const VarDecl *D, bool NoCommon)
Check whether D is a strong definition, and thus must not be given common linkage.
llvm::SmallVector< Module *, 8 > importedModulesToInitialize(Module *Primary, llvm::ArrayRef< Module * > Imported)
The C++20 named modules whose Itanium initializer function the global init function of a translation ...
bool hasUnwindExceptions(const LangOptions &LangOpts)
bool shouldBeInCOMDAT(const ASTContext &Ctx, const Decl &D)
Check whether D should be emitted into a COMDAT group.
GVALinkage
A more specific kind of linkage than enum Linkage.
@ GVA_AvailableExternally
Linkage
Describes the different kinds of linkage (C++ [basic.link], C99 6.2.2) that an entity may have.
@ Result
The result type of a method or function.
LangAS
Defines the address space values used by the address space qualifier of QualType.
U cast(CodeGen::Address addr)