[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226589 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chandler Carruth 2015-01-20 18:54:16 +00:00
parent 61b4b8088d
commit 30dd113d6f

View File

@ -514,14 +514,12 @@ public:
Arg.TopLevelLoops.clear(); Arg.TopLevelLoops.clear();
} }
LoopInfoBase &operator=(LoopInfoBase &&RHS) { LoopInfoBase &operator=(LoopInfoBase &&RHS) {
if (&RHS != this) {
BBMap = std::move(RHS.BBMap); BBMap = std::move(RHS.BBMap);
for (auto *L : TopLevelLoops) for (auto *L : TopLevelLoops)
delete L; delete L;
TopLevelLoops = std::move(RHS.TopLevelLoops); TopLevelLoops = std::move(RHS.TopLevelLoops);
RHS.TopLevelLoops.clear(); RHS.TopLevelLoops.clear();
}
return *this; return *this;
} }