Skip to content

Commit cea260e

Browse files
committed
Object: Move instead of copy EFFile. NFC
1 parent 44be079 commit cea260e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

llvm/include/llvm/Object/ELF.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,8 @@ class ELFFile {
261261
ELFFile(const ELFFile &) = default;
262262
ELFFile &operator=(const ELFFile &) = default;
263263

264+
ELFFile(ELFFile &&) = default;
265+
264266
// This is a callback that can be passed to a number of functions.
265267
// It can be used to ignore non-critical errors (warnings), which is
266268
// useful for dumpers, like llvm-readobj.

llvm/include/llvm/Object/ELFObjectFile.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,12 +1218,12 @@ ELFObjectFile<ELFT>::ELFObjectFile(MemoryBufferRef Object, ELFFile<ELFT> EF,
12181218
: ELFObjectFileBase(getELFType(ELFT::Endianness == llvm::endianness::little,
12191219
ELFT::Is64Bits),
12201220
Object),
1221-
EF(EF), DotDynSymSec(DotDynSymSec), DotSymtabSec(DotSymtabSec),
1221+
EF(std::move(EF)), DotDynSymSec(DotDynSymSec), DotSymtabSec(DotSymtabSec),
12221222
DotSymtabShndxSec(DotSymtabShndx) {}
12231223

12241224
template <class ELFT>
12251225
ELFObjectFile<ELFT>::ELFObjectFile(ELFObjectFile<ELFT> &&Other)
1226-
: ELFObjectFile(Other.Data, Other.EF, Other.DotDynSymSec,
1226+
: ELFObjectFile(Other.Data, std::move(Other.EF), Other.DotDynSymSec,
12271227
Other.DotSymtabSec, Other.DotSymtabShndxSec) {}
12281228

12291229
template <class ELFT>

0 commit comments

Comments
 (0)