summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Stefano Cianciulli <scianciulli@google.com> 2022-07-01 15:33:36 +0000
committer Stefano Cianciulli <scianciulli@google.com> 2022-07-05 08:14:25 +0000
commit2de4a8278c80932d7ff650bf0e0bc2a624863ccc (patch)
tree0c911e022c5f6ec245d60a37b224b56674a25a21
parent38cb5adb8d48c6fbefd89bbdfc3b64054cf814d5 (diff)
Fix performance-noexcept-move-constructor clang-tidy issues
Test: m tidy-art Bug: 213953102 Merged-In: I4f4ff5febffcf045a907593621e68d87dd871680 Change-Id: I943f55b689b775397303fb889eea8d01001e6fbc
-rw-r--r--build/Android.bp2
-rw-r--r--libartbase/base/array_slice.h4
-rw-r--r--libartbase/base/stride_iterator.h4
-rw-r--r--openjdkjvmti/art_jvmti.h4
-rw-r--r--openjdkjvmti/ti_redefine.h4
-rw-r--r--runtime/jit/jit.cc2
-rw-r--r--test/ti-agent/scoped_utf_chars.h4
7 files changed, 12 insertions, 12 deletions
diff --git a/build/Android.bp b/build/Android.bp
index 2d6fe04250..098443e443 100644
--- a/build/Android.bp
+++ b/build/Android.bp
@@ -38,6 +38,7 @@ art_clang_tidy_errors = [
"performance-faster-string-find",
"performance-for-range-copy",
"performance-implicit-conversion-in-loop",
+ "performance-noexcept-move-constructor",
"performance-unnecessary-copy-initialization",
"performance-unnecessary-value-param",
]
@@ -50,7 +51,6 @@ art_clang_tidy_allowed = [
"misc-unused-using-decls",
"modernize-use-nullptr",
"modernize-use-using", // TODO: move to art_clang_tidy_errors after b/236243696 is done
- "performance-noexcept-move-constructor",
]
art_clang_tidy_disabled = [
diff --git a/libartbase/base/array_slice.h b/libartbase/base/array_slice.h
index a58ff4439d..067d9f284f 100644
--- a/libartbase/base/array_slice.h
+++ b/libartbase/base/array_slice.h
@@ -65,9 +65,9 @@ class ArraySlice {
lpa != nullptr ? lpa->size() : 0,
element_size) {}
ArraySlice(const ArraySlice<T>&) = default;
- ArraySlice(ArraySlice<T>&&) = default;
+ ArraySlice(ArraySlice<T>&&) noexcept = default;
ArraySlice<T>& operator=(const ArraySlice<T>&) = default;
- ArraySlice<T>& operator=(ArraySlice<T>&&) = default;
+ ArraySlice<T>& operator=(ArraySlice<T>&&) noexcept = default;
// Iterators.
iterator begin() { return iterator(&AtUnchecked(0), element_size_); }
diff --git a/libartbase/base/stride_iterator.h b/libartbase/base/stride_iterator.h
index 67c0d3803e..6a7e4bef67 100644
--- a/libartbase/base/stride_iterator.h
+++ b/libartbase/base/stride_iterator.h
@@ -30,9 +30,9 @@ class StrideIterator : public std::iterator<std::random_access_iterator_tag, T>
typename std::iterator<std::random_access_iterator_tag, T>::difference_type;
StrideIterator(const StrideIterator&) = default;
- StrideIterator(StrideIterator&&) = default;
+ StrideIterator(StrideIterator&&) noexcept = default;
StrideIterator& operator=(const StrideIterator&) = default;
- StrideIterator& operator=(StrideIterator&&) = default;
+ StrideIterator& operator=(StrideIterator&&) noexcept = default;
StrideIterator(T* ptr, size_t stride)
: ptr_(reinterpret_cast<uintptr_t>(ptr)),
diff --git a/openjdkjvmti/art_jvmti.h b/openjdkjvmti/art_jvmti.h
index 083ba6ddf1..cdda09b9e7 100644
--- a/openjdkjvmti/art_jvmti.h
+++ b/openjdkjvmti/art_jvmti.h
@@ -141,7 +141,7 @@ class JvmtiDeleter {
explicit JvmtiDeleter(jvmtiEnv* env) : env_(env) {}
JvmtiDeleter(JvmtiDeleter&) = default;
- JvmtiDeleter(JvmtiDeleter&&) = default;
+ JvmtiDeleter(JvmtiDeleter&&) noexcept = default;
JvmtiDeleter& operator=(const JvmtiDeleter&) = default;
void operator()(T* ptr) const {
@@ -161,7 +161,7 @@ class JvmtiDeleter<T[]> {
explicit JvmtiDeleter(jvmtiEnv* env) : env_(env) {}
JvmtiDeleter(JvmtiDeleter&) = default;
- JvmtiDeleter(JvmtiDeleter&&) = default;
+ JvmtiDeleter(JvmtiDeleter&&) noexcept = default;
JvmtiDeleter& operator=(const JvmtiDeleter&) = default;
template <typename U>
diff --git a/openjdkjvmti/ti_redefine.h b/openjdkjvmti/ti_redefine.h
index 85b1070516..cdd662787c 100644
--- a/openjdkjvmti/ti_redefine.h
+++ b/openjdkjvmti/ti_redefine.h
@@ -126,7 +126,7 @@ class Redefiner {
~ClassRedefinition() NO_THREAD_SAFETY_ANALYSIS;
// Move assignment so we can sort these in a vector.
- ClassRedefinition& operator=(ClassRedefinition&& other) {
+ ClassRedefinition& operator=(ClassRedefinition&& other) noexcept {
driver_ = other.driver_;
klass_ = other.klass_;
dex_file_ = std::move(other.dex_file_);
@@ -138,7 +138,7 @@ class Redefiner {
}
// Move constructor so we can put these into a vector.
- ClassRedefinition(ClassRedefinition&& other)
+ ClassRedefinition(ClassRedefinition&& other) noexcept
: driver_(other.driver_),
klass_(other.klass_),
dex_file_(std::move(other.dex_file_)),
diff --git a/runtime/jit/jit.cc b/runtime/jit/jit.cc
index 91869c6175..2deed43982 100644
--- a/runtime/jit/jit.cc
+++ b/runtime/jit/jit.cc
@@ -751,7 +751,7 @@ void Jit::NotifyZygoteCompilationDone() {
class ScopedCompilation {
public:
- ScopedCompilation(ScopedCompilation&& other) :
+ ScopedCompilation(ScopedCompilation&& other) noexcept :
jit_(other.jit_),
method_(other.method_),
compilation_kind_(other.compilation_kind_),
diff --git a/test/ti-agent/scoped_utf_chars.h b/test/ti-agent/scoped_utf_chars.h
index 422caaf84e..ddf1bd58f5 100644
--- a/test/ti-agent/scoped_utf_chars.h
+++ b/test/ti-agent/scoped_utf_chars.h
@@ -38,7 +38,7 @@ class ScopedUtfChars {
}
}
- ScopedUtfChars(ScopedUtfChars&& rhs) :
+ ScopedUtfChars(ScopedUtfChars&& rhs) noexcept :
env_(rhs.env_), string_(rhs.string_), utf_chars_(rhs.utf_chars_) {
rhs.env_ = nullptr;
rhs.string_ = nullptr;
@@ -51,7 +51,7 @@ class ScopedUtfChars {
}
}
- ScopedUtfChars& operator=(ScopedUtfChars&& rhs) {
+ ScopedUtfChars& operator=(ScopedUtfChars&& rhs) noexcept {
if (this != &rhs) {
// Delete the currently owned UTF chars.
this->~ScopedUtfChars();