Author: George Rokos
Date: 2020-07-16T11:04:12-07:00
New Revision: fc47c0e0a6a2681154efa9d31b8605fc91a62daa

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

LOG: [clang] Fix compilation warnings in OpenMP declare mapper codegen.

This patch fixes the compilation warnings that L is not a reference.
Thanks to Lingda Li for providing the patch.

Differential Revision: https://reviews.llvm.org/D83959

Added: 
    

Modified: 
    clang/lib/CodeGen/CGOpenMPRuntime.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/CodeGen/CGOpenMPRuntime.cpp 
b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
index 4fecd89d2bc5..89f403f2c82f 100644
--- a/clang/lib/CodeGen/CGOpenMPRuntime.cpp
+++ b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
@@ -8008,12 +8008,12 @@ class MappableExprsHandler {
                 C->isImplicit(), std::get<2>(L));
       }
     for (const auto *C : CurExecDir->getClausesOfKind<OMPToClause>())
-      for (const auto &L : C->component_lists()) {
+      for (const auto L : C->component_lists()) {
         InfoGen(std::get<0>(L), std::get<1>(L), OMPC_MAP_to, llvm::None,
                 /*ReturnDevicePointer=*/false, C->isImplicit(), 
std::get<2>(L));
       }
     for (const auto *C : CurExecDir->getClausesOfKind<OMPFromClause>())
-      for (const auto &L : C->component_lists()) {
+      for (const auto L : C->component_lists()) {
         InfoGen(std::get<0>(L), std::get<1>(L), OMPC_MAP_from, llvm::None,
                 /*ReturnDevicePointer=*/false, C->isImplicit(), 
std::get<2>(L));
       }
@@ -8029,7 +8029,7 @@ class MappableExprsHandler {
 
     for (const auto *C :
          CurExecDir->getClausesOfKind<OMPUseDevicePtrClause>()) {
-      for (const auto &L : C->component_lists()) {
+      for (const auto L : C->component_lists()) {
         OMPClauseMappableExprCommon::MappableExprComponentListRef Components =
             std::get<1>(L);
         assert(!Components.empty() &&


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

Reply via email to