Skip to content

Commit

Permalink
[C++20] [Modules] Add Decl::isFromGlobalModule
Browse files Browse the repository at this point in the history
  • Loading branch information
ChuanqiXu9 committed Sep 24, 2024
1 parent 1c499a7 commit 4c51d82
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions clang/include/clang/AST/DeclBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,9 @@ class alignas(8) Decl {
/// Whether this declaration comes from explicit global module.
bool isFromExplicitGlobalModule() const;

/// Whether this declaration comes from global module.
bool isFromGlobalModule() const;

/// Whether this declaration comes from a named module.
bool isInNamedModule() const;

Expand Down
4 changes: 4 additions & 0 deletions clang/lib/AST/DeclBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,10 @@ bool Decl::isFromExplicitGlobalModule() const {
return getOwningModule() && getOwningModule()->isExplicitGlobalModule();
}

bool Decl::isFromGlobalModule() const {
return getOwningModule() && getOwningModule()->isGlobalModule();
}

bool Decl::isInNamedModule() const {
return getOwningModule() && getOwningModule()->isNamedModule();
}
Expand Down

0 comments on commit 4c51d82

Please sign in to comment.