From 63eff4e7ccb4a3b049d88fe297ecfa4739a99ce1 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 23 May 2019 21:59:10 -0400 Subject: [PATCH] ir/terminal: std::move constructor parameters where applicable Allows the compiler to choose the most suitable code in this scenario, given a Terminal isn't a trivial type. --- src/frontend/ir/terminal.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/frontend/ir/terminal.h b/src/frontend/ir/terminal.h index a6a24292..b3794292 100644 --- a/src/frontend/ir/terminal.h +++ b/src/frontend/ir/terminal.h @@ -94,7 +94,7 @@ using Terminal = boost::variant< * on the run-time state of the ARM flags. */ struct If { - If(Cond if_, Terminal then_, Terminal else_) : if_(if_), then_(then_), else_(else_) {} + If(Cond if_, Terminal then_, Terminal else_) : if_(if_), then_(std::move(then_)), else_(std::move(else_)) {} Cond if_; Terminal then_; Terminal else_; @@ -106,7 +106,7 @@ struct If { * then_ is executed if the check bit is non-zero, otherwise else_ is executed. */ struct CheckBit { - CheckBit(Terminal then_, Terminal else_) : then_(then_), else_(else_) {} + CheckBit(Terminal then_, Terminal else_) : then_(std::move(then_)), else_(std::move(else_)) {} Terminal then_; Terminal else_; }; @@ -116,7 +116,7 @@ struct CheckBit { * executed. */ struct CheckHalt { - explicit CheckHalt(Terminal else_) : else_(else_) {} + explicit CheckHalt(Terminal else_) : else_(std::move(else_)) {} Terminal else_; };