aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/Sema.cpp
diff options
context:
space:
mode:
authorChuanqi Xu <yedeng.yd@linux.alibaba.com>2022-07-27 14:14:45 +0800
committerChuanqi Xu <yedeng.yd@linux.alibaba.com>2022-07-27 14:15:32 +0800
commite8e46cdce3ed3fbd1a0a632a7f69abb97be33cf4 (patch)
tree4fd86e3fb23b5ccf1977711274084b705649b77f /clang/lib/Sema/Sema.cpp
parent55889852127245b830bc3231f172eed53dcb355e (diff)
downloadllvm-e8e46cdce3ed3fbd1a0a632a7f69abb97be33cf4.zip
llvm-e8e46cdce3ed3fbd1a0a632a7f69abb97be33cf4.tar.gz
llvm-e8e46cdce3ed3fbd1a0a632a7f69abb97be33cf4.tar.bz2
[NFC] [C++20] [Modules] Use Sema::isCurrentModulePurview() to simplify the codes
Diffstat (limited to 'clang/lib/Sema/Sema.cpp')
-rw-r--r--clang/lib/Sema/Sema.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp
index 08957ce..1d27f74 100644
--- a/clang/lib/Sema/Sema.cpp
+++ b/clang/lib/Sema/Sema.cpp
@@ -1216,9 +1216,7 @@ void Sema::ActOnEndOfTranslationUnit() {
// module declaration by now.
if (getLangOpts().getCompilingModule() ==
LangOptions::CMK_ModuleInterface &&
- (ModuleScopes.empty() ||
- !ModuleScopes.back().Module->isModulePurview()) &&
- !DiagnosedMissingModuleDeclaration) {
+ !isCurrentModulePurview() && !DiagnosedMissingModuleDeclaration) {
// FIXME: Make a better guess as to where to put the module declaration.
Diag(getSourceManager().getLocForStartOfFile(
getSourceManager().getMainFileID()),