[clang] 4168efe - [NFC] Fix C++20 module test in PPC and warning

Chuanqi Xu via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 7 22:26:46 PST 2021


Author: Chuanqi Xu
Date: 2021-12-08T14:25:51+08:00
New Revision: 4168efe1b2243ed31c30c82583a18bff78cfa076

URL: https://github.com/llvm/llvm-project/commit/4168efe1b2243ed31c30c82583a18bff78cfa076
DIFF: https://github.com/llvm/llvm-project/commit/4168efe1b2243ed31c30c82583a18bff78cfa076.diff

LOG: [NFC] Fix C++20 module test in PPC and warning

Added: 
    

Modified: 
    clang/lib/Sema/SemaModule.cpp
    clang/test/CodeGenCXX/module-extern-C.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Sema/SemaModule.cpp b/clang/lib/Sema/SemaModule.cpp
index 34a6c6eae33f4..f497199badc10 100644
--- a/clang/lib/Sema/SemaModule.cpp
+++ b/clang/lib/Sema/SemaModule.cpp
@@ -712,7 +712,8 @@ Module *Sema::PushGlobalModuleFragment(SourceLocation BeginLoc,
   // Enter the scope of the global module.
   ModuleScopes.push_back({BeginLoc, GlobalModule,
                           /*ModuleInterface=*/false,
-                          /*ImplicitGlobalModuleFragment=*/IsImplicit});
+                          /*ImplicitGlobalModuleFragment=*/IsImplicit,
+                          /*VisibleModuleSet*/{}});
   VisibleModules.setVisible(GlobalModule, BeginLoc);
 
   return GlobalModule;

diff  --git a/clang/test/CodeGenCXX/module-extern-C.cpp b/clang/test/CodeGenCXX/module-extern-C.cpp
index 0b4bbc2b8fc59..d8012ada591bb 100644
--- a/clang/test/CodeGenCXX/module-extern-C.cpp
+++ b/clang/test/CodeGenCXX/module-extern-C.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++20 -emit-llvm -triple %itanium_abi_triple -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -std=c++20 -emit-llvm -triple %itanium_abi_triple -o - %s | FileCheck %s
 
 module;
 
@@ -6,21 +6,21 @@ module;
 
 export module x;
 
-// CHECK: define dso_local void @foo()
+// CHECK: void @foo()
 extern "C" void foo() {
   return;
 }
 
 extern "C" {
-// CHECK: define dso_local void @bar()
+// CHECK: void @bar()
 void bar() {
   return;
 }
-// CHECK: define dso_local i32 @baz()
+// CHECK: i32 @baz()
 int baz() {
   return 3;
 }
-// CHECK: define dso_local double @double_func()
+// CHECK: double @double_func()
 double double_func() {
   return 5.0;
 }


        


More information about the cfe-commits mailing list