-
Notifications
You must be signed in to change notification settings - Fork 14.4k
[BOLT][NFC] Fix build #99361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BOLT][NFC] Fix build #99361
Conversation
@llvm/pr-subscribers-bolt Author: Vladislav Khmelevsky (yota9) ChangesOn clang 14 the build is failing with: Full diff: https://github.com/llvm/llvm-project/pull/99361.diff 1 Files Affected:
diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp
index 32562ccb6b345..903aadf843602 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
@@ -1500,7 +1502,7 @@ void RewriteInstance::registerFragments() {
}
BC->errs() << "BOLT-ERROR: parent function not found for " << *BF << '\n';
exit(1);
- }
+}
}
void RewriteInstance::createPLTBinaryFunction(uint64_t TargetAddress,
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix. I've upgraded the compiler on a buildbot just in case.
bolt/lib/Rewrite/RewriteInstance.cpp
Outdated
@@ -1500,7 +1502,7 @@ void RewriteInstance::registerFragments() { | |||
} | |||
BC->errs() << "BOLT-ERROR: parent function not found for " << *BF << '\n'; | |||
exit(1); | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Format
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is made by git clang-format ¯_(ツ)_/¯ And the formatting test here is passed too. What shell I do remove and push or go as-is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks to me like a bug and I agree that this space removing is not needed. Probably we can push now and close the eyes at this problem @aaupov ?
On clang 14 the build is failing with: reference to local binding 'ParentName' declared in enclosing function 'llvm::bolt::RewriteInstance::registerFragments'
You can test this locally with the following command:git-clang-format --diff b5b9832b42f436986c7290bc1e912e2f276b4e6b 03e03ff14355696b888cbf0d141b204ca71c17e2 --extensions cpp -- bolt/lib/Rewrite/RewriteInstance.cpp View the diff from clang-format here.diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp
index 4ae802dc97..903aadf843 100644
--- a/bolt/lib/Rewrite/RewriteInstance.cpp
+++ b/bolt/lib/Rewrite/RewriteInstance.cpp
@@ -1502,7 +1502,7 @@ registerParent:
}
BC->errs() << "BOLT-ERROR: parent function not found for " << *BF << '\n';
exit(1);
- }
+}
}
void RewriteInstance::createPLTBinaryFunction(uint64_t TargetAddress,
|
Yes, disregard formatter warning |
Summary: On clang 14 the build is failing with: reference to local binding 'ParentName' declared in enclosing function 'llvm::bolt::RewriteInstance::registerFragments' Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60250860
On clang 14 the build is failing with:
reference to local binding 'ParentName' declared in enclosing function
'llvm::bolt::RewriteInstance::registerFragments'