clang 20.0.0git
|
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/ASTMutationListener.h"
#include "clang/Lex/HeaderSearch.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Sema/SemaInternal.h"
#include "llvm/ADT/StringExtras.h"
#include <optional>
Go to the source code of this file.
Functions | |
static void | checkModuleImportContext (Sema &S, Module *M, SourceLocation ImportLoc, DeclContext *DC, bool FromInclude=false) |
static std::string | stringFromPath (ModuleIdPath Path) |
static bool | isImportingModuleUnitFromSameModule (ASTContext &Ctx, Module *Imported, Module *CurrentModule, Module *&FoundPrimaryModuleInterface) |
Helper function for makeTransitiveImportsVisible to decide whether the. | |
static void | makeTransitiveImportsVisible (ASTContext &Ctx, VisibleModuleSet &VisibleModules, Module *Imported, Module *CurrentModule, SourceLocation ImportLoc, bool IsImportingPrimaryModuleInterface=false) |
[module.import]p7: Additionally, when a module-import-declaration in a module unit of some module M imports another module unit U of M, it also imports all translation units imported by non-exported module-import-declarations in the module unit purview of U. | |
static bool | DiagReservedModuleName (Sema &S, const IdentifierInfo *II, SourceLocation Loc) |
Tests whether the given identifier is reserved as a module name and diagnoses if it is. | |
static const ExportDecl * | getEnclosingExportDecl (const Decl *D) |
Determine whether D is lexically within an export-declaration. | |
static bool | checkExportedDecl (Sema &S, Decl *D, SourceLocation BlockStart) |
Check that it's valid to export D . | |
static bool | checkExportedDeclContext (Sema &S, DeclContext *DC, SourceLocation BlockStart) |
Check that it's valid to export all the declarations in DC . | |
|
static |
Check that it's valid to export D
.
Definition at line 929 of file SemaModule.cpp.
References bool, checkExportedDeclContext(), D, clang::SemaBase::Diag(), clang::Decl::getBeginLoc(), clang::NamedDecl::getFormalLinkage(), clang::Sema::getLangOpts(), clang::NamedDecl::getUnderlyingDecl(), clang::Internal, clang::SourceLocation::isValid(), clang::Module, clang::Decl::setInvalidDecl(), and clang::Target.
Referenced by clang::Sema::ActOnFinishExportDecl(), and checkExportedDeclContext().
|
static |
Check that it's valid to export all the declarations in DC
.
Definition at line 920 of file SemaModule.cpp.
References checkExportedDecl(), D, and clang::DeclContext::decls().
Referenced by checkExportedDecl().
|
static |
Definition at line 25 of file SemaModule.cpp.
References clang::SemaBase::Diag(), clang::Module::getFullModuleName(), clang::DeclContext::getParent(), clang::Module::IsExternC, clang::SourceLocation::isInvalid(), clang::Sema::isModuleVisible(), and clang::SourceLocation::isValid().
Referenced by clang::Sema::ActOnAnnotModuleBegin(), clang::Sema::ActOnAnnotModuleInclude(), and clang::Sema::ActOnModuleImport().
|
static |
Tests whether the given identifier is reserved as a module name and diagnoses if it is.
Returns true if a diagnostic is emitted and false otherwise.
Definition at line 226 of file SemaModule.cpp.
References clang::SemaBase::Diag(), clang::Sema::getLangOpts(), clang::Sema::getSourceManager(), clang::Invalid, clang::SourceManager::isInSystemHeader(), clang::IdentifierInfo::isReserved(), clang::IdentifierInfo::isStr(), Loc, and clang::NotReserved.
Referenced by clang::Sema::ActOnModuleDecl().
|
static |
Determine whether D
is lexically within an export-declaration.
Definition at line 633 of file SemaModule.cpp.
References D, clang::Decl::getLexicalDeclContext(), and clang::DeclContext::getLexicalParent().
Referenced by clang::Sema::ActOnModuleImport(), and clang::Sema::ActOnStartExportDecl().
|
static |
Helper function for makeTransitiveImportsVisible to decide whether the.
Imported | module unit is in the same module with the |
CurrentModule. | |
FoundPrimaryModuleInterface | is a helper parameter to record the primary module interface unit corresponding to the module |
CurrentModule. | Since currently it is expensive to decide whether two module units come from the same module by comparing the module name. |
Definition at line 85 of file SemaModule.cpp.
References clang::ASTContext::isInSameModule(), clang::Module::isModulePartition(), clang::Module::isModulePartitionImplementation(), and clang::Module::isNamedModule().
Referenced by makeTransitiveImportsVisible().
|
static |
[module.import]p7: Additionally, when a module-import-declaration in a module unit of some module M imports another module unit U of M, it also imports all translation units imported by non-exported module-import-declarations in the module unit purview of U.
These rules can in turn lead to the importation of yet more translation units.
Definition at line 130 of file SemaModule.cpp.
References clang::Module::Imports, isImportingModuleUnitFromSameModule(), clang::Module::isNamedModule(), clang::VisibleModuleSet::isVisible(), and clang::VisibleModuleSet::setVisible().
Referenced by clang::Sema::ActOnModuleDecl(), and clang::Sema::ActOnModuleImport().
|
static |
Definition at line 64 of file SemaModule.cpp.
References Path.
Referenced by clang::Sema::ActOnModuleDecl(), and clang::Sema::ActOnModuleImport().