clang  3.9.0
Public Member Functions | Static Public Member Functions | Friends | List of all members
clang::ImportDecl Class Referencefinal

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:
[legend]
Collaboration diagram for clang::ImportDecl:
[legend]

Public Member Functions

ModulegetImportedModule () const
 Retrieve the module that was imported by the import declaration. More...
 
ArrayRef< SourceLocationgetIdentifierLocs () const
 Retrieves the locations of each of the identifiers that make up the complete module name in the import declaration. More...
 
SourceRange getSourceRange () const override LLVM_READONLY
 

Static Public Member Functions

static ImportDeclCreate (ASTContext &C, DeclContext *DC, SourceLocation StartLoc, Module *Imported, ArrayRef< SourceLocation > IdentifierLocs)
 Create a new module import declaration. More...
 
static ImportDeclCreateImplicit (ASTContext &C, DeclContext *DC, SourceLocation StartLoc, Module *Imported, SourceLocation EndLoc)
 Create a new module import declaration for an implicitly-generated import. More...
 
static ImportDeclCreateDeserialized (ASTContext &C, unsigned ID, unsigned NumLocations)
 Create a new, deserialized module import declaration. More...
 
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 3728 of file Decl.h.

Member Function Documentation

static bool clang::ImportDecl::classof ( const Decl D)
inlinestatic

Definition at line 3783 of file Decl.h.

References clang::ParmVarDecl::classofKind().

static bool clang::ImportDecl::classofKind ( Kind  K)
inlinestatic

Definition at line 3784 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 4245 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 4263 of file Decl.cpp.

References AttributeLangSupport::C, and ID.

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 4253 of file Decl.cpp.

References AttributeLangSupport::C.

Referenced by clang::Sema::ActOnModuleInclude(), and clang::Sema::createImplicitModuleImportForErrorRecovery().

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 4269 of file Decl.cpp.

References getImportedModule(), getNumModuleIdentifiers(), and clang::None.

Referenced by getSourceRange(), clang::index::IndexingContext::importedModule(), and clang::ASTDeclWriter::VisitImportDecl().

Module* clang::ImportDecl::getImportedModule ( ) const
inline

Retrieve the module that was imported by the import declaration.

Definition at line 3772 of file Decl.h.

Referenced by clang::CodeGen::CGDebugInfo::EmitImportDecl(), getIdentifierLocs(), and clang::ASTDeclWriter::VisitImportDecl().

SourceRange ImportDecl::getSourceRange ( ) const
override

Definition at line 4278 of file Decl.cpp.

References getIdentifierLocs().

Friends And Related Function Documentation

friend class ASTContext
friend

Definition at line 3744 of file Decl.h.

friend class ASTDeclReader
friend

Definition at line 3743 of file Decl.h.

friend class ASTReader
friend

Definition at line 3742 of file Decl.h.


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