[llvm-branch-commits] [llvm] af3707c - [MC] Avoid C++17 structured bindings

Fangrui Song via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Aug 17 10:40:58 PDT 2022


Author: Fangrui Song
Date: 2022-08-17T10:38:38-07:00
New Revision: af3707c3b89f80ab7b43feb1345af24080105254

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

LOG: [MC] Avoid C++17 structured bindings

release/15.x uses C++14 and structured bindings trigger warnings in Clang/GCC
and errors in MSVC.

Added: 
    

Modified: 
    llvm/lib/MC/MCContext.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp
index 29597088a212e..062246f9c7ee5 100644
--- a/llvm/lib/MC/MCContext.cpp
+++ b/llvm/lib/MC/MCContext.cpp
@@ -856,8 +856,8 @@ void MCContext::addDebugPrefixMapEntry(const std::string &From,
 }
 
 void MCContext::remapDebugPath(SmallVectorImpl<char> &Path) {
-  for (const auto &[From, To] : DebugPrefixMap)
-    if (llvm::sys::path::replace_path_prefix(Path, From, To))
+  for (const auto &V : DebugPrefixMap)
+    if (llvm::sys::path::replace_path_prefix(Path, V.first, V.second))
       break;
 }
 


        


More information about the llvm-branch-commits mailing list