Remove unnecessary copying or replace it with moves in a bunch of places.
NFC.
llvm-svn: 219061
diff --git a/llvm/lib/DebugInfo/DWARFDebugAbbrev.cpp b/llvm/lib/DebugInfo/DWARFDebugAbbrev.cpp
index 8426bf9..c1a088e 100644
--- a/llvm/lib/DebugInfo/DWARFDebugAbbrev.cpp
+++ b/llvm/lib/DebugInfo/DWARFDebugAbbrev.cpp
@@ -30,7 +30,6 @@
DWARFAbbreviationDeclaration AbbrDecl;
uint32_t PrevAbbrCode = 0;
while (AbbrDecl.extract(Data, OffsetPtr)) {
- Decls.push_back(AbbrDecl);
if (FirstAbbrCode == 0) {
FirstAbbrCode = AbbrDecl.getCode();
} else {
@@ -40,6 +39,7 @@
}
}
PrevAbbrCode = AbbrDecl.getCode();
+ Decls.push_back(std::move(AbbrDecl));
}
return BeginOffset != *OffsetPtr;
}
@@ -82,7 +82,7 @@
uint32_t CUAbbrOffset = Offset;
if (!AbbrDecls.extract(Data, &Offset))
break;
- AbbrDeclSets[CUAbbrOffset] = AbbrDecls;
+ AbbrDeclSets[CUAbbrOffset] = std::move(AbbrDecls);
}
}