aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaModule.cpp
diff options
context:
space:
mode:
authorChuanqi Xu <yedeng.yd@linux.alibaba.com>2023-05-10 11:54:04 +0800
committerChuanqi Xu <yedeng.yd@linux.alibaba.com>2023-05-23 10:52:22 +0800
commit52bc4b16cb68d6d64c0d9499b2e6c1d719e78085 (patch)
tree69dce43acf8cef1d724a9d99de2f9f898ae63140 /clang/lib/Sema/SemaModule.cpp
parentacd84fb6389ce8b1efa13c9bfdcb42fde9c9bdba (diff)
downloadllvm-52bc4b16cb68d6d64c0d9499b2e6c1d719e78085.zip
llvm-52bc4b16cb68d6d64c0d9499b2e6c1d719e78085.tar.gz
llvm-52bc4b16cb68d6d64c0d9499b2e6c1d719e78085.tar.bz2
[NFC] [C++20] [Modules] Refactor Sema::isModuleUnitOfCurrentTU into
Decl::isInAnotherModuleUnit Refactor `Sema::isModuleUnitOfCurrentTU` to `Decl::isInAnotherModuleUnit` to make code simpler a little bit. Note that although this patch introduces a FIXME, this is an existing issue and this patch just tries to describe it explicitly.
Diffstat (limited to 'clang/lib/Sema/SemaModule.cpp')
-rw-r--r--clang/lib/Sema/SemaModule.cpp13
1 files changed, 0 insertions, 13 deletions
diff --git a/clang/lib/Sema/SemaModule.cpp b/clang/lib/Sema/SemaModule.cpp
index a1ab013..67c6556 100644
--- a/clang/lib/Sema/SemaModule.cpp
+++ b/clang/lib/Sema/SemaModule.cpp
@@ -1024,16 +1024,3 @@ void Sema::PopImplicitGlobalModuleFragment() {
"left the wrong module scope, which is not global module fragment");
ModuleScopes.pop_back();
}
-
-bool Sema::isModuleUnitOfCurrentTU(const Module *M) const {
- assert(M);
-
- Module *CurrentModuleUnit = getCurrentModule();
-
- // If we are not in a module currently, M must not be the module unit of
- // current TU.
- if (!CurrentModuleUnit)
- return false;
-
- return M->isSubModuleOf(CurrentModuleUnit->getTopLevelModule());
-}