Author: Kazu Hirata
Date: 2023-10-10T18:57:16-07:00
New Revision: d12ece2ecbb6065797c826c2e70d8f8a642b8eb0

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

LOG: [CodeGen] Use a range-based for loop (NFC)

Added: 
    

Modified: 
    clang/lib/CodeGen/CGDeclCXX.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/CodeGen/CGDeclCXX.cpp b/clang/lib/CodeGen/CGDeclCXX.cpp
index 30683ad474cd2c0..e10617162733bba 100644
--- a/clang/lib/CodeGen/CGDeclCXX.cpp
+++ b/clang/lib/CodeGen/CGDeclCXX.cpp
@@ -675,7 +675,7 @@ void CodeGenModule::EmitCXXModuleInitFunc(Module *Primary) {
     AllImports.insert(M);
   // Ones that we import in the global module fragment or the private module
   // fragment.
-  llvm::for_each(Primary->submodules(), [&AllImports](Module *SubM) {
+  for (Module *SubM : Primary->submodules()) {
     assert((SubM->isGlobalModule() || SubM->isPrivateModule()) &&
            "The sub modules of C++20 module unit should only be global module "
            "fragments or private module framents.");
@@ -684,7 +684,7 @@ void CodeGenModule::EmitCXXModuleInitFunc(Module *Primary) {
            "not allowed to export import modules.");
     for (Module *M : SubM->Imports)
       AllImports.insert(M);
-  });
+  }
 
   SmallVector<llvm::Function *, 8> ModuleInits;
   for (Module *M : AllImports) {


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to