[llvm] r284972 - [RDF] Add default move constructors/assignment operators
Krzysztof Parzyszek via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 24 10:22:49 PDT 2016
IIRC declaring constructors effectively disables any default ones,
unless they are explicitly listed as well. Is this causing a problem
somewhere?
This not strictly necessary for any functional purpose (other than
potential performance gains).
-Krzysztof
On 10/24/2016 10:46 AM, David Blaikie wrote:
> Do you need to write any of these out, or could you just let them be
> provided as implicit defaults?
>
> On Mon, Oct 24, 2016 at 6:24 AM Krzysztof Parzyszek via llvm-commits
> <llvm-commits at lists.llvm.org <mailto:llvm-commits at lists.llvm.org>> wrote:
>
> Author: kparzysz
> Date: Mon Oct 24 08:15:20 2016
> New Revision: 284972
>
> URL: http://llvm.org/viewvc/llvm-project?rev=284972&view=rev
> Log:
> [RDF] Add default move constructors/assignment operators
>
> Modified:
> llvm/trunk/lib/Target/Hexagon/RDFGraph.h
>
> Modified: llvm/trunk/lib/Target/Hexagon/RDFGraph.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/RDFGraph.h?rev=284972&r1=284971&r2=284972&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/Hexagon/RDFGraph.h (original)
> +++ llvm/trunk/lib/Target/Hexagon/RDFGraph.h Mon Oct 24 08:15:20 2016
> @@ -329,7 +329,9 @@ namespace rdf {
> NodeAddr() : Addr(nullptr), Id(0) {}
> NodeAddr(T A, NodeId I) : Addr(A), Id(I) {}
> NodeAddr(const NodeAddr&) = default;
> + NodeAddr(NodeAddr&&) = default;
> NodeAddr &operator= (const NodeAddr&) = default;
> + NodeAddr &operator= (NodeAddr&&) = default;
>
> bool operator== (const NodeAddr<T> &NA) const {
> assert((Addr == NA.Addr) == (Id == NA.Id));
> @@ -407,8 +409,10 @@ namespace rdf {
> RegisterRef() : RegisterRef(0) {}
> explicit RegisterRef(RegisterId R, LaneBitmask M = ~LaneBitmask(0))
> : Reg(R), Mask(R != 0 ? M : 0) {}
> - RegisterRef(const RegisterRef &RR) = default;
> - RegisterRef &operator= (const RegisterRef &RR) = default;
> + RegisterRef(const RegisterRef&) = default;
> + RegisterRef(RegisterRef&&) = default;
> + RegisterRef &operator= (const RegisterRef&) = default;
> + RegisterRef &operator= (RegisterRef&&) = default;
> operator bool() const { return Reg != 0 && Mask !=
> LaneBitmask(0); }
> bool operator== (const RegisterRef &RR) const {
> return Reg == RR.Reg && Mask == RR.Mask;
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org <mailto:llvm-commits at lists.llvm.org>
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
More information about the llvm-commits
mailing list