From 4f12e86ebb6f27a6ffd10449a6c82f42a4774892 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 14 Aug 2020 14:38:26 -0400 Subject: [PATCH] basic_block: Mark move constructor and assignment as noexcept Allows the type to play nicely with standard library facilities better (also we shouldn't be throwing in move operations to begin with). --- src/frontend/ir/basic_block.cpp | 4 ++-- src/frontend/ir/basic_block.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/frontend/ir/basic_block.cpp b/src/frontend/ir/basic_block.cpp index b7615f52..433eb08f 100644 --- a/src/frontend/ir/basic_block.cpp +++ b/src/frontend/ir/basic_block.cpp @@ -27,9 +27,9 @@ Block::Block(const LocationDescriptor& location) Block::~Block() = default; -Block::Block(Block&&) = default; +Block::Block(Block&&) noexcept = default; -Block& Block::operator=(Block&&) = default; +Block& Block::operator=(Block&&) noexcept = default; void Block::AppendNewInst(Opcode opcode, std::initializer_list args) { PrependNewInst(end(), opcode, args); diff --git a/src/frontend/ir/basic_block.h b/src/frontend/ir/basic_block.h index ade9b15b..2ff554a8 100644 --- a/src/frontend/ir/basic_block.h +++ b/src/frontend/ir/basic_block.h @@ -47,8 +47,8 @@ public: Block(const Block&) = delete; Block& operator=(const Block&) = delete; - Block(Block&&); - Block& operator=(Block&&); + Block(Block&&) noexcept; + Block& operator=(Block&&) noexcept; bool empty() const { return instructions.empty(); } size_type size() const { return instructions.size(); }