Skip to content

Commit a74a86c

Browse files
[TargetLibraryInfo] Use the default move constructor/assignment operator (#95685)
commit ecea837 Author: Kazu Hirata <[email protected]> Date: Sat Jun 15 14:02:42 2024 -0700 added std::move to the move constructor and assignment operator, but we can just use = default to have the compiler to generate them. As expected, the number of heap allocations is virtually unchanged.
1 parent 22530e7 commit a74a86c

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

llvm/include/llvm/Analysis/TargetLibraryInfo.h

+2-8
Original file line numberDiff line numberDiff line change
@@ -315,15 +315,9 @@ class TargetLibraryInfo {
315315

316316
// Provide value semantics.
317317
TargetLibraryInfo(const TargetLibraryInfo &TLI) = default;
318-
TargetLibraryInfo(TargetLibraryInfo &&TLI)
319-
: Impl(TLI.Impl),
320-
OverrideAsUnavailable(std::move(TLI.OverrideAsUnavailable)) {}
318+
TargetLibraryInfo(TargetLibraryInfo &&TLI) = default;
321319
TargetLibraryInfo &operator=(const TargetLibraryInfo &TLI) = default;
322-
TargetLibraryInfo &operator=(TargetLibraryInfo &&TLI) {
323-
Impl = TLI.Impl;
324-
OverrideAsUnavailable = std::move(TLI.OverrideAsUnavailable);
325-
return *this;
326-
}
320+
TargetLibraryInfo &operator=(TargetLibraryInfo &&TLI) = default;
327321

328322
/// Determine whether a callee with the given TLI can be inlined into
329323
/// caller with this TLI, based on 'nobuiltin' attributes. When requested,

0 commit comments

Comments
 (0)