Author: Chuanqi Xu Date: 2023-02-20T15:37:55+08:00 New Revision: 2dfa957f120244ddc0238b548282f67d89f1a832
URL: https://github.com/llvm/llvm-project/commit/2dfa957f120244ddc0238b548282f67d89f1a832 DIFF: https://github.com/llvm/llvm-project/commit/2dfa957f120244ddc0238b548282f67d89f1a832.diff LOG: [NFC] Remove the unused parameter in Sema::PushGlobalModuleFragment The `IsImplicit` parameter should be removed since it is not used now. Added: Modified: clang/include/clang/Sema/Sema.h clang/lib/Sema/SemaDeclCXX.cpp clang/lib/Sema/SemaExprCXX.cpp clang/lib/Sema/SemaModule.cpp Removed: ################################################################################ diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h index a6b1102488ae..176d92ae6fb1 100644 --- a/clang/include/clang/Sema/Sema.h +++ b/clang/include/clang/Sema/Sema.h @@ -2294,7 +2294,7 @@ class Sema final { } /// Enter the scope of the global module. - Module *PushGlobalModuleFragment(SourceLocation BeginLoc, bool IsImplicit); + Module *PushGlobalModuleFragment(SourceLocation BeginLoc); /// Leave the scope of the global module. void PopGlobalModuleFragment(); diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 7bae979fe061..6ec0eacf7a37 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -16363,7 +16363,7 @@ Decl *Sema::ActOnStartLinkageSpecification(Scope *S, SourceLocation ExternLoc, /// need to attach it again. if (getLangOpts().CPlusPlusModules && isCurrentModulePurview()) { Module *GlobalModule = - PushGlobalModuleFragment(ExternLoc, /*IsImplicit=*/true); + PushGlobalModuleFragment(ExternLoc); /// According to [module.reach]p3.2, /// The declaration in global module fragment is reachable if it is not /// discarded. And the discarded declaration should be deleted. So it diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index eb9a3e65763f..81d2c31c564a 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -2979,7 +2979,7 @@ void Sema::DeclareGlobalNewDelete() { // functions are replaceable ([new.delete]); these are attached to the // global module ([module.unit]). if (getLangOpts().CPlusPlusModules && getCurrentModule()) - PushGlobalModuleFragment(SourceLocation(), /*IsImplicit=*/true); + PushGlobalModuleFragment(SourceLocation()); // C++ [basic.std.dynamic]p2: // [...] The following allocation and deallocation functions (18.4) are diff --git a/clang/lib/Sema/SemaModule.cpp b/clang/lib/Sema/SemaModule.cpp index f03d98210b5b..59891ec2a817 100644 --- a/clang/lib/Sema/SemaModule.cpp +++ b/clang/lib/Sema/SemaModule.cpp @@ -74,10 +74,9 @@ static std::string stringFromPath(ModuleIdPath Path) { Sema::DeclGroupPtrTy Sema::ActOnGlobalModuleFragmentDecl(SourceLocation ModuleLoc) { - // We start in the global module; all those declarations are implicitly - // module-private (though they do not have module linkage). + // We start in the global module; Module *GlobalModule = - PushGlobalModuleFragment(ModuleLoc, /*IsImplicit=*/false); + PushGlobalModuleFragment(ModuleLoc); // All declarations created from now on are owned by the global module. auto *TU = Context.getTranslationUnitDecl(); @@ -956,8 +955,7 @@ Decl *Sema::ActOnFinishExportDecl(Scope *S, Decl *D, SourceLocation RBraceLoc) { return D; } -Module *Sema::PushGlobalModuleFragment(SourceLocation BeginLoc, - bool IsImplicit) { +Module *Sema::PushGlobalModuleFragment(SourceLocation BeginLoc) { // We shouldn't create new global module fragment if there is already // one. if (!GlobalModuleFragment) { _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits