Skip to content

Commit 61f18eb

Browse files
committed
Fix format and address suggestion.
1 parent 1174996 commit 61f18eb

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

bolt/lib/Rewrite/RewriteInstance.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3922,9 +3922,7 @@ void RewriteInstance::mapCodeSections(BOLTLinker::SectionMapper MapSection) {
39223922
// the allocation of the first section, or 0 if [0, Address) range is not
39233923
// big enough to fit all sections.
39243924
auto allocateBefore = [&](uint64_t Address) -> uint64_t {
3925-
for (auto SI = CodeSections.rbegin(), SE = CodeSections.rend(); SI != SE;
3926-
++SI) {
3927-
BinarySection *Section = *SI;
3925+
for (BinarySection *Section : llvm::reverse(CodeSections)) {
39283926
if (Section->getOutputSize() > Address)
39293927
return 0;
39303928
Address -= Section->getOutputSize();

bolt/test/code-at-high-address.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@
1919
// CHECK-SAME: AX
2020
// CHECK-NEXT: .text PROGBITS
2121

22-
int foo() {
23-
return 0;
24-
}
22+
int foo() { return 0; }
2523

26-
int main() {
27-
return foo();
28-
}
24+
int main() { return foo(); }

0 commit comments

Comments
 (0)