clang API Documentation
Describes a module import declaration, which makes the contents of the named module visible in the current translation unit. More...
#include <Decl.h>
Public Member Functions | |
Module * | getImportedModule () const |
Retrieve the module that was imported by the import declaration. | |
ArrayRef< SourceLocation > | getIdentifierLocs () const |
Retrieves the locations of each of the identifiers that make up the complete module name in the import declaration. | |
SourceRange | getSourceRange () const override LLVM_READONLY |
Source range that this declaration covers. | |
Static Public Member Functions | |
static ImportDecl * | Create (ASTContext &C, DeclContext *DC, SourceLocation StartLoc, Module *Imported, ArrayRef< SourceLocation > IdentifierLocs) |
Create a new module import declaration. | |
static ImportDecl * | CreateImplicit (ASTContext &C, DeclContext *DC, SourceLocation StartLoc, Module *Imported, SourceLocation EndLoc) |
Create a new module import declaration for an implicitly-generated import. | |
static ImportDecl * | CreateDeserialized (ASTContext &C, unsigned ID, unsigned NumLocations) |
Create a new, deserialized module import declaration. | |
static bool | classof (const Decl *D) |
static bool | classofKind (Kind K) |
Friends | |
class | ASTReader |
class | ASTDeclReader |
class | ASTContext |
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:
@import std.vector;
Import declarations can also be implicitly generated from #include/#import directives.
static bool clang::ImportDecl::classof | ( | const Decl * | D | ) | [inline, static] |
static bool clang::ImportDecl::classofKind | ( | Kind | K | ) | [inline, static] |
Reimplemented from clang::Decl.
ImportDecl * ImportDecl::Create | ( | ASTContext & | C, |
DeclContext * | DC, | ||
SourceLocation | StartLoc, | ||
Module * | Imported, | ||
ArrayRef< SourceLocation > | IdentifierLocs | ||
) | [static] |
Create a new module import declaration.
Definition at line 3961 of file Decl.cpp.
References AttributeLangSupport::C.
Referenced by clang::Sema::ActOnModuleImport().
ImportDecl * ImportDecl::CreateDeserialized | ( | ASTContext & | C, |
unsigned | ID, | ||
unsigned | NumLocations | ||
) | [static] |
Create a new, deserialized module import declaration.
Definition at line 3979 of file Decl.cpp.
References AttributeLangSupport::C.
ImportDecl * ImportDecl::CreateImplicit | ( | ASTContext & | C, |
DeclContext * | DC, | ||
SourceLocation | StartLoc, | ||
Module * | Imported, | ||
SourceLocation | EndLoc | ||
) | [static] |
Create a new module import declaration for an implicitly-generated import.
Definition at line 3968 of file Decl.cpp.
References AttributeLangSupport::C, and clang::Decl::setImplicit().
Referenced by clang::Sema::createImplicitModuleImportForErrorRecovery(), and clang::CompilerInstance::loadModule().
ArrayRef< SourceLocation > ImportDecl::getIdentifierLocs | ( | ) | const |
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.
Definition at line 3985 of file Decl.cpp.
References getImportedModule(), and getNumModuleIdentifiers().
Referenced by getSourceRange(), and clang::ASTDeclWriter::VisitImportDecl().
Module* clang::ImportDecl::getImportedModule | ( | ) | const [inline] |
Retrieve the module that was imported by the import declaration.
Definition at line 3638 of file Decl.h.
Referenced by getIdentifierLocs(), and clang::ASTDeclWriter::VisitImportDecl().
SourceRange ImportDecl::getSourceRange | ( | ) | const [override, virtual] |
Source range that this declaration covers.
Reimplemented from clang::Decl.
Definition at line 3995 of file Decl.cpp.
References getIdentifierLocs(), and clang::Decl::getLocation().
friend class ASTContext [friend] |
friend class ASTDeclReader [friend] |
Reimplemented from clang::Decl.
friend class ASTReader [friend] |
Reimplemented from clang::Decl.