Skip to content

Commit c277b3f

Browse files
committed
[PM] Don't spend time making self moves no-ops. They're allowed to leave
the object in a moved-from state, and its simpler to write the code that way. llvm-svn: 226589
1 parent f88b2c8 commit c277b3f

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

llvm/include/llvm/Analysis/LoopInfo.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -514,14 +514,12 @@ class LoopInfoBase {
514514
Arg.TopLevelLoops.clear();
515515
}
516516
LoopInfoBase &operator=(LoopInfoBase &&RHS) {
517-
if (&RHS != this) {
518-
BBMap = std::move(RHS.BBMap);
517+
BBMap = std::move(RHS.BBMap);
519518

520-
for (auto *L : TopLevelLoops)
521-
delete L;
522-
TopLevelLoops = std::move(RHS.TopLevelLoops);
523-
RHS.TopLevelLoops.clear();
524-
}
519+
for (auto *L : TopLevelLoops)
520+
delete L;
521+
TopLevelLoops = std::move(RHS.TopLevelLoops);
522+
RHS.TopLevelLoops.clear();
525523
return *this;
526524
}
527525

0 commit comments

Comments
 (0)