Skip to content

Commit 5ef2751

Browse files
authored
Merge pull request #32307 from gottesmm/pr-199321807d64e7a17366ae4af217d8279439f36e
2 parents 426d930 + 08b7e7e commit 5ef2751

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/SILOptimizer/Transforms/GenericSpecializer.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,13 @@ bool GenericSpecializer::specializeAppliesInFunction(SILFunction &F) {
6464
// Collect the applies for this block in reverse order so that we
6565
// can pop them off the end of our vector and process them in
6666
// forward order.
67-
for (auto It = BB.rbegin(), End = BB.rend(); It != End; ++It) {
68-
auto *I = &*It;
67+
for (auto &I : llvm::reverse(BB)) {
6968

7069
// Skip non-apply instructions, apply instructions with no
7170
// substitutions, apply instructions where we do not statically
7271
// know the called function, and apply instructions where we do
7372
// not have the body of the called function.
74-
ApplySite Apply = ApplySite::isa(I);
73+
ApplySite Apply = ApplySite::isa(&I);
7574
if (!Apply || !Apply.hasSubstitutions())
7675
continue;
7776

@@ -81,7 +80,7 @@ bool GenericSpecializer::specializeAppliesInFunction(SILFunction &F) {
8180
if (!Callee->isDefinition()) {
8281
ORE.emit([&]() {
8382
using namespace OptRemark;
84-
return RemarkMissed("NoDef", *I)
83+
return RemarkMissed("NoDef", I)
8584
<< "Unable to specialize generic function "
8685
<< NV("Callee", Callee) << " since definition is not visible";
8786
});

0 commit comments

Comments
 (0)