[llvm-branch-commits] [clang] 4c51d82 - [C++20] [Modules] Add Decl::isFromGlobalModule

Chuanqi Xu via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Sep 24 06:25:19 PDT 2024


Author: Chuanqi Xu
Date: 2024-09-24T15:41:11+08:00
New Revision: 4c51d827e58aaa8c5b3d75b3b61a43627ab53491

URL: https://github.com/llvm/llvm-project/commit/4c51d827e58aaa8c5b3d75b3b61a43627ab53491
DIFF: https://github.com/llvm/llvm-project/commit/4c51d827e58aaa8c5b3d75b3b61a43627ab53491.diff

LOG: [C++20] [Modules] Add Decl::isFromGlobalModule

Added: 
    

Modified: 
    clang/include/clang/AST/DeclBase.h
    clang/lib/AST/DeclBase.cpp

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/AST/DeclBase.h b/clang/include/clang/AST/DeclBase.h
index 2a4bd0f9c2fda3..04dbd1db6cba81 100644
--- a/clang/include/clang/AST/DeclBase.h
+++ b/clang/include/clang/AST/DeclBase.h
@@ -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;
 

diff  --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp
index b59f118380ca4b..c4e948a38e2641 100644
--- a/clang/lib/AST/DeclBase.cpp
+++ b/clang/lib/AST/DeclBase.cpp
@@ -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();
 }


        


More information about the llvm-branch-commits mailing list