diff options
-rw-r--r-- | cmdline/cmdline_parse_result.h | 2 | ||||
-rw-r--r-- | cmdline/cmdline_parser.h | 8 | ||||
-rw-r--r-- | cmdline/cmdline_types.h | 4 | ||||
-rw-r--r-- | cmdline/detail/cmdline_parse_argument_detail.h | 2 | ||||
-rw-r--r-- | compiler/utils/label.h | 2 | ||||
-rw-r--r-- | dexlayout/dex_ir.h | 4 | ||||
-rw-r--r-- | libartbase/base/bit_vector.h | 2 | ||||
-rw-r--r-- | libartbase/base/dchecked_vector.h | 6 | ||||
-rw-r--r-- | libartbase/base/debug_stack.h | 2 | ||||
-rw-r--r-- | libartbase/base/hash_set.h | 8 | ||||
-rw-r--r-- | libartbase/base/intrusive_forward_list.h | 4 | ||||
-rw-r--r-- | libartbase/base/safe_map.h | 2 | ||||
-rw-r--r-- | libartbase/base/variant_map.h | 8 | ||||
-rw-r--r-- | runtime/base/timing_logger.h | 9 | ||||
-rw-r--r-- | runtime/gc/accounting/space_bitmap.h | 4 | ||||
-rw-r--r-- | runtime/gc/allocation_record.h | 2 | ||||
-rw-r--r-- | runtime/subtype_check.h | 2 | ||||
-rw-r--r-- | runtime/verifier/scoped_newline.h | 2 |
18 files changed, 34 insertions, 39 deletions
diff --git a/cmdline/cmdline_parse_result.h b/cmdline/cmdline_parse_result.h index 982f17866d..95dc14ae19 100644 --- a/cmdline/cmdline_parse_result.h +++ b/cmdline/cmdline_parse_result.h @@ -119,7 +119,7 @@ struct CmdlineParseResult : CmdlineResult { // Make sure copying is allowed CmdlineParseResult(const CmdlineParseResult&) = default; // Make sure moving is cheap - CmdlineParseResult(CmdlineParseResult&&) = default; + CmdlineParseResult(CmdlineParseResult&&) noexcept = default; private: explicit CmdlineParseResult(const T& value) diff --git a/cmdline/cmdline_parser.h b/cmdline/cmdline_parser.h index 7e343f8ef2..5cdf446474 100644 --- a/cmdline/cmdline_parser.h +++ b/cmdline/cmdline_parser.h @@ -229,7 +229,7 @@ struct CmdlineParser { } // Ensure we always move this when returning a new builder. - ArgumentBuilder(ArgumentBuilder&&) = default; + ArgumentBuilder(ArgumentBuilder&&) noexcept = default; protected: // Used by builder to internally ignore arguments by dropping them on the floor after parsing. @@ -372,7 +372,7 @@ struct CmdlineParser { } // Ensure we always move this when returning a new builder. - UntypedArgumentBuilder(UntypedArgumentBuilder&&) = default; + UntypedArgumentBuilder(UntypedArgumentBuilder&&) noexcept = default; protected: void SetNames(std::vector<const char*>&& names) { @@ -590,9 +590,9 @@ struct CmdlineParser { } // Ensure we have a default move constructor. - CmdlineParser(CmdlineParser&&) = default; + CmdlineParser(CmdlineParser&&) noexcept = default; // Ensure we have a default move assignment operator. - CmdlineParser& operator=(CmdlineParser&&) = default; + CmdlineParser& operator=(CmdlineParser&&) noexcept = default; private: friend struct Builder; diff --git a/cmdline/cmdline_types.h b/cmdline/cmdline_types.h index 964e2385b6..dc2f8b75bb 100644 --- a/cmdline/cmdline_types.h +++ b/cmdline/cmdline_types.h @@ -436,7 +436,7 @@ struct ParseList { ParseList() = default; ParseList(const ParseList&) = default; - ParseList(ParseList&&) = default; + ParseList(ParseList&&) noexcept = default; private: std::vector<ArgType> list_; @@ -457,7 +457,7 @@ struct ParseStringList : public ParseList<std::string, Separator> { ParseStringList() = default; ParseStringList(const ParseStringList&) = default; - ParseStringList(ParseStringList&&) = default; + ParseStringList(ParseStringList&&) noexcept = default; }; template <char Separator> diff --git a/cmdline/detail/cmdline_parse_argument_detail.h b/cmdline/detail/cmdline_parse_argument_detail.h index 0f73a76b72..95883cce38 100644 --- a/cmdline/detail/cmdline_parse_argument_detail.h +++ b/cmdline/detail/cmdline_parse_argument_detail.h @@ -339,7 +339,7 @@ struct CmdlineParserArgumentInfo { CmdlineParserArgumentInfo() = default; // Ensure there's a default move constructor. - CmdlineParserArgumentInfo(CmdlineParserArgumentInfo&&) = default; + CmdlineParserArgumentInfo(CmdlineParserArgumentInfo&&) noexcept = default; private: // Perform type-specific checks at runtime. diff --git a/compiler/utils/label.h b/compiler/utils/label.h index 9586a1996a..282500b1b7 100644 --- a/compiler/utils/label.h +++ b/compiler/utils/label.h @@ -59,7 +59,7 @@ class Label { public: Label() : position_(0) {} - Label(Label&& src) + Label(Label&& src) noexcept : position_(src.position_) { // We must unlink/unbind the src label when moving; if not, calling the destructor on // the src label would fail. diff --git a/dexlayout/dex_ir.h b/dexlayout/dex_ir.h index 20ebc1733c..66ca84bbd4 100644 --- a/dexlayout/dex_ir.h +++ b/dexlayout/dex_ir.h @@ -119,9 +119,9 @@ template<class T> class Iterator : public std::iterator<std::random_access_itera using reference = typename std::iterator<std::random_access_iterator_tag, value_type>::reference; Iterator(const Iterator&) = default; - Iterator(Iterator&&) = default; + Iterator(Iterator&&) noexcept = default; Iterator& operator=(const Iterator&) = default; - Iterator& operator=(Iterator&&) = default; + Iterator& operator=(Iterator&&) noexcept = default; Iterator(const std::vector<T>& vector, uint32_t position, diff --git a/libartbase/base/bit_vector.h b/libartbase/base/bit_vector.h index 0c735cc58a..071577bac1 100644 --- a/libartbase/base/bit_vector.h +++ b/libartbase/base/bit_vector.h @@ -109,7 +109,7 @@ class BitVector { BitVector(const BitVector& other) = delete; BitVector& operator=(const BitVector& other) = delete; - BitVector(BitVector&& other) + BitVector(BitVector&& other) noexcept : storage_(other.storage_), storage_size_(other.storage_size_), allocator_(other.allocator_), diff --git a/libartbase/base/dchecked_vector.h b/libartbase/base/dchecked_vector.h index e9ce6d0aaf..66e9638809 100644 --- a/libartbase/base/dchecked_vector.h +++ b/libartbase/base/dchecked_vector.h @@ -74,9 +74,9 @@ class dchecked_vector : private std::vector<T, Alloc> { : Base(src) { } dchecked_vector(const dchecked_vector& src, const allocator_type& alloc) : Base(src, alloc) { } - dchecked_vector(dchecked_vector&& src) + dchecked_vector(dchecked_vector&& src) noexcept : Base(std::move(src)) { } - dchecked_vector(dchecked_vector&& src, const allocator_type& alloc) + dchecked_vector(dchecked_vector&& src, const allocator_type& alloc) noexcept : Base(std::move(src), alloc) { } dchecked_vector(std::initializer_list<value_type> il, const allocator_type& alloc = allocator_type()) @@ -86,7 +86,7 @@ class dchecked_vector : private std::vector<T, Alloc> { Base::operator=(src); return *this; } - dchecked_vector& operator=(dchecked_vector&& src) { + dchecked_vector& operator=(dchecked_vector&& src) noexcept { Base::operator=(std::move(src)); return *this; } diff --git a/libartbase/base/debug_stack.h b/libartbase/base/debug_stack.h index 4743786418..4bbaee88f1 100644 --- a/libartbase/base/debug_stack.h +++ b/libartbase/base/debug_stack.h @@ -95,7 +95,7 @@ class DebugStackReferenceImpl { DebugStackReferenceImpl(const DebugStackReferenceImpl& other) : counter_(other.counter_), ref_count_(counter_->IncrementRefCount()) { } - DebugStackReferenceImpl(DebugStackReferenceImpl&& other) + DebugStackReferenceImpl(DebugStackReferenceImpl&& other) noexcept : counter_(other.counter_), ref_count_(other.ref_count_) { other.counter_ = nullptr; } diff --git a/libartbase/base/hash_set.h b/libartbase/base/hash_set.h index bd2ac38553..97e27f330b 100644 --- a/libartbase/base/hash_set.h +++ b/libartbase/base/hash_set.h @@ -44,7 +44,7 @@ class HashSetIterator { using reference = Elem&; HashSetIterator(const HashSetIterator&) = default; - HashSetIterator(HashSetIterator&&) = default; + HashSetIterator(HashSetIterator&&) noexcept = default; HashSetIterator(HashSetType* hash_set, size_t index) : index_(index), hash_set_(hash_set) {} // Conversion from iterator to const_iterator. @@ -57,7 +57,7 @@ class HashSetIterator { : index_(other.index_), hash_set_(other.hash_set_) {} HashSetIterator& operator=(const HashSetIterator&) = default; - HashSetIterator& operator=(HashSetIterator&&) = default; + HashSetIterator& operator=(HashSetIterator&&) noexcept = default; bool operator==(const HashSetIterator& other) const { return hash_set_ == other.hash_set_ && this->index_ == other.index_; @@ -234,7 +234,7 @@ class HashSet { DCHECK_LT(max_load_factor, 1.0); } - HashSet(const HashSet& other) noexcept + HashSet(const HashSet& other) : allocfn_(other.allocfn_), hashfn_(other.hashfn_), emptyfn_(other.emptyfn_), @@ -359,7 +359,7 @@ class HashSet { return *this; } - HashSet& operator=(const HashSet& other) noexcept { + HashSet& operator=(const HashSet& other) { HashSet(other).swap(*this); // NOLINT(runtime/explicit) - a case of lint gone mad. return *this; } diff --git a/libartbase/base/intrusive_forward_list.h b/libartbase/base/intrusive_forward_list.h index 47e4b4d213..29db64d60a 100644 --- a/libartbase/base/intrusive_forward_list.h +++ b/libartbase/base/intrusive_forward_list.h @@ -149,11 +149,11 @@ class IntrusiveForwardList { IntrusiveForwardList(InputIterator first, InputIterator last) : IntrusiveForwardList() { insert_after(before_begin(), first, last); } - IntrusiveForwardList(IntrusiveForwardList&& src) : first_(src.first_.next_hook) { + IntrusiveForwardList(IntrusiveForwardList&& src) noexcept : first_(src.first_.next_hook) { src.first_.next_hook = nullptr; } IntrusiveForwardList& operator=(const IntrusiveForwardList& src) = delete; - IntrusiveForwardList& operator=(IntrusiveForwardList&& src) { + IntrusiveForwardList& operator=(IntrusiveForwardList&& src) noexcept { IntrusiveForwardList tmp(std::move(src)); tmp.swap(*this); return *this; diff --git a/libartbase/base/safe_map.h b/libartbase/base/safe_map.h index 371b257e72..94198606f5 100644 --- a/libartbase/base/safe_map.h +++ b/libartbase/base/safe_map.h @@ -48,7 +48,7 @@ class SafeMap { SafeMap() = default; SafeMap(const SafeMap&) = default; - SafeMap(SafeMap&&) = default; + SafeMap(SafeMap&&) noexcept = default; explicit SafeMap(const key_compare& cmp, const allocator_type& allocator = allocator_type()) : map_(cmp, allocator) { } diff --git a/libartbase/base/variant_map.h b/libartbase/base/variant_map.h index 7349bbc046..4244c9f553 100644 --- a/libartbase/base/variant_map.h +++ b/libartbase/base/variant_map.h @@ -125,7 +125,7 @@ struct VariantMapKeyRaw { protected: // Avoid the object slicing problem; use Clone() instead. VariantMapKeyRaw(const VariantMapKeyRaw&) = default; - VariantMapKeyRaw(VariantMapKeyRaw&&) = default; + VariantMapKeyRaw(VariantMapKeyRaw&&) noexcept = default; private: size_t key_counter_; // Runtime type ID. Unique each time a new type is reified. @@ -179,7 +179,7 @@ struct VariantMapKey : detail::VariantMapKeyRaw { } VariantMapKey(const VariantMapKey&) = default; - VariantMapKey(VariantMapKey&&) = default; + VariantMapKey(VariantMapKey&&) noexcept = default; template <typename Base, template <typename TV> class TKey> friend struct VariantMap; @@ -372,12 +372,12 @@ struct VariantMap { } // Create a new map by moving an existing map into this one. The other map becomes empty. - VariantMap(VariantMap&& other) { + VariantMap(VariantMap&& other) noexcept { operator=(std::forward<VariantMap>(other)); } // Move the existing map's key/value pairs into this one. The other map becomes empty. - VariantMap& operator=(VariantMap&& other) { + VariantMap& operator=(VariantMap&& other) noexcept { if (this != &other) { Clear(); storage_map_.swap(other.storage_map_); diff --git a/runtime/base/timing_logger.h b/runtime/base/timing_logger.h index 4f72a80399..c1094bba83 100644 --- a/runtime/base/timing_logger.h +++ b/runtime/base/timing_logger.h @@ -132,13 +132,8 @@ class TimingLogger { class TimingData { public: TimingData() = default; - TimingData(TimingData&& other) { - std::swap(data_, other.data_); - } - TimingData& operator=(TimingData&& other) { - std::swap(data_, other.data_); - return *this; - } + TimingData(TimingData&& other) noexcept = default; + TimingData& operator=(TimingData&& other) noexcept = default; uint64_t GetTotalTime(size_t idx) { return data_[idx].total_time; } diff --git a/runtime/gc/accounting/space_bitmap.h b/runtime/gc/accounting/space_bitmap.h index b26d6dabd5..0d8ffa0d67 100644 --- a/runtime/gc/accounting/space_bitmap.h +++ b/runtime/gc/accounting/space_bitmap.h @@ -210,8 +210,8 @@ class SpaceBitmap { // however, we document that this is expected on heap_end_ SpaceBitmap() = default; - SpaceBitmap(SpaceBitmap&&) = default; - SpaceBitmap& operator=(SpaceBitmap&&) = default; + SpaceBitmap(SpaceBitmap&&) noexcept = default; + SpaceBitmap& operator=(SpaceBitmap&&) noexcept = default; bool IsValid() const { return bitmap_begin_ != nullptr; diff --git a/runtime/gc/allocation_record.h b/runtime/gc/allocation_record.h index 1d9a6ce721..8b4cc67b91 100644 --- a/runtime/gc/allocation_record.h +++ b/runtime/gc/allocation_record.h @@ -77,7 +77,7 @@ class AllocRecordStackTrace { AllocRecordStackTrace() = default; - AllocRecordStackTrace(AllocRecordStackTrace&& r) + AllocRecordStackTrace(AllocRecordStackTrace&& r) noexcept : tid_(r.tid_), stack_(std::move(r.stack_)) {} diff --git a/runtime/subtype_check.h b/runtime/subtype_check.h index 493ea853e5..ca1feb5f52 100644 --- a/runtime/subtype_check.h +++ b/runtime/subtype_check.h @@ -586,7 +586,7 @@ struct SubtypeCheck { // Tests can inherit this class. Normal code should use static methods. SubtypeCheck() = default; SubtypeCheck(const SubtypeCheck& other) = default; - SubtypeCheck(SubtypeCheck&& other) = default; + SubtypeCheck(SubtypeCheck&& other) noexcept = default; ~SubtypeCheck() = default; friend struct MockSubtypeCheck; diff --git a/runtime/verifier/scoped_newline.h b/runtime/verifier/scoped_newline.h index eb81bfacda..fb29e3ece8 100644 --- a/runtime/verifier/scoped_newline.h +++ b/runtime/verifier/scoped_newline.h @@ -28,7 +28,7 @@ namespace verifier { struct ScopedNewLine { explicit ScopedNewLine(std::ostream& os) : stream(os) {} - ScopedNewLine(ScopedNewLine&& other) : stream(other.stream), active(other.active) { + ScopedNewLine(ScopedNewLine&& other) noexcept : stream(other.stream), active(other.active) { other.active = false; } |