diff options
author | 2017-11-08 13:35:21 -0800 | |
---|---|---|
committer | 2017-11-08 15:15:52 -0800 | |
commit | 2ffb703bf431d74326c88266b4ddaf225eb3c6ad (patch) | |
tree | 0552c3c76a42b18f9e7460d501fb71a6dc2e7f33 /runtime | |
parent | c4b6f3116f15c8e4fdf2e4f604ababdee12d8923 (diff) |
cpplint: Cleanup errors
Cleanup errors from upstream cpplint in preparation
for moving art's cpplint fork to upstream tip-of-tree cpplint.
Test: cd art && mm
Bug: 68951293
Change-Id: I15faed4594cbcb8399850f8bdee39d42c0c5b956
Diffstat (limited to 'runtime')
71 files changed, 374 insertions, 374 deletions
diff --git a/runtime/arch/arm64/entrypoints_init_arm64.cc b/runtime/arch/arm64/entrypoints_init_arm64.cc index d270bdb3b7..80bf3abc6f 100644 --- a/runtime/arch/arm64/entrypoints_init_arm64.cc +++ b/runtime/arch/arm64/entrypoints_init_arm64.cc @@ -192,6 +192,6 @@ void InitEntryPoints(JniEntryPoints* jpoints, QuickEntryPoints* qpoints) { UpdateReadBarrierEntrypoints(qpoints, /*is_active*/ false); qpoints->pReadBarrierSlow = artReadBarrierSlow; qpoints->pReadBarrierForRootSlow = artReadBarrierForRootSlow; -}; +} } // namespace art diff --git a/runtime/arch/mips/entrypoints_init_mips.cc b/runtime/arch/mips/entrypoints_init_mips.cc index 75cfc41028..dca3382664 100644 --- a/runtime/arch/mips/entrypoints_init_mips.cc +++ b/runtime/arch/mips/entrypoints_init_mips.cc @@ -467,6 +467,6 @@ void InitEntryPoints(JniEntryPoints* jpoints, QuickEntryPoints* qpoints) { qpoints->pReadBarrierForRootSlow = artReadBarrierForRootSlow; static_assert(IsDirectEntrypoint(kQuickReadBarrierForRootSlow), "Direct C stub not marked direct."); -}; +} } // namespace art diff --git a/runtime/arch/mips64/entrypoints_init_mips64.cc b/runtime/arch/mips64/entrypoints_init_mips64.cc index 15b3e38f8a..35cbd1dcc0 100644 --- a/runtime/arch/mips64/entrypoints_init_mips64.cc +++ b/runtime/arch/mips64/entrypoints_init_mips64.cc @@ -204,6 +204,6 @@ void InitEntryPoints(JniEntryPoints* jpoints, QuickEntryPoints* qpoints) { qpoints->pReadBarrierMarkReg28 = nullptr; qpoints->pReadBarrierSlow = artReadBarrierSlow; qpoints->pReadBarrierForRootSlow = artReadBarrierForRootSlow; -}; +} } // namespace art diff --git a/runtime/arch/x86/entrypoints_init_x86.cc b/runtime/arch/x86/entrypoints_init_x86.cc index 102faf19d4..24bf9cc07c 100644 --- a/runtime/arch/x86/entrypoints_init_x86.cc +++ b/runtime/arch/x86/entrypoints_init_x86.cc @@ -124,6 +124,6 @@ void InitEntryPoints(JniEntryPoints* jpoints, QuickEntryPoints* qpoints) { qpoints->pReadBarrierMarkReg29 = nullptr; qpoints->pReadBarrierSlow = art_quick_read_barrier_slow; qpoints->pReadBarrierForRootSlow = art_quick_read_barrier_for_root_slow; -}; +} } // namespace art diff --git a/runtime/arch/x86_64/entrypoints_init_x86_64.cc b/runtime/arch/x86_64/entrypoints_init_x86_64.cc index 5f7380f99d..3656f83b58 100644 --- a/runtime/arch/x86_64/entrypoints_init_x86_64.cc +++ b/runtime/arch/x86_64/entrypoints_init_x86_64.cc @@ -139,6 +139,6 @@ void InitEntryPoints(JniEntryPoints* jpoints, QuickEntryPoints* qpoints) { qpoints->pReadBarrierSlow = art_quick_read_barrier_slow; qpoints->pReadBarrierForRootSlow = art_quick_read_barrier_for_root_slow; #endif // __APPLE__ -}; +} } // namespace art diff --git a/runtime/base/allocator.cc b/runtime/base/allocator.cc index 2a2790c7d9..bb006389fa 100644 --- a/runtime/base/allocator.cc +++ b/runtime/base/allocator.cc @@ -26,7 +26,7 @@ namespace art { class MallocAllocator FINAL : public Allocator { public: - explicit MallocAllocator() {} + MallocAllocator() {} ~MallocAllocator() {} void* Alloc(size_t size) { @@ -45,7 +45,7 @@ MallocAllocator g_malloc_allocator; class NoopAllocator FINAL : public Allocator { public: - explicit NoopAllocator() {} + NoopAllocator() {} ~NoopAllocator() {} void* Alloc(size_t size ATTRIBUTE_UNUSED) { diff --git a/runtime/base/bit_struct_detail.h b/runtime/base/bit_struct_detail.h index 824d7df652..49d432e69c 100644 --- a/runtime/base/bit_struct_detail.h +++ b/runtime/base/bit_struct_detail.h @@ -31,88 +31,88 @@ template <typename T> static constexpr size_t BitStructSizeOf(); namespace detail { - // Select the smallest uintX_t that will fit kBitSize bits. - template <size_t kBitSize> - struct MinimumTypeUnsignedHelper { - using type = - typename std::conditional<kBitSize == 0, void, - typename std::conditional<kBitSize <= 8, uint8_t, - typename std::conditional<kBitSize <= 16, uint16_t, - typename std::conditional<kBitSize <= 32, uint32_t, - typename std::conditional<kBitSize <= 64, uint64_t, - typename std::conditional<kBitSize <= BitSizeOf<uintmax_t>(), uintmax_t, - void>::type>::type>::type>::type>::type>::type; - }; - - // Select the smallest [u]intX_t that will fit kBitSize bits. - // Automatically picks intX_t or uintX_t based on the sign-ness of T. - template <typename T, size_t kBitSize> - struct MinimumTypeHelper { - using type_unsigned = typename MinimumTypeUnsignedHelper<kBitSize>::type; - - using type = - typename std::conditional</* if */ std::is_signed<T>::value, - /* then */ typename std::make_signed<type_unsigned>::type, - /* else */ type_unsigned>::type; - }; - - // Denotes the beginning of a bit struct. - // - // This marker is required by the C++ standard in order to - // have a "common initial sequence". - // - // See C++ 9.5.1 [class.union]: - // If a standard-layout union contains several standard-layout structs that share a common - // initial sequence ... it is permitted to inspect the common initial sequence of any of - // standard-layout struct members. - template <size_t kSize> - struct DefineBitStructSize { - private: - typename MinimumTypeUnsignedHelper<kSize>::type _; - }; - - // Check if type "T" has a member called _ in it. - template <typename T> - struct HasUnderscoreField { - private: - using TrueT = std::integral_constant<bool, true>::type; - using FalseT = std::integral_constant<bool, false>::type; - - template <typename C> - static constexpr auto Test(void*) -> decltype(std::declval<C>()._, TrueT{}); // NOLINT - - template <typename> - static constexpr FalseT Test(...); - - public: - static constexpr bool value = decltype(Test<T>(0))::value; - }; - - // Infer the type of the member of &T::M. - template <typename T, typename M> - M GetMemberType(M T:: *); - - // Ensure the minimal type storage for 'T' matches its declared BitStructSizeOf. - // Nominally used by the BITSTRUCT_DEFINE_END macro. - template <typename T> - static constexpr bool ValidateBitStructSize() { - static_assert(std::is_union<T>::value, "T must be union"); - static_assert(std::is_standard_layout<T>::value, "T must be standard-layout"); - static_assert(HasUnderscoreField<T>::value, "T must have the _ DefineBitStructSize"); - - const size_t kBitStructSizeOf = BitStructSizeOf<T>(); - static_assert(std::is_same<decltype(GetMemberType(&T::_)), - DefineBitStructSize<kBitStructSizeOf>>::value, - "T::_ must be a DefineBitStructSize of the same size"); - - const size_t kExpectedSize = (BitStructSizeOf<T>() < kBitsPerByte) - ? kBitsPerByte - : RoundUpToPowerOfTwo(kBitStructSizeOf); - - // Ensure no extra fields were added in between START/END. - const size_t kActualSize = sizeof(T) * kBitsPerByte; - return kExpectedSize == kActualSize; - } +// Select the smallest uintX_t that will fit kBitSize bits. +template <size_t kBitSize> +struct MinimumTypeUnsignedHelper { + using type = + typename std::conditional<kBitSize == 0, void, // NOLINT [whitespace/operators] [3] + typename std::conditional<kBitSize <= 8, uint8_t, // NOLINT [whitespace/operators] [3] + typename std::conditional<kBitSize <= 16, uint16_t, // NOLINT [whitespace/operators] [3] + typename std::conditional<kBitSize <= 32, uint32_t, + typename std::conditional<kBitSize <= 64, uint64_t, + typename std::conditional<kBitSize <= BitSizeOf<uintmax_t>(), uintmax_t, + void>::type>::type>::type>::type>::type>::type; +}; + +// Select the smallest [u]intX_t that will fit kBitSize bits. +// Automatically picks intX_t or uintX_t based on the sign-ness of T. +template <typename T, size_t kBitSize> +struct MinimumTypeHelper { + using type_unsigned = typename MinimumTypeUnsignedHelper<kBitSize>::type; + + using type = + typename std::conditional</* if */ std::is_signed<T>::value, + /* then */ typename std::make_signed<type_unsigned>::type, + /* else */ type_unsigned>::type; +}; + +// Denotes the beginning of a bit struct. +// +// This marker is required by the C++ standard in order to +// have a "common initial sequence". +// +// See C++ 9.5.1 [class.union]: +// If a standard-layout union contains several standard-layout structs that share a common +// initial sequence ... it is permitted to inspect the common initial sequence of any of +// standard-layout struct members. +template <size_t kSize> +struct DefineBitStructSize { + private: + typename MinimumTypeUnsignedHelper<kSize>::type _; +}; + +// Check if type "T" has a member called _ in it. +template <typename T> +struct HasUnderscoreField { + private: + using TrueT = std::integral_constant<bool, true>::type; + using FalseT = std::integral_constant<bool, false>::type; + + template <typename C> + static constexpr auto Test(void*) -> decltype(std::declval<C>()._, TrueT{}); // NOLINT + + template <typename> + static constexpr FalseT Test(...); + + public: + static constexpr bool value = decltype(Test<T>(0))::value; +}; + +// Infer the type of the member of &T::M. +template <typename T, typename M> +M GetMemberType(M T:: *); + +// Ensure the minimal type storage for 'T' matches its declared BitStructSizeOf. +// Nominally used by the BITSTRUCT_DEFINE_END macro. +template <typename T> +static constexpr bool ValidateBitStructSize() { + static_assert(std::is_union<T>::value, "T must be union"); + static_assert(std::is_standard_layout<T>::value, "T must be standard-layout"); + static_assert(HasUnderscoreField<T>::value, "T must have the _ DefineBitStructSize"); + + const size_t kBitStructSizeOf = BitStructSizeOf<T>(); + static_assert(std::is_same<decltype(GetMemberType(&T::_)), + DefineBitStructSize<kBitStructSizeOf>>::value, + "T::_ must be a DefineBitStructSize of the same size"); + + const size_t kExpectedSize = (BitStructSizeOf<T>() < kBitsPerByte) + ? kBitsPerByte + : RoundUpToPowerOfTwo(kBitStructSizeOf); + + // Ensure no extra fields were added in between START/END. + const size_t kActualSize = sizeof(T) * kBitsPerByte; + return kExpectedSize == kActualSize; +} } // namespace detail } // namespace art diff --git a/runtime/base/hash_set.h b/runtime/base/hash_set.h index bc25b363b8..c743342a98 100644 --- a/runtime/base/hash_set.h +++ b/runtime/base/hash_set.h @@ -261,7 +261,7 @@ class HashSet { } HashSet& operator=(HashSet&& other) noexcept { - HashSet(std::move(other)).swap(*this); + HashSet(std::move(other)).swap(*this); // NOLINT [runtime/explicit] [5] return *this; } diff --git a/runtime/base/hash_set_test.cc b/runtime/base/hash_set_test.cc index 31b28ebf5a..ff745b4be5 100644 --- a/runtime/base/hash_set_test.cc +++ b/runtime/base/hash_set_test.cc @@ -294,7 +294,7 @@ size_t HashIntSequence(T begin, T end) { hash = hash * 2 + *iter; } return hash; -}; +} struct VectorIntHashEquals { std::size_t operator()(const std::vector<int>& item) const { diff --git a/runtime/base/mutex_test.cc b/runtime/base/mutex_test.cc index 752e77a7c0..7eba50b49c 100644 --- a/runtime/base/mutex_test.cc +++ b/runtime/base/mutex_test.cc @@ -97,7 +97,7 @@ TEST_F(MutexTest, RecursiveTryLockUnlock) { struct RecursiveLockWait { - explicit RecursiveLockWait() + RecursiveLockWait() : mu("test mutex", kDefaultMutexLevel, true), cv("test condition variable", mu) { } diff --git a/runtime/base/variant_map.h b/runtime/base/variant_map.h index 71a1018dea..fe332d1e3b 100644 --- a/runtime/base/variant_map.h +++ b/runtime/base/variant_map.h @@ -74,62 +74,62 @@ namespace art { // Implementation details for VariantMap. namespace detail { - // Allocate a unique counter value each time it's called. - struct VariantMapKeyCounterAllocator { - static size_t AllocateCounter() { - static size_t counter = 0; - counter++; +// Allocate a unique counter value each time it's called. +struct VariantMapKeyCounterAllocator { + static size_t AllocateCounter() { + static size_t counter = 0; + counter++; - return counter; - } - }; + return counter; + } +}; - // Type-erased version of VariantMapKey<T> - struct VariantMapKeyRaw { - // TODO: this may need to call a virtual function to support string comparisons - bool operator<(const VariantMapKeyRaw& other) const { - return key_counter_ < other.key_counter_; - } +// Type-erased version of VariantMapKey<T> +struct VariantMapKeyRaw { + // TODO: this may need to call a virtual function to support string comparisons + bool operator<(const VariantMapKeyRaw& other) const { + return key_counter_ < other.key_counter_; + } - // The following functions need to be virtual since we don't know the compile-time type anymore: + // The following functions need to be virtual since we don't know the compile-time type anymore: - // Clone the key, creating a copy of the contents. - virtual VariantMapKeyRaw* Clone() const = 0; + // Clone the key, creating a copy of the contents. + virtual VariantMapKeyRaw* Clone() const = 0; - // Delete a value whose runtime type is that of the non-erased key's TValue. - virtual void ValueDelete(void* value) const = 0; + // Delete a value whose runtime type is that of the non-erased key's TValue. + virtual void ValueDelete(void* value) const = 0; - // Clone a value whose runtime type is that of the non-erased key's TValue. - virtual void* ValueClone(void* value) const = 0; + // Clone a value whose runtime type is that of the non-erased key's TValue. + virtual void* ValueClone(void* value) const = 0; - // Compare one key to another (same as operator<). - virtual bool Compare(const VariantMapKeyRaw* other) const { - if (other == nullptr) { - return false; - } - return key_counter_ < other->key_counter_; + // Compare one key to another (same as operator<). + virtual bool Compare(const VariantMapKeyRaw* other) const { + if (other == nullptr) { + return false; } + return key_counter_ < other->key_counter_; + } - virtual ~VariantMapKeyRaw() {} + virtual ~VariantMapKeyRaw() {} - protected: - VariantMapKeyRaw() - : key_counter_(VariantMapKeyCounterAllocator::AllocateCounter()) {} - // explicit VariantMapKeyRaw(size_t counter) - // : key_counter_(counter) {} + protected: + VariantMapKeyRaw() + : key_counter_(VariantMapKeyCounterAllocator::AllocateCounter()) {} + // explicit VariantMapKeyRaw(size_t counter) + // : key_counter_(counter) {} - size_t GetCounter() const { - return key_counter_; - } + size_t GetCounter() const { + return key_counter_; + } - protected: - // Avoid the object slicing problem; use Clone() instead. - VariantMapKeyRaw(const VariantMapKeyRaw&) = default; - VariantMapKeyRaw(VariantMapKeyRaw&&) = default; + protected: + // Avoid the object slicing problem; use Clone() instead. + VariantMapKeyRaw(const VariantMapKeyRaw&) = default; + VariantMapKeyRaw(VariantMapKeyRaw&&) = default; - private: - size_t key_counter_; // Runtime type ID. Unique each time a new type is reified. - }; + private: + size_t key_counter_; // Runtime type ID. Unique each time a new type is reified. +}; } // namespace detail // The base type for keys used by the VariantMap. Users must subclass this type. @@ -189,9 +189,9 @@ struct VariantMapKey : detail::VariantMapKeyRaw { // Implementation details for a stringified VariantMapStringKey. namespace detail { - struct VariantMapStringKeyRegistry { - // TODO - }; +struct VariantMapStringKeyRegistry { + // TODO +}; } // namespace detail // Alternative base type for all keys used by VariantMap, supports runtime strings as the name. @@ -329,7 +329,7 @@ struct VariantMap { } // Construct an empty map. - explicit VariantMap() {} + VariantMap() {} template <typename ... TKeyValue> explicit VariantMap(const TKeyValue& ... key_value_list) { diff --git a/runtime/base/variant_map_test.cc b/runtime/base/variant_map_test.cc index 93336e0ac3..9dd29baf48 100644 --- a/runtime/base/variant_map_test.cc +++ b/runtime/base/variant_map_test.cc @@ -23,27 +23,27 @@ namespace art { namespace { +template <typename TValue> +struct FruitMapKey : VariantMapKey<TValue> { + FruitMapKey() {} +}; + +struct FruitMap : VariantMap<FruitMap, FruitMapKey> { + // This 'using' line is necessary to inherit the variadic constructor. + using VariantMap<FruitMap, FruitMapKey>::VariantMap; + + // Make the next '4' usages of Key slightly shorter to type. template <typename TValue> - struct FruitMapKey : VariantMapKey<TValue> { - FruitMapKey() {} - }; - - struct FruitMap : VariantMap<FruitMap, FruitMapKey> { - // This 'using' line is necessary to inherit the variadic constructor. - using VariantMap<FruitMap, FruitMapKey>::VariantMap; - - // Make the next '4' usages of Key slightly shorter to type. - template <typename TValue> - using Key = FruitMapKey<TValue>; - - static const Key<int> Apple; - static const Key<double> Orange; - static const Key<std::string> Label; - }; - - const FruitMap::Key<int> FruitMap::Apple; - const FruitMap::Key<double> FruitMap::Orange; - const FruitMap::Key<std::string> FruitMap::Label; + using Key = FruitMapKey<TValue>; + + static const Key<int> Apple; + static const Key<double> Orange; + static const Key<std::string> Label; +}; + +const FruitMap::Key<int> FruitMap::Apple; +const FruitMap::Key<double> FruitMap::Orange; +const FruitMap::Key<std::string> FruitMap::Label; } // namespace TEST(VariantMaps, BasicReadWrite) { diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index bd5e18493e..28caf81e5b 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -284,7 +284,7 @@ struct FieldGap { uint32_t size; // The gap size of 1, 2, or 4 bytes. }; struct FieldGapsComparator { - explicit FieldGapsComparator() { + FieldGapsComparator() { } bool operator() (const FieldGap& lhs, const FieldGap& rhs) NO_THREAD_SAFETY_ANALYSIS { @@ -3898,7 +3898,7 @@ mirror::Class* ClassLinker::LookupClass(Thread* self, class MoveClassTableToPreZygoteVisitor : public ClassLoaderVisitor { public: - explicit MoveClassTableToPreZygoteVisitor() {} + MoveClassTableToPreZygoteVisitor() {} void Visit(ObjPtr<mirror::ClassLoader> class_loader) REQUIRES(Locks::classlinker_classes_lock_) @@ -7468,7 +7468,7 @@ bool ClassLinker::LinkStaticFields(Thread* self, Handle<mirror::Class> klass, si } struct LinkFieldsComparator { - explicit LinkFieldsComparator() REQUIRES_SHARED(Locks::mutator_lock_) { + LinkFieldsComparator() REQUIRES_SHARED(Locks::mutator_lock_) { } // No thread safety analysis as will be called from STL. Checked lock held in constructor. bool operator()(ArtField* field1, ArtField* field2) diff --git a/runtime/class_linker.h b/runtime/class_linker.h index 2d9ec5a440..a4c4f3d9ab 100644 --- a/runtime/class_linker.h +++ b/runtime/class_linker.h @@ -40,31 +40,31 @@ namespace art { namespace gc { namespace space { - class ImageSpace; +class ImageSpace; } // namespace space } // namespace gc namespace linker { - struct CompilationHelper; - class ImageWriter; - class OatWriter; +struct CompilationHelper; +class ImageWriter; +class OatWriter; } // namespace linker namespace mirror { - class ClassLoader; - class DexCache; - class DexCachePointerArray; - class DexCacheMethodHandlesTest_Open_Test; - class DexCacheTest_Open_Test; - class IfTable; - class MethodHandle; - class MethodHandlesLookup; - class MethodType; - template<class T> class ObjectArray; - class StackTraceElement; - template <typename T> struct NativeDexCachePair; - using MethodDexCachePair = NativeDexCachePair<ArtMethod>; - using MethodDexCacheType = std::atomic<MethodDexCachePair>; +class ClassLoader; +class DexCache; +class DexCachePointerArray; +class DexCacheMethodHandlesTest_Open_Test; +class DexCacheTest_Open_Test; +class IfTable; +class MethodHandle; +class MethodHandlesLookup; +class MethodType; +template<class T> class ObjectArray; +class StackTraceElement; +template <typename T> struct NativeDexCachePair; +using MethodDexCachePair = NativeDexCachePair<ArtMethod>; +using MethodDexCacheType = std::atomic<MethodDexCachePair>; } // namespace mirror class ClassHierarchyAnalysis; diff --git a/runtime/class_linker_test.cc b/runtime/class_linker_test.cc index 1b867c0018..892a850997 100644 --- a/runtime/class_linker_test.cc +++ b/runtime/class_linker_test.cc @@ -564,7 +564,7 @@ struct ObjectOffsets : public CheckOffsets<mirror::Object> { addOffset(OFFSETOF_MEMBER(mirror::Object, x_rb_ptr_), "shadow$_x_rb_ptr_"); addOffset(OFFSETOF_MEMBER(mirror::Object, x_xpadding_), "shadow$_x_xpadding_"); #endif - }; + } }; struct ClassOffsets : public CheckOffsets<mirror::Class> { @@ -599,7 +599,7 @@ struct ClassOffsets : public CheckOffsets<mirror::Class> { addOffset(OFFSETOF_MEMBER(mirror::Class, super_class_), "superClass"); addOffset(OFFSETOF_MEMBER(mirror::Class, virtual_methods_offset_), "virtualMethodsOffset"); addOffset(OFFSETOF_MEMBER(mirror::Class, vtable_), "vtable"); - }; + } }; struct ClassExtOffsets : public CheckOffsets<mirror::ClassExt> { @@ -615,7 +615,7 @@ struct StringOffsets : public CheckOffsets<mirror::String> { StringOffsets() : CheckOffsets<mirror::String>(false, "Ljava/lang/String;") { addOffset(OFFSETOF_MEMBER(mirror::String, count_), "count"); addOffset(OFFSETOF_MEMBER(mirror::String, hash_code_), "hash"); - }; + } }; struct ThrowableOffsets : public CheckOffsets<mirror::Throwable> { @@ -625,7 +625,7 @@ struct ThrowableOffsets : public CheckOffsets<mirror::Throwable> { addOffset(OFFSETOF_MEMBER(mirror::Throwable, detail_message_), "detailMessage"); addOffset(OFFSETOF_MEMBER(mirror::Throwable, stack_trace_), "stackTrace"); addOffset(OFFSETOF_MEMBER(mirror::Throwable, suppressed_exceptions_), "suppressedExceptions"); - }; + } }; struct StackTraceElementOffsets : public CheckOffsets<mirror::StackTraceElement> { @@ -635,7 +635,7 @@ struct StackTraceElementOffsets : public CheckOffsets<mirror::StackTraceElement> addOffset(OFFSETOF_MEMBER(mirror::StackTraceElement, file_name_), "fileName"); addOffset(OFFSETOF_MEMBER(mirror::StackTraceElement, line_number_), "lineNumber"); addOffset(OFFSETOF_MEMBER(mirror::StackTraceElement, method_name_), "methodName"); - }; + } }; struct ClassLoaderOffsets : public CheckOffsets<mirror::ClassLoader> { @@ -645,13 +645,13 @@ struct ClassLoaderOffsets : public CheckOffsets<mirror::ClassLoader> { addOffset(OFFSETOF_MEMBER(mirror::ClassLoader, packages_), "packages"); addOffset(OFFSETOF_MEMBER(mirror::ClassLoader, parent_), "parent"); addOffset(OFFSETOF_MEMBER(mirror::ClassLoader, proxyCache_), "proxyCache"); - }; + } }; struct ProxyOffsets : public CheckOffsets<mirror::Proxy> { ProxyOffsets() : CheckOffsets<mirror::Proxy>(false, "Ljava/lang/reflect/Proxy;") { addOffset(OFFSETOF_MEMBER(mirror::Proxy, h_), "h"); - }; + } }; struct DexCacheOffsets : public CheckOffsets<mirror::DexCache> { @@ -670,7 +670,7 @@ struct DexCacheOffsets : public CheckOffsets<mirror::DexCache> { addOffset(OFFSETOF_MEMBER(mirror::DexCache, resolved_methods_), "resolvedMethods"); addOffset(OFFSETOF_MEMBER(mirror::DexCache, resolved_types_), "resolvedTypes"); addOffset(OFFSETOF_MEMBER(mirror::DexCache, strings_), "strings"); - }; + } }; struct ReferenceOffsets : public CheckOffsets<mirror::Reference> { @@ -679,7 +679,7 @@ struct ReferenceOffsets : public CheckOffsets<mirror::Reference> { addOffset(OFFSETOF_MEMBER(mirror::Reference, queue_), "queue"); addOffset(OFFSETOF_MEMBER(mirror::Reference, queue_next_), "queueNext"); addOffset(OFFSETOF_MEMBER(mirror::Reference, referent_), "referent"); - }; + } }; struct FinalizerReferenceOffsets : public CheckOffsets<mirror::FinalizerReference> { @@ -688,14 +688,14 @@ struct FinalizerReferenceOffsets : public CheckOffsets<mirror::FinalizerReferenc addOffset(OFFSETOF_MEMBER(mirror::FinalizerReference, next_), "next"); addOffset(OFFSETOF_MEMBER(mirror::FinalizerReference, prev_), "prev"); addOffset(OFFSETOF_MEMBER(mirror::FinalizerReference, zombie_), "zombie"); - }; + } }; struct AccessibleObjectOffsets : public CheckOffsets<mirror::AccessibleObject> { AccessibleObjectOffsets() : CheckOffsets<mirror::AccessibleObject>( false, "Ljava/lang/reflect/AccessibleObject;") { addOffset(mirror::AccessibleObject::FlagOffset().Uint32Value(), "override"); - }; + } }; struct FieldOffsets : public CheckOffsets<mirror::Field> { @@ -705,7 +705,7 @@ struct FieldOffsets : public CheckOffsets<mirror::Field> { addOffset(OFFSETOF_MEMBER(mirror::Field, dex_field_index_), "dexFieldIndex"); addOffset(OFFSETOF_MEMBER(mirror::Field, offset_), "offset"); addOffset(OFFSETOF_MEMBER(mirror::Field, type_), "type"); - }; + } }; struct ExecutableOffsets : public CheckOffsets<mirror::Executable> { @@ -720,7 +720,7 @@ struct ExecutableOffsets : public CheckOffsets<mirror::Executable> { addOffset(OFFSETOF_MEMBER(mirror::Executable, has_real_parameter_data_), "hasRealParameterData"); addOffset(OFFSETOF_MEMBER(mirror::Executable, parameters_), "parameters"); - }; + } }; struct MethodTypeOffsets : public CheckOffsets<mirror::MethodType> { diff --git a/runtime/class_table.h b/runtime/class_table.h index 744c010218..48129b1241 100644 --- a/runtime/class_table.h +++ b/runtime/class_table.h @@ -41,9 +41,9 @@ class OatWriter; } // namespace linker namespace mirror { - class Class; - class ClassLoader; - class Object; +class Class; +class ClassLoader; +class Object; } // namespace mirror // Each loader has a ClassTable diff --git a/runtime/common_throws.h b/runtime/common_throws.h index 2fc2016e50..3512b2b5bf 100644 --- a/runtime/common_throws.h +++ b/runtime/common_throws.h @@ -22,9 +22,9 @@ namespace art { namespace mirror { - class Class; - class Object; - class MethodType; +class Class; +class Object; +class MethodType; } // namespace mirror class ArtField; class ArtMethod; diff --git a/runtime/dex_file_annotations.h b/runtime/dex_file_annotations.h index e1088823c3..9dc400d6c2 100644 --- a/runtime/dex_file_annotations.h +++ b/runtime/dex_file_annotations.h @@ -24,8 +24,8 @@ namespace art { namespace mirror { - class ClassLoader; - class DexCache; +class ClassLoader; +class DexCache; } // namespace mirror class ArtField; class ArtMethod; diff --git a/runtime/entrypoints/entrypoint_utils.h b/runtime/entrypoints/entrypoint_utils.h index d2c98e153e..cda70ea265 100644 --- a/runtime/entrypoints/entrypoint_utils.h +++ b/runtime/entrypoints/entrypoint_utils.h @@ -32,10 +32,10 @@ namespace art { namespace mirror { - class Array; - class Class; - class Object; - class String; +class Array; +class Class; +class Object; +class String; } // namespace mirror class ArtField; diff --git a/runtime/entrypoints/quick/quick_default_init_entrypoints.h b/runtime/entrypoints/quick/quick_default_init_entrypoints.h index 267f384fe7..8acaa90053 100644 --- a/runtime/entrypoints/quick/quick_default_init_entrypoints.h +++ b/runtime/entrypoints/quick/quick_default_init_entrypoints.h @@ -118,7 +118,7 @@ static void DefaultInitEntryPoints(JniEntryPoints* jpoints, QuickEntryPoints* qp // Deoptimize qpoints->pDeoptimize = art_quick_deoptimize_from_compiled_code; -}; +} } // namespace art diff --git a/runtime/gc/accounting/card_table.h b/runtime/gc/accounting/card_table.h index 17acc763d1..766c976c98 100644 --- a/runtime/gc/accounting/card_table.h +++ b/runtime/gc/accounting/card_table.h @@ -27,13 +27,13 @@ namespace art { class MemMap; namespace mirror { - class Object; +class Object; } // namespace mirror namespace gc { namespace space { - class ContinuousSpace; +class ContinuousSpace; } // namespace space class Heap; diff --git a/runtime/gc/accounting/card_table_test.cc b/runtime/gc/accounting/card_table_test.cc index 67ab14ce8e..cb2479ffad 100644 --- a/runtime/gc/accounting/card_table_test.cc +++ b/runtime/gc/accounting/card_table_test.cc @@ -30,7 +30,7 @@ namespace art { namespace mirror { - class Object; +class Object; } // namespace mirror namespace gc { diff --git a/runtime/gc/accounting/heap_bitmap.h b/runtime/gc/accounting/heap_bitmap.h index 36426e9b6c..4237e7ee3f 100644 --- a/runtime/gc/accounting/heap_bitmap.h +++ b/runtime/gc/accounting/heap_bitmap.h @@ -27,7 +27,7 @@ namespace gc { class Heap; namespace collector { - class ConcurrentCopying; +class ConcurrentCopying; } // namespace collector namespace accounting { diff --git a/runtime/gc/accounting/mod_union_table.h b/runtime/gc/accounting/mod_union_table.h index ee25eae93a..4b5d5f3510 100644 --- a/runtime/gc/accounting/mod_union_table.h +++ b/runtime/gc/accounting/mod_union_table.h @@ -37,7 +37,7 @@ class MarkObjectVisitor; namespace gc { namespace space { - class ContinuousSpace; +class ContinuousSpace; } // namespace space class Heap; diff --git a/runtime/gc/accounting/remembered_set.h b/runtime/gc/accounting/remembered_set.h index c332f969ad..90d4ffb368 100644 --- a/runtime/gc/accounting/remembered_set.h +++ b/runtime/gc/accounting/remembered_set.h @@ -28,11 +28,11 @@ namespace art { namespace gc { namespace collector { - class GarbageCollector; - class MarkSweep; +class GarbageCollector; +class MarkSweep; } // namespace collector namespace space { - class ContinuousSpace; +class ContinuousSpace; } // namespace space class Heap; diff --git a/runtime/gc/accounting/space_bitmap.h b/runtime/gc/accounting/space_bitmap.h index b49e0b7f89..2f33bac902 100644 --- a/runtime/gc/accounting/space_bitmap.h +++ b/runtime/gc/accounting/space_bitmap.h @@ -29,8 +29,8 @@ namespace art { namespace mirror { - class Class; - class Object; +class Class; +class Object; } // namespace mirror class MemMap; diff --git a/runtime/gc/allocation_listener.h b/runtime/gc/allocation_listener.h index 0be9aecae4..7675a22433 100644 --- a/runtime/gc/allocation_listener.h +++ b/runtime/gc/allocation_listener.h @@ -28,7 +28,7 @@ namespace art { namespace mirror { - class Object; +class Object; } // namespace mirror class Thread; diff --git a/runtime/gc/allocation_record.h b/runtime/gc/allocation_record.h index fcd08c1b7b..d1311df572 100644 --- a/runtime/gc/allocation_record.h +++ b/runtime/gc/allocation_record.h @@ -31,8 +31,8 @@ class IsMarkedVisitor; class Thread; namespace mirror { - class Class; - class Object; +class Class; +class Object; } // namespace mirror namespace gc { diff --git a/runtime/gc/collector/concurrent_copying.h b/runtime/gc/collector/concurrent_copying.h index cc7072d9da..8b4b58e7b1 100644 --- a/runtime/gc/collector/concurrent_copying.h +++ b/runtime/gc/collector/concurrent_copying.h @@ -39,16 +39,16 @@ class Object; namespace gc { namespace accounting { - template<typename T> class AtomicStack; - typedef AtomicStack<mirror::Object> ObjectStack; - template <size_t kAlignment> class SpaceBitmap; - typedef SpaceBitmap<kObjectAlignment> ContinuousSpaceBitmap; - class HeapBitmap; - class ReadBarrierTable; +template<typename T> class AtomicStack; +typedef AtomicStack<mirror::Object> ObjectStack; +template <size_t kAlignment> class SpaceBitmap; +typedef SpaceBitmap<kObjectAlignment> ContinuousSpaceBitmap; +class HeapBitmap; +class ReadBarrierTable; } // namespace accounting namespace space { - class RegionSpace; +class RegionSpace; } // namespace space namespace collector { diff --git a/runtime/gc/collector/immune_spaces_test.cc b/runtime/gc/collector/immune_spaces_test.cc index 9823708606..9767807fb8 100644 --- a/runtime/gc/collector/immune_spaces_test.cc +++ b/runtime/gc/collector/immune_spaces_test.cc @@ -209,7 +209,7 @@ TEST_F(ImmuneSpacesTest, AppendAfterImage) { ImmuneSpaces spaces; constexpr size_t kImageSize = 123 * kPageSize; constexpr size_t kImageOatSize = 321 * kPageSize; - constexpr size_t kOtherSpaceSize= 100 * kPageSize; + constexpr size_t kOtherSpaceSize = 100 * kPageSize; uint8_t* memory = GetContinuousMemoryRegion(kImageSize + kImageOatSize + kOtherSpaceSize); diff --git a/runtime/gc/collector/mark_compact.h b/runtime/gc/collector/mark_compact.h index 7d64a0c64a..41228099d3 100644 --- a/runtime/gc/collector/mark_compact.h +++ b/runtime/gc/collector/mark_compact.h @@ -35,8 +35,8 @@ namespace art { class Thread; namespace mirror { - class Class; - class Object; +class Class; +class Object; } // namespace mirror namespace gc { @@ -44,14 +44,14 @@ namespace gc { class Heap; namespace accounting { - template <typename T> class AtomicStack; - typedef AtomicStack<mirror::Object> ObjectStack; +template <typename T> class AtomicStack; +typedef AtomicStack<mirror::Object> ObjectStack; } // namespace accounting namespace space { - class BumpPointerSpace; - class ContinuousMemMapAllocSpace; - class ContinuousSpace; +class BumpPointerSpace; +class ContinuousMemMapAllocSpace; +class ContinuousSpace; } // namespace space namespace collector { diff --git a/runtime/gc/collector/semi_space.h b/runtime/gc/collector/semi_space.h index 6d4d789a72..fc77c17497 100644 --- a/runtime/gc/collector/semi_space.h +++ b/runtime/gc/collector/semi_space.h @@ -34,8 +34,8 @@ namespace art { class Thread; namespace mirror { - class Class; - class Object; +class Class; +class Object; } // namespace mirror namespace gc { @@ -43,13 +43,13 @@ namespace gc { class Heap; namespace accounting { - template <typename T> class AtomicStack; - typedef AtomicStack<mirror::Object> ObjectStack; +template <typename T> class AtomicStack; +typedef AtomicStack<mirror::Object> ObjectStack; } // namespace accounting namespace space { - class ContinuousMemMapAllocSpace; - class ContinuousSpace; +class ContinuousMemMapAllocSpace; +class ContinuousSpace; } // namespace space namespace collector { diff --git a/runtime/gc/heap.h b/runtime/gc/heap.h index 7b4fab607f..4d7424c7ef 100644 --- a/runtime/gc/heap.h +++ b/runtime/gc/heap.h @@ -55,8 +55,8 @@ class TimingLogger; class VariableSizedHandleScope; namespace mirror { - class Class; - class Object; +class Class; +class Object; } // namespace mirror namespace gc { @@ -69,40 +69,40 @@ class TaskProcessor; class Verification; namespace accounting { - template <typename T> class AtomicStack; - typedef AtomicStack<mirror::Object> ObjectStack; - class CardTable; - class HeapBitmap; - class ModUnionTable; - class ReadBarrierTable; - class RememberedSet; +template <typename T> class AtomicStack; +typedef AtomicStack<mirror::Object> ObjectStack; +class CardTable; +class HeapBitmap; +class ModUnionTable; +class ReadBarrierTable; +class RememberedSet; } // namespace accounting namespace collector { - class ConcurrentCopying; - class GarbageCollector; - class MarkCompact; - class MarkSweep; - class SemiSpace; +class ConcurrentCopying; +class GarbageCollector; +class MarkCompact; +class MarkSweep; +class SemiSpace; } // namespace collector namespace allocator { - class RosAlloc; +class RosAlloc; } // namespace allocator namespace space { - class AllocSpace; - class BumpPointerSpace; - class ContinuousMemMapAllocSpace; - class DiscontinuousSpace; - class DlMallocSpace; - class ImageSpace; - class LargeObjectSpace; - class MallocSpace; - class RegionSpace; - class RosAllocSpace; - class Space; - class ZygoteSpace; +class AllocSpace; +class BumpPointerSpace; +class ContinuousMemMapAllocSpace; +class DiscontinuousSpace; +class DlMallocSpace; +class ImageSpace; +class LargeObjectSpace; +class MallocSpace; +class RegionSpace; +class RosAllocSpace; +class Space; +class ZygoteSpace; } // namespace space enum HomogeneousSpaceCompactResult { diff --git a/runtime/gc/reference_processor.h b/runtime/gc/reference_processor.h index a8135d9a3b..1d984eb768 100644 --- a/runtime/gc/reference_processor.h +++ b/runtime/gc/reference_processor.h @@ -45,7 +45,7 @@ class Heap; // Used to process java.lang.ref.Reference instances concurrently or paused. class ReferenceProcessor { public: - explicit ReferenceProcessor(); + ReferenceProcessor(); void ProcessReferences(bool concurrent, TimingLogger* timings, bool clear_soft_references, diff --git a/runtime/gc/space/bump_pointer_space.h b/runtime/gc/space/bump_pointer_space.h index 4197d0cd3f..7b43362c2d 100644 --- a/runtime/gc/space/bump_pointer_space.h +++ b/runtime/gc/space/bump_pointer_space.h @@ -28,7 +28,7 @@ class Object; namespace gc { namespace collector { - class MarkSweep; +class MarkSweep; } // namespace collector namespace space { diff --git a/runtime/gc/space/dlmalloc_space.h b/runtime/gc/space/dlmalloc_space.h index 8fb2d7682c..4c7fcfdeb9 100644 --- a/runtime/gc/space/dlmalloc_space.h +++ b/runtime/gc/space/dlmalloc_space.h @@ -24,7 +24,7 @@ namespace art { namespace gc { namespace collector { - class MarkSweep; +class MarkSweep; } // namespace collector namespace space { diff --git a/runtime/gc/space/malloc_space.h b/runtime/gc/space/malloc_space.h index a41ef43125..c1f4841cb6 100644 --- a/runtime/gc/space/malloc_space.h +++ b/runtime/gc/space/malloc_space.h @@ -26,7 +26,7 @@ namespace art { namespace gc { namespace collector { - class MarkSweep; +class MarkSweep; } // namespace collector namespace space { diff --git a/runtime/gc/space/rosalloc_space.h b/runtime/gc/space/rosalloc_space.h index f9c7dbcacd..9d16b87b7d 100644 --- a/runtime/gc/space/rosalloc_space.h +++ b/runtime/gc/space/rosalloc_space.h @@ -25,7 +25,7 @@ namespace art { namespace gc { namespace collector { - class MarkSweep; +class MarkSweep; } // namespace collector namespace space { diff --git a/runtime/gc/space/space.h b/runtime/gc/space/space.h index 2a4f830843..6b76048cb1 100644 --- a/runtime/gc/space/space.h +++ b/runtime/gc/space/space.h @@ -30,7 +30,7 @@ namespace art { namespace mirror { - class Object; +class Object; } // namespace mirror namespace gc { diff --git a/runtime/hprof/hprof.cc b/runtime/hprof/hprof.cc index 7976a1a9a1..6a1a8c7271 100644 --- a/runtime/hprof/hprof.cc +++ b/runtime/hprof/hprof.cc @@ -1088,7 +1088,7 @@ void Hprof::DumpHeapObject(mirror::Object* obj) { class RootCollector { public: - explicit RootCollector() {} + RootCollector() {} void operator()(mirror::Object*, MemberOffset, bool) const {} diff --git a/runtime/instrumentation.h b/runtime/instrumentation.h index 5bac931875..da63152d10 100644 --- a/runtime/instrumentation.h +++ b/runtime/instrumentation.h @@ -30,9 +30,9 @@ namespace art { namespace mirror { - class Class; - class Object; - class Throwable; +class Class; +class Object; +class Throwable; } // namespace mirror class ArtField; class ArtMethod; diff --git a/runtime/interpreter/lock_count_data.h b/runtime/interpreter/lock_count_data.h index 64874a5db7..3098d4f6b7 100644 --- a/runtime/interpreter/lock_count_data.h +++ b/runtime/interpreter/lock_count_data.h @@ -25,7 +25,7 @@ namespace art { namespace mirror { - class Object; +class Object; } // namespace mirror class Thread; diff --git a/runtime/interpreter/shadow_frame.h b/runtime/interpreter/shadow_frame.h index 88275cc6d4..be2c943427 100644 --- a/runtime/interpreter/shadow_frame.h +++ b/runtime/interpreter/shadow_frame.h @@ -32,7 +32,7 @@ namespace art { namespace mirror { - class Object; +class Object; } // namespace mirror class ArtMethod; diff --git a/runtime/java_vm_ext.h b/runtime/java_vm_ext.h index 0510d6ab75..7c2755fc58 100644 --- a/runtime/java_vm_ext.h +++ b/runtime/java_vm_ext.h @@ -28,7 +28,7 @@ namespace art { namespace mirror { - class Array; +class Array; } // namespace mirror class ArtMethod; diff --git a/runtime/jdwp/jdwp.h b/runtime/jdwp/jdwp.h index 86af6d44db..aeeda1e791 100644 --- a/runtime/jdwp/jdwp.h +++ b/runtime/jdwp/jdwp.h @@ -40,9 +40,9 @@ union JValue; class Thread; namespace mirror { - class Class; - class Object; - class Throwable; +class Class; +class Object; +class Throwable; } // namespace mirror class Thread; diff --git a/runtime/jdwp/object_registry.h b/runtime/jdwp/object_registry.h index 8754631e1b..26869b616e 100644 --- a/runtime/jdwp/object_registry.h +++ b/runtime/jdwp/object_registry.h @@ -31,8 +31,8 @@ namespace art { namespace mirror { - class Object; - class Class; +class Object; +class Class; } // namespace mirror struct ObjectRegistryEntry { diff --git a/runtime/jit/jit.cc b/runtime/jit/jit.cc index 72b5a942fe..953e195480 100644 --- a/runtime/jit/jit.cc +++ b/runtime/jit/jit.cc @@ -52,7 +52,7 @@ static constexpr size_t kJitStressDefaultCompileThreshold = 100; // Fast- static constexpr size_t kJitSlowStressDefaultCompileThreshold = 2; // Slow-debug build. // JIT compiler -void* Jit::jit_library_handle_= nullptr; +void* Jit::jit_library_handle_ = nullptr; void* Jit::jit_compiler_handle_ = nullptr; void* (*Jit::jit_load_)(bool*) = nullptr; void (*Jit::jit_unload_)(void*) = nullptr; diff --git a/runtime/lock_word.h b/runtime/lock_word.h index 14f638ee78..b9aa0b793b 100644 --- a/runtime/lock_word.h +++ b/runtime/lock_word.h @@ -26,7 +26,7 @@ namespace art { namespace mirror { - class Object; +class Object; } // namespace mirror class Monitor; diff --git a/runtime/mem_map.h b/runtime/mem_map.h index 5603963eac..36a24169d5 100644 --- a/runtime/mem_map.h +++ b/runtime/mem_map.h @@ -21,7 +21,7 @@ #include <sys/types.h> #include <map> -#include <mutex> +#include <mutex> // NOLINT [build/c++11] [5] #include <string> #include "android-base/thread_annotations.h" diff --git a/runtime/method_handles.h b/runtime/method_handles.h index 8641918f1b..930b8db63e 100644 --- a/runtime/method_handles.h +++ b/runtime/method_handles.h @@ -28,8 +28,8 @@ namespace art { namespace mirror { - class MethodHandle; - class MethodType; +class MethodHandle; +class MethodType; } // namespace mirror // Returns true if there is a possible conversion from |from| to |to| diff --git a/runtime/monitor.h b/runtime/monitor.h index d7aef34e0b..b4c0e6f471 100644 --- a/runtime/monitor.h +++ b/runtime/monitor.h @@ -45,7 +45,7 @@ class Thread; typedef uint32_t MonitorId; namespace mirror { - class Object; +class Object; } // namespace mirror enum class LockReason { diff --git a/runtime/monitor_pool.cc b/runtime/monitor_pool.cc index 9d221cca83..d00f979379 100644 --- a/runtime/monitor_pool.cc +++ b/runtime/monitor_pool.cc @@ -24,7 +24,7 @@ namespace art { namespace mirror { - class Object; +class Object; } // namespace mirror MonitorPool::MonitorPool() diff --git a/runtime/oat_file.cc b/runtime/oat_file.cc index d64986e76d..4429adeb81 100644 --- a/runtime/oat_file.cc +++ b/runtime/oat_file.cc @@ -1771,7 +1771,7 @@ CompilerFilter::Filter OatFile::GetCompilerFilter() const { std::string OatFile::GetClassLoaderContext() const { return GetOatHeader().GetStoreValueByKey(OatHeader::kClassPathKey); -}; +} OatFile::OatClass OatFile::FindOatClass(const DexFile& dex_file, uint16_t class_def_idx, diff --git a/runtime/oat_file_assistant.cc b/runtime/oat_file_assistant.cc index 97b2aecd82..378ce2cff2 100644 --- a/runtime/oat_file_assistant.cc +++ b/runtime/oat_file_assistant.cc @@ -696,7 +696,7 @@ class Dex2oatFileWrapper { void DisableUnlinkAtDestruction() { unlink_file_at_destruction_ = false; - }; + } private: std::unique_ptr<File> file_; diff --git a/runtime/oat_file_assistant_test.cc b/runtime/oat_file_assistant_test.cc index bd500ebe77..65d01a4d52 100644 --- a/runtime/oat_file_assistant_test.cc +++ b/runtime/oat_file_assistant_test.cc @@ -40,7 +40,7 @@ namespace art { -static const std::string kSpecialSharedLibrary = "&"; +static const std::string kSpecialSharedLibrary = "&"; // NOLINT [runtime/string] [4] static ClassLoaderContext* kSpecialSharedLibraryContext = nullptr; class OatFileAssistantTest : public DexoptTest {}; diff --git a/runtime/object_callbacks.h b/runtime/object_callbacks.h index 9eccb5a280..d36913b891 100644 --- a/runtime/object_callbacks.h +++ b/runtime/object_callbacks.h @@ -21,8 +21,8 @@ namespace art { namespace mirror { - class Object; - template<class MirrorType> class HeapReference; +class Object; +template<class MirrorType> class HeapReference; } // namespace mirror class IsMarkedVisitor { diff --git a/runtime/read_barrier.h b/runtime/read_barrier.h index 00674b2b89..d4b9f4311f 100644 --- a/runtime/read_barrier.h +++ b/runtime/read_barrier.h @@ -28,8 +28,8 @@ namespace art { namespace mirror { - class Object; - template<typename MirrorType> class HeapReference; +class Object; +template<typename MirrorType> class HeapReference; } // namespace mirror class ArtMethod; diff --git a/runtime/reference_table_test.cc b/runtime/reference_table_test.cc index 1e7fc3ee92..720a9d6219 100644 --- a/runtime/reference_table_test.cc +++ b/runtime/reference_table_test.cc @@ -16,7 +16,7 @@ #include "reference_table.h" -#include <regex> +#include <regex> // NOLINT [build/c++11] [5] #include "android-base/stringprintf.h" diff --git a/runtime/reflection.h b/runtime/reflection.h index f2652fd4b6..2da291757c 100644 --- a/runtime/reflection.h +++ b/runtime/reflection.h @@ -24,8 +24,8 @@ namespace art { namespace mirror { - class Class; - class Object; +class Class; +class Object; } // namespace mirror class ArtField; class ArtMethod; diff --git a/runtime/runtime.h b/runtime/runtime.h index 9f79a01aa8..6b01cc220f 100644 --- a/runtime/runtime.h +++ b/runtime/runtime.h @@ -44,31 +44,31 @@ namespace art { namespace gc { - class AbstractSystemWeakHolder; - class Heap; +class AbstractSystemWeakHolder; +class Heap; } // namespace gc namespace jit { - class Jit; - class JitOptions; +class Jit; +class JitOptions; } // namespace jit namespace mirror { - class Array; - class ClassLoader; - class DexCache; - template<class T> class ObjectArray; - template<class T> class PrimitiveArray; - typedef PrimitiveArray<int8_t> ByteArray; - class String; - class Throwable; +class Array; +class ClassLoader; +class DexCache; +template<class T> class ObjectArray; +template<class T> class PrimitiveArray; +typedef PrimitiveArray<int8_t> ByteArray; +class String; +class Throwable; } // namespace mirror namespace ti { - class Agent; +class Agent; } // namespace ti namespace verifier { - class MethodVerifier; - enum class VerifyMode : int8_t; +class MethodVerifier; +enum class VerifyMode : int8_t; } // namespace verifier class ArenaPool; class ArtMethod; diff --git a/runtime/runtime_callbacks_test.cc b/runtime/runtime_callbacks_test.cc index 0b69851a55..d283c79960 100644 --- a/runtime/runtime_callbacks_test.cc +++ b/runtime/runtime_callbacks_test.cc @@ -22,7 +22,7 @@ #include <initializer_list> #include <memory> -#include <mutex> +#include <mutex> // NOLINT [build/c++11] [5] #include <string> #include "jni.h" diff --git a/runtime/runtime_options.h b/runtime/runtime_options.h index 89a1dcb415..3f5e7762f6 100644 --- a/runtime/runtime_options.h +++ b/runtime/runtime_options.h @@ -43,37 +43,37 @@ struct BackgroundGcOption; #define DECLARE_KEY(Type, Name) static const Key<Type> Name - // Define a key that is usable with a RuntimeArgumentMap. - // This key will *not* work with other subtypes of VariantMap. - template <typename TValue> - struct RuntimeArgumentMapKey : VariantMapKey<TValue> { - RuntimeArgumentMapKey() {} - explicit RuntimeArgumentMapKey(TValue default_value) - : VariantMapKey<TValue>(std::move(default_value)) {} - // Don't ODR-use constexpr default values, which means that Struct::Fields - // that are declared 'static constexpr T Name = Value' don't need to have a matching definition. - }; +// Define a key that is usable with a RuntimeArgumentMap. +// This key will *not* work with other subtypes of VariantMap. +template <typename TValue> +struct RuntimeArgumentMapKey : VariantMapKey<TValue> { + RuntimeArgumentMapKey() {} + explicit RuntimeArgumentMapKey(TValue default_value) + : VariantMapKey<TValue>(std::move(default_value)) {} + // Don't ODR-use constexpr default values, which means that Struct::Fields + // that are declared 'static constexpr T Name = Value' don't need to have a matching definition. +}; - // Defines a type-safe heterogeneous key->value map. - // Use the VariantMap interface to look up or to store a RuntimeArgumentMapKey,Value pair. - // - // Example: - // auto map = RuntimeArgumentMap(); - // map.Set(RuntimeArgumentMap::HeapTargetUtilization, 5.0); - // double *target_utilization = map.Get(RuntimeArgumentMap); - // - struct RuntimeArgumentMap : VariantMap<RuntimeArgumentMap, RuntimeArgumentMapKey> { - // This 'using' line is necessary to inherit the variadic constructor. - using VariantMap<RuntimeArgumentMap, RuntimeArgumentMapKey>::VariantMap; +// Defines a type-safe heterogeneous key->value map. +// Use the VariantMap interface to look up or to store a RuntimeArgumentMapKey,Value pair. +// +// Example: +// auto map = RuntimeArgumentMap(); +// map.Set(RuntimeArgumentMap::HeapTargetUtilization, 5.0); +// double *target_utilization = map.Get(RuntimeArgumentMap); +// +struct RuntimeArgumentMap : VariantMap<RuntimeArgumentMap, RuntimeArgumentMapKey> { + // This 'using' line is necessary to inherit the variadic constructor. + using VariantMap<RuntimeArgumentMap, RuntimeArgumentMapKey>::VariantMap; - // Make the next many usages of Key slightly shorter to type. - template <typename TValue> - using Key = RuntimeArgumentMapKey<TValue>; + // Make the next many usages of Key slightly shorter to type. + template <typename TValue> + using Key = RuntimeArgumentMapKey<TValue>; - // List of key declarations, shorthand for 'static const Key<T> Name' + // List of key declarations, shorthand for 'static const Key<T> Name' #define RUNTIME_OPTIONS_KEY(Type, Name, ...) static const Key<Type> (Name); #include "runtime_options.def" - }; +}; #undef DECLARE_KEY diff --git a/runtime/stack.h b/runtime/stack.h index 4ef9487724..bd6204f8d2 100644 --- a/runtime/stack.h +++ b/runtime/stack.h @@ -27,7 +27,7 @@ namespace art { namespace mirror { - class Object; +class Object; } // namespace mirror class ArtMethod; diff --git a/runtime/subtype_check_test.cc b/runtime/subtype_check_test.cc index 4673274fa4..dd51c18eff 100644 --- a/runtime/subtype_check_test.cc +++ b/runtime/subtype_check_test.cc @@ -29,7 +29,7 @@ constexpr size_t BitString::kCapacity; using namespace art; // NOLINT struct MockClass { - MockClass(MockClass* parent, size_t x = 0, size_t y = 0) { + explicit MockClass(MockClass* parent, size_t x = 0, size_t y = 0) { parent_ = parent; memset(&subtype_check_info_and_status_, 0u, sizeof(subtype_check_info_and_status_)); @@ -274,7 +274,7 @@ struct MockSubtypeCheck { SC::Dump(tree.klass_, os); os << ", class: " << tree.klass_->PrettyClass() << ")"; return os; - }; + } // Additional convenience functions. SubtypeCheckInfo::State GetState() const @@ -826,7 +826,7 @@ bool IsTooWide(MockClass* kls) { } } return IsTooWide(kls->GetParent()); -}; +} // Either itself is too deep, or any of the parents were too deep. bool IsTooDeep(MockClass* kls) { @@ -839,7 +839,7 @@ bool IsTooDeep(MockClass* kls) { } } return false; -}; +} TEST_F(SubtypeCheckTest, EnsureInitialized_TooWide) { auto transitions = [](MockClass* kls) { diff --git a/runtime/thread.h b/runtime/thread.h index 3b917bab9b..39be66d5c2 100644 --- a/runtime/thread.h +++ b/runtime/thread.h @@ -51,29 +51,29 @@ namespace art { namespace gc { namespace accounting { - template<class T> class AtomicStack; +template<class T> class AtomicStack; } // namespace accounting namespace collector { - class SemiSpace; +class SemiSpace; } // namespace collector } // namespace gc namespace mirror { - class Array; - class Class; - class ClassLoader; - class Object; - template<class T> class ObjectArray; - template<class T> class PrimitiveArray; - typedef PrimitiveArray<int32_t> IntArray; - class StackTraceElement; - class String; - class Throwable; +class Array; +class Class; +class ClassLoader; +class Object; +template<class T> class ObjectArray; +template<class T> class PrimitiveArray; +typedef PrimitiveArray<int32_t> IntArray; +class StackTraceElement; +class String; +class Throwable; } // namespace mirror namespace verifier { - class MethodVerifier; - class VerifierDeps; +class MethodVerifier; +class VerifierDeps; } // namespace verifier class ArtMethod; diff --git a/runtime/thread_list.h b/runtime/thread_list.h index 11f272c48c..7657fa805f 100644 --- a/runtime/thread_list.h +++ b/runtime/thread_list.h @@ -31,10 +31,10 @@ namespace art { namespace gc { - namespace collector { - class GarbageCollector; - } // namespace collector - class GcPauseListener; +namespace collector { +class GarbageCollector; +} // namespace collector +class GcPauseListener; } // namespace gc class Closure; class RootVisitor; diff --git a/runtime/ti/agent.cc b/runtime/ti/agent.cc index 20e297c991..3bf169ad40 100644 --- a/runtime/ti/agent.cc +++ b/runtime/ti/agent.cc @@ -100,7 +100,7 @@ Agent::LoadError Agent::DoDlOpen(/*out*/std::string* error_msg) { if (onattach_ == nullptr) { VLOG(agents) << "Unable to find 'Agent_OnAttach' symbol in " << this; } - onunload_= reinterpret_cast<AgentOnUnloadFunction>(FindSymbol(AGENT_ON_UNLOAD_FUNCTION_NAME)); + onunload_ = reinterpret_cast<AgentOnUnloadFunction>(FindSymbol(AGENT_ON_UNLOAD_FUNCTION_NAME)); if (onunload_ == nullptr) { VLOG(agents) << "Unable to find 'Agent_OnUnload' symbol in " << this; } diff --git a/runtime/type_reference.h b/runtime/type_reference.h index 5ddc9d05d4..70bdc325f0 100644 --- a/runtime/type_reference.h +++ b/runtime/type_reference.h @@ -30,7 +30,7 @@ class DexFile; // A type is located by its DexFile and the string_ids_ table index into that DexFile. class TypeReference : public DexFileReference { public: - TypeReference(const DexFile* file = nullptr, dex::TypeIndex index = dex::TypeIndex()) + explicit TypeReference(const DexFile* file = nullptr, dex::TypeIndex index = dex::TypeIndex()) : DexFileReference(file, index.index_) {} dex::TypeIndex TypeIndex() const { diff --git a/runtime/verifier/method_verifier.cc b/runtime/verifier/method_verifier.cc index 0f6244e125..121f3cf364 100644 --- a/runtime/verifier/method_verifier.cc +++ b/runtime/verifier/method_verifier.cc @@ -1071,7 +1071,7 @@ bool MethodVerifier::ScanTryCatchBlocks() { for (uint32_t idx = 0; idx < handlers_size; idx++) { CatchHandlerIterator iterator(handlers_ptr); for (; iterator.HasNext(); iterator.Next()) { - uint32_t dex_pc= iterator.GetHandlerAddress(); + uint32_t dex_pc = iterator.GetHandlerAddress(); if (!GetInstructionFlags(dex_pc).IsOpcode()) { Fail(VERIFY_ERROR_BAD_CLASS_HARD) << "exception handler starts at bad address (" << dex_pc << ")"; diff --git a/runtime/verifier/reg_type_cache.h b/runtime/verifier/reg_type_cache.h index cb16b15054..d0907564e2 100644 --- a/runtime/verifier/reg_type_cache.h +++ b/runtime/verifier/reg_type_cache.h @@ -28,8 +28,8 @@ namespace art { namespace mirror { - class Class; - class ClassLoader; +class Class; +class ClassLoader; } // namespace mirror class ScopedArenaAllocator; class StringPiece; diff --git a/runtime/verify_object.h b/runtime/verify_object.h index e4c01d0f78..5c665b34c4 100644 --- a/runtime/verify_object.h +++ b/runtime/verify_object.h @@ -25,8 +25,8 @@ namespace art { namespace mirror { - class Class; - class Object; +class Class; +class Object; } // namespace mirror // How we want to sanity check the heap's correctness. |