clang  16.0.0git
Functions
SemaModule.cpp File Reference
#include "clang/AST/ASTConsumer.h"
#include "clang/Lex/HeaderSearch.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Sema/SemaInternal.h"
Include dependency graph for SemaModule.cpp:

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 DiagReservedModuleName (Sema &S, const IdentifierInfo *II, SourceLocation Loc)
 Tests whether the given identifier is reserved as a module name and diagnoses if it is. More...
 
static const ExportDeclgetEnclosingExportDecl (const Decl *D)
 Determine whether D is lexically within an export-declaration. More...
 
static bool checkExportedDeclContext (Sema &S, DeclContext *DC, SourceLocation BlockStart)
 Check that it's valid to export all the declarations in DC. More...
 
static llvm::Optional< UnnamedDeclKind > getUnnamedDeclKind (Decl *D)
 
unsigned getUnnamedDeclDiag (UnnamedDeclKind UDK, bool InBlock)
 
static void diagExportedUnnamedDecl (Sema &S, UnnamedDeclKind UDK, Decl *D, SourceLocation BlockStart)
 
static bool checkExportedDecl (Sema &S, Decl *D, SourceLocation BlockStart)
 Check that it's valid to export D. More...
 

Function Documentation

◆ checkExportedDecl()

static bool checkExportedDecl ( Sema S,
Decl D,
SourceLocation  BlockStart 
)
static

Check that it's valid to export D.

Definition at line 878 of file SemaModule.cpp.

◆ checkExportedDeclContext()

static bool checkExportedDeclContext ( Sema S,
DeclContext DC,
SourceLocation  BlockStart 
)
static

Check that it's valid to export all the declarations in DC.

Definition at line 928 of file SemaModule.cpp.

◆ checkModuleImportContext()

static void checkModuleImportContext ( Sema S,
Module M,
SourceLocation  ImportLoc,
DeclContext DC,
bool  FromInclude = false 
)
static

◆ diagExportedUnnamedDecl()

static void diagExportedUnnamedDecl ( Sema S,
UnnamedDeclKind  UDK,
Decl D,
SourceLocation  BlockStart 
)
static

Definition at line 869 of file SemaModule.cpp.

◆ DiagReservedModuleName()

static bool DiagReservedModuleName ( Sema S,
const IdentifierInfo II,
SourceLocation  Loc 
)
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 150 of file SemaModule.cpp.

Referenced by clang::Sema::ActOnModuleDecl().

◆ getEnclosingExportDecl()

static const ExportDecl* getEnclosingExportDecl ( const Decl D)
static

Determine whether D is lexically within an export-declaration.

Definition at line 524 of file SemaModule.cpp.

References clang::Decl::getLexicalDeclContext(), and clang::DeclContext::getLexicalParent().

Referenced by clang::Sema::ActOnModuleImport().

◆ getUnnamedDeclDiag()

unsigned getUnnamedDeclDiag ( UnnamedDeclKind  UDK,
bool  InBlock 
)

Definition at line 842 of file SemaModule.cpp.

◆ getUnnamedDeclKind()

static llvm::Optional<UnnamedDeclKind> getUnnamedDeclKind ( Decl D)
static

Definition at line 829 of file SemaModule.cpp.

◆ stringFromPath()

static std::string stringFromPath ( ModuleIdPath  Path)
static

Definition at line 61 of file SemaModule.cpp.

References string().

Referenced by clang::Sema::ActOnModuleDecl(), and clang::Sema::ActOnModuleImport().