[llvm] [BOLT][NFC] Fix build (PR #99361)

Vladislav Khmelevsky via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 17 11:16:20 PDT 2024


https://github.com/yota9 updated https://github.com/llvm/llvm-project/pull/99361

>From 03e03ff14355696b888cbf0d141b204ca71c17e2 Mon Sep 17 00:00:00 2001
From: Vladislav Khmelevsky <och95 at yandex.ru>
Date: Wed, 17 Jul 2024 21:33:39 +0400
Subject: [PATCH] [BOLT][NFC] Fix build

On clang 14 the build is failing with:
reference to local binding 'ParentName' declared in enclosing function
'llvm::bolt::RewriteInstance::registerFragments'
---
 bolt/lib/Rewrite/RewriteInstance.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp
index 32562ccb6b345..4ae802dc97ccd 100644
--- a/bolt/lib/Rewrite/RewriteInstance.cpp
+++ b/bolt/lib/Rewrite/RewriteInstance.cpp
@@ -1432,7 +1432,9 @@ void RewriteInstance::registerFragments() {
   // of the last local symbol.
   ELFSymbolRef LocalSymEnd = ELF64LEFile->toSymbolRef(SymTab, SymTab->sh_info);
 
-  for (auto &[ParentName, BF] : AmbiguousFragments) {
+  for (auto &Fragment : AmbiguousFragments) {
+    const StringRef &ParentName = Fragment.first;
+    BinaryFunction *BF = Fragment.second;
     const uint64_t Address = BF->getAddress();
 
     // Get fragment's own symbol



More information about the llvm-commits mailing list