class ImportDecl
Declaration
class ImportDecl : public Decl, private TrailingObjects { /* full declaration omitted */ };
Description
Describes a module import declaration, which makes the contents of the named module visible in the current translation unit. An import declaration imports the named module (or submodule). For example: A C++20 module import declaration imports the named module or partition. Periods are permitted in C++20 module names, but have no semantic meaning. For example: Import declarations can also be implicitly generated from # include/ # import directives.
Declared at: clang/include/clang/AST/Decl.h:4523
Inherits from: Decl, TrailingObjects
Member Variables
- private clang::Module* ImportedModule = nullptr
- The imported module.
- private llvm::PointerIntPair<ImportDecl*, 1, bool> NextLocalImportAndComplete
- When the bit is false, we only have a single source location for the end of the import declaration.
Inherited from Decl:
- protected NextInContextAndBits
- protected Access
- protected FromASTFile
- protected IdentifierNamespace
- protected CacheValidAndLinkage
Method Overview
- public static clang::ImportDecl * Create(clang::ASTContext & C, clang::DeclContext * DC, clang::SourceLocation StartLoc, clang::Module * Imported, ArrayRef<clang::SourceLocation> IdentifierLocs)
- public static clang::ImportDecl * CreateDeserialized(clang::ASTContext & C, unsigned int ID, unsigned int NumLocations)
- public static clang::ImportDecl * CreateImplicit(clang::ASTContext & C, clang::DeclContext * DC, clang::SourceLocation StartLoc, clang::Module * Imported, clang::SourceLocation EndLoc)
- private ImportDecl(clang::DeclContext * DC, clang::SourceLocation StartLoc, clang::Module * Imported, ArrayRef<clang::SourceLocation> IdentifierLocs)
- private ImportDecl(clang::DeclContext * DC, clang::SourceLocation StartLoc, clang::Module * Imported, clang::SourceLocation EndLoc)
- private ImportDecl(clang::Decl::EmptyShell Empty)
- public static bool classof(const clang::Decl * D)
- public static bool classofKind(clang::Decl::Kind K)
- public ArrayRef<clang::SourceLocation> getIdentifierLocs() const
- public clang::Module * getImportedModule() const
- private clang::ImportDecl * getNextLocalImport() const
- public clang::SourceRange getSourceRange() const
- private bool isImportComplete() const
- private void setImportComplete(bool C)
- private void setNextLocalImport(clang::ImportDecl * Import)
Inherited from Decl:
- public EnableStatistics
- public PrintStats
- public add
- public addAttr
- public attr_begin
- public attr_end
- public attrs
- public canBeWeakImported
- public castFromDeclContext
- public castToDeclContext
- public classofKind
- public dropAttr
- public dropAttrs
- public dump
- public dump
- public dumpColor
- public getASTContext
- protected getASTMutationListener
- public getAccess
- public getAccessUnsafe
- public getAsFunction
- public getAsFunction
- public getAttr
- public getAttrs
- public getAttrs
- public getAvailability
- public getBeginLoc
- public getBody
- public getBodyRBrace
- protected getCachedLinkage
- public getCanonicalDecl
- public getCanonicalDecl
- public getDeclContext
- public getDeclContext
- public getDeclKindName
- public getDefiningAttr
- public getDescribedTemplate
- public getDescribedTemplateParams
- public getEndLoc
- public getExternalSourceSymbolAttr
- public getFriendObjectKind
- public getFunctionType
- public getGlobalID
- public getID
- public getIdentifierNamespace
- public getIdentifierNamespaceForKind
- public getImportedOwningModule
- public getKind
- public getLangOpts
- public getLexicalDeclContext
- public getLexicalDeclContext
- public getLocalOwningModule
- public getLocation
- public getMaxAlignment
- public getModuleOwnershipKind
- public getMostRecentDecl
- public getMostRecentDecl
- protected getMostRecentDeclImpl
- public getNextDeclInContext
- public getNextDeclInContext
- protected getNextRedeclarationImpl
- public getNonClosureContext
- public getNonClosureContext
- public getOwningModule
- public getOwningModuleForLinkage
- public getOwningModuleID
- public getParentFunctionOrMethod
- public getParentFunctionOrMethod
- public getPreviousDecl
- public getPreviousDecl
- protected getPreviousDeclImpl
- public getSourceRange
- public getTemplateDepth
- public getTranslationUnitDecl
- public getTranslationUnitDecl
- public getVersionIntroduced
- public hasAttr
- public hasAttrs
- public hasBody
- protected hasCachedLinkage
- public hasDefiningAttr
- protected hasLocalOwningModuleStorage
- public hasOwningModule
- public hasTagIdentifierNamespace
- public isCanonicalDecl
- public isDefinedOutsideFunctionOrMethod
- public isDeprecated
- public isDiscardedInGlobalModuleFragment
- public isFirstDecl
- public isFromASTFile
- public isFunctionOrFunctionTemplate
- public isImplicit
- public isInAnonymousNamespace
- public isInExportDeclContext
- public isInIdentifierNamespace
- public isInLocalScopeForInstantiation
- public isInStdNamespace
- public isInvalidDecl
- public isInvisibleOutsideTheOwningModule
- public isLocalExternDecl
- public isModulePrivate
- public isOutOfLine
- public isParameterPack
- public isReachable
- public isReferenced
- public isTagIdentifierNamespace
- public isTemplateDecl
- public isTemplateParameter
- public isTemplateParameterPack
- public isTemplated
- public isThisDeclarationReferenced
- public isTopLevelDeclInObjCContainer
- public isUnavailable
- public isUnconditionallyVisible
- public isUsed
- public isWeakImported
- public markUsed
- public print
- public print
- public printGroup
- public redecls
- public redecls_begin
- public redecls_end
- public setAccess
- public setAttrs
- protected setCachedLinkage
- public setDeclContext
- public setFromASTFile
- public setImplicit
- public setInvalidDecl
- public setIsUsed
- public setLexicalDeclContext
- public setLocalExternDecl
- public setLocalOwningModule
- public setLocation
- public setModuleOwnershipKind
- protected setModulePrivate
- public setNonMemberOperator
- public setObjectOfFriendDecl
- public setOwningModuleID
- public setReferenced
- public setTopLevelDeclInObjCContainer
- public setVisibleDespiteOwningModule
- public specific_attr_begin
- public specific_attr_end
- public specific_attrs
- protected updateOutOfDate
Methods
¶static clang::ImportDecl* Create(
clang::ASTContext& C,
clang::DeclContext* DC,
clang::SourceLocation StartLoc,
clang::Module* Imported,
ArrayRef<clang::SourceLocation>
IdentifierLocs)
static clang::ImportDecl* Create(
clang::ASTContext& C,
clang::DeclContext* DC,
clang::SourceLocation StartLoc,
clang::Module* Imported,
ArrayRef<clang::SourceLocation>
IdentifierLocs)
Description
Create a new module import declaration.
Declared at: clang/include/clang/AST/Decl.h:4567
Parameters
- clang::ASTContext& C
- clang::DeclContext* DC
- clang::SourceLocation StartLoc
- clang::Module* Imported
- ArrayRef<clang::SourceLocation> IdentifierLocs
¶static clang::ImportDecl* CreateDeserialized(
clang::ASTContext& C,
unsigned int ID,
unsigned int NumLocations)
static clang::ImportDecl* CreateDeserialized(
clang::ASTContext& C,
unsigned int ID,
unsigned int NumLocations)
Description
Create a new, deserialized module import declaration.
Declared at: clang/include/clang/AST/Decl.h:4578
Parameters
- clang::ASTContext& C
- unsigned int ID
- unsigned int NumLocations
¶static clang::ImportDecl* CreateImplicit(
clang::ASTContext& C,
clang::DeclContext* DC,
clang::SourceLocation StartLoc,
clang::Module* Imported,
clang::SourceLocation EndLoc)
static clang::ImportDecl* CreateImplicit(
clang::ASTContext& C,
clang::DeclContext* DC,
clang::SourceLocation StartLoc,
clang::Module* Imported,
clang::SourceLocation EndLoc)
Description
Create a new module import declaration for an implicitly-generated import.
Declared at: clang/include/clang/AST/Decl.h:4573
Parameters
- clang::ASTContext& C
- clang::DeclContext* DC
- clang::SourceLocation StartLoc
- clang::Module* Imported
- clang::SourceLocation EndLoc
¶ImportDecl(clang::DeclContext* DC,
clang::SourceLocation StartLoc,
clang::Module* Imported,
ArrayRef<clang::SourceLocation>
IdentifierLocs)
ImportDecl(clang::DeclContext* DC,
clang::SourceLocation StartLoc,
clang::Module* Imported,
ArrayRef<clang::SourceLocation>
IdentifierLocs)
Declared at: clang/include/clang/AST/Decl.h:4543
Parameters
- clang::DeclContext* DC
- clang::SourceLocation StartLoc
- clang::Module* Imported
- ArrayRef<clang::SourceLocation> IdentifierLocs
¶ImportDecl(clang::DeclContext* DC,
clang::SourceLocation StartLoc,
clang::Module* Imported,
clang::SourceLocation EndLoc)
ImportDecl(clang::DeclContext* DC,
clang::SourceLocation StartLoc,
clang::Module* Imported,
clang::SourceLocation EndLoc)
Declared at: clang/include/clang/AST/Decl.h:4546
Parameters
- clang::DeclContext* DC
- clang::SourceLocation StartLoc
- clang::Module* Imported
- clang::SourceLocation EndLoc
¶ImportDecl(clang::Decl::EmptyShell Empty)
ImportDecl(clang::Decl::EmptyShell Empty)
Declared at: clang/include/clang/AST/Decl.h:4549
Parameters
- clang::Decl::EmptyShell Empty
¶static bool classof(const clang::Decl* D)
static bool classof(const clang::Decl* D)
Declared at: clang/include/clang/AST/Decl.h:4593
Parameters
- const clang::Decl* D
¶static bool classofKind(clang::Decl::Kind K)
static bool classofKind(clang::Decl::Kind K)
Declared at: clang/include/clang/AST/Decl.h:4594
Parameters
- clang::Decl::Kind K
¶ArrayRef<clang::SourceLocation>
getIdentifierLocs() const
ArrayRef<clang::SourceLocation>
getIdentifierLocs() const
Description
Retrieves the locations of each of the identifiers that make up the complete module name in the import declaration. This will return an empty array if the locations of the individual identifiers aren't available.
Declared at: clang/include/clang/AST/Decl.h:4589
¶clang::Module* getImportedModule() const
clang::Module* getImportedModule() const
Description
Retrieve the module that was imported by the import declaration.
Declared at: clang/include/clang/AST/Decl.h:4582
¶clang::ImportDecl* getNextLocalImport() const
clang::ImportDecl* getNextLocalImport() const
Description
The next import in the list of imports local to the translation unit being parsed (not loaded from an AST file).
Declared at: clang/include/clang/AST/Decl.h:4557
¶clang::SourceRange getSourceRange() const
clang::SourceRange getSourceRange() const
Description
Source range that this declaration covers.
Declared at: clang/include/clang/AST/Decl.h:4591
¶bool isImportComplete() const
bool isImportComplete() const
Declared at: clang/include/clang/AST/Decl.h:4551
¶void setImportComplete(bool C)
void setImportComplete(bool C)
Declared at: clang/include/clang/AST/Decl.h:4553
Parameters
- bool C
¶void setNextLocalImport(clang::ImportDecl* Import)
void setNextLocalImport(clang::ImportDecl* Import)
Declared at: clang/include/clang/AST/Decl.h:4561
Parameters
- clang::ImportDecl* Import