clang API Documentation

Public Member Functions | Static Public Member Functions | Friends
clang::ImportDecl Class Reference

Describes a module import declaration, which makes the contents of the named module visible in the current translation unit. More...

#include <Decl.h>

Inheritance diagram for clang::ImportDecl:
Inheritance graph
[legend]
Collaboration diagram for clang::ImportDecl:
Collaboration graph
[legend]

List of all members.

Public Member Functions

ModulegetImportedModule () const
 Retrieve the module that was imported by the import declaration.
ArrayRef< SourceLocationgetIdentifierLocs () 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 ImportDeclCreate (ASTContext &C, DeclContext *DC, SourceLocation StartLoc, Module *Imported, ArrayRef< SourceLocation > IdentifierLocs)
 Create a new module import declaration.
static ImportDeclCreateImplicit (ASTContext &C, DeclContext *DC, SourceLocation StartLoc, Module *Imported, SourceLocation EndLoc)
 Create a new module import declaration for an implicitly-generated import.
static ImportDeclCreateDeserialized (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

Detailed 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:

   @import std.vector;

Import declarations can also be implicitly generated from #include/#import directives.

Definition at line 3596 of file Decl.h.


Member Function Documentation

static bool clang::ImportDecl::classof ( const Decl D) [inline, static]

Definition at line 3649 of file Decl.h.

static bool clang::ImportDecl::classofKind ( Kind  K) [inline, static]

Reimplemented from clang::Decl.

Definition at line 3650 of file Decl.h.

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().

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().

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().


Friends And Related Function Documentation

friend class ASTContext [friend]

Definition at line 3611 of file Decl.h.

friend class ASTDeclReader [friend]

Reimplemented from clang::Decl.

Definition at line 3610 of file Decl.h.

friend class ASTReader [friend]

Reimplemented from clang::Decl.

Definition at line 3609 of file Decl.h.


The documentation for this class was generated from the following files: