diff options
author | 2023-04-04 10:44:14 +0000 | |
---|---|---|
committer | 2023-04-12 08:56:51 +0000 | |
commit | b4231ccc73b820d4db493f03eb27af36caa7ae8f (patch) | |
tree | 16c4e5d4cf132b80069f0932023a4f528c35401a | |
parent | 88834c9f588c3c8b30eb471c841f3737f100b2e1 (diff) |
Fix "readability-duplicate-includes" clang-tidy issues
Bug: 264654008
Test: m tidy-art
Change-Id: If78a443de6f8413fb0a7f71a9a2834b095833f56
-rw-r--r-- | build/Android.bp | 1 | ||||
-rw-r--r-- | dex2oat/linker/elf_writer_test.cc | 2 | ||||
-rw-r--r-- | libartbase/base/utils.cc | 3 | ||||
-rw-r--r-- | openjdkjvmti/events.cc | 15 | ||||
-rw-r--r-- | openjdkjvmti/events.h | 4 | ||||
-rw-r--r-- | openjdkjvmti/ti_stack.cc | 8 | ||||
-rw-r--r-- | openjdkjvmti/transform.cc | 7 | ||||
-rw-r--r-- | runtime/gc/collector/partial_mark_sweep.cc | 1 | ||||
-rw-r--r-- | runtime/gc/space/region_space-inl.h | 2 | ||||
-rw-r--r-- | runtime/native_stack_dump.cc | 1 |
10 files changed, 18 insertions, 26 deletions
diff --git a/build/Android.bp b/build/Android.bp index dd9be5c559..77f7313fc4 100644 --- a/build/Android.bp +++ b/build/Android.bp @@ -48,6 +48,7 @@ art_clang_tidy_errors = [ "performance-noexcept-move-constructor", "performance-unnecessary-copy-initialization", "performance-unnecessary-value-param", + "readability-duplicate-include", "readability-redundant-string-cstr", ] diff --git a/dex2oat/linker/elf_writer_test.cc b/dex2oat/linker/elf_writer_test.cc index c1ff8f2988..6fa5f6602d 100644 --- a/dex2oat/linker/elf_writer_test.cc +++ b/dex2oat/linker/elf_writer_test.cc @@ -16,8 +16,6 @@ #include <sys/mman.h> // For the PROT_NONE constant. -#include "elf_file.h" - #include "base/file_utils.h" #include "base/mem_map.h" #include "base/unix_file/fd_file.h" diff --git a/libartbase/base/utils.cc b/libartbase/base/utils.cc index bff9f4550b..e114e4dbac 100644 --- a/libartbase/base/utils.cc +++ b/libartbase/base/utils.cc @@ -37,6 +37,7 @@ #if defined(__APPLE__) #include <crt_externs.h> +// NOLINTNEXTLINE - inclusion of syscall is dependent on arch #include <sys/syscall.h> #include "AvailabilityMacros.h" // For MAC_OS_X_VERSION_MAX_ALLOWED #endif @@ -44,11 +45,13 @@ #if defined(__BIONIC__) // membarrier(2) is only supported for target builds (b/111199492). #include <linux/membarrier.h> +// NOLINTNEXTLINE - inclusion of syscall is dependent on arch #include <sys/syscall.h> #endif #if defined(__linux__) #include <linux/unistd.h> +// NOLINTNEXTLINE - inclusion of syscall is dependent on arch #include <sys/syscall.h> #endif diff --git a/openjdkjvmti/events.cc b/openjdkjvmti/events.cc index 8f54003156..64da6ed3f6 100644 --- a/openjdkjvmti/events.cc +++ b/openjdkjvmti/events.cc @@ -29,25 +29,24 @@ * questions. */ -#include <android-base/thread_annotations.h> +#include "events.h" -#include "alloc_manager.h" -#include "base/locks.h" -#include "base/mutex.h" -#include "events-inl.h" +#include <sys/time.h> #include <array> #include <functional> -#include <sys/time.h> +#include "alloc_manager.h" +#include "android-base/thread_annotations.h" #include "arch/context.h" #include "art_field-inl.h" #include "art_jvmti.h" #include "art_method-inl.h" +#include "base/locks.h" #include "base/mutex.h" #include "deopt_manager.h" #include "dex/dex_file_types.h" -#include "events.h" +#include "events-inl.h" #include "gc/allocation_listener.h" #include "gc/gc_pause_listener.h" #include "gc/heap.h" @@ -71,8 +70,8 @@ #include "scoped_thread_state_change-inl.h" #include "scoped_thread_state_change.h" #include "stack.h" -#include "thread.h" #include "thread-inl.h" +#include "thread.h" #include "thread_list.h" #include "ti_phase.h" #include "ti_thread.h" diff --git a/openjdkjvmti/events.h b/openjdkjvmti/events.h index be0839bdc5..7420296a15 100644 --- a/openjdkjvmti/events.h +++ b/openjdkjvmti/events.h @@ -21,9 +21,7 @@ #include <unordered_map> #include <vector> -#include <android-base/logging.h> -#include <android-base/thread_annotations.h> - +#include "android-base/logging.h" #include "android-base/thread_annotations.h" #include "base/macros.h" #include "base/mutex.h" diff --git a/openjdkjvmti/ti_stack.cc b/openjdkjvmti/ti_stack.cc index c3aab4c213..8ee4adb853 100644 --- a/openjdkjvmti/ti_stack.cc +++ b/openjdkjvmti/ti_stack.cc @@ -41,7 +41,6 @@ #include "android-base/thread_annotations.h" #include "arch/context.h" #include "art_field-inl.h" -#include "art_method-inl.h" #include "art_jvmti.h" #include "art_method-inl.h" #include "barrier.h" @@ -74,13 +73,12 @@ #include "scoped_thread_state_change-inl.h" #include "scoped_thread_state_change.h" #include "stack.h" -#include "thread.h" -#include "thread_state.h" -#include "ti_logging.h" -#include "ti_thread.h" #include "thread-current-inl.h" +#include "thread.h" #include "thread_list.h" #include "thread_pool.h" +#include "thread_state.h" +#include "ti_logging.h" #include "ti_thread.h" #include "well_known_classes-inl.h" diff --git a/openjdkjvmti/transform.cc b/openjdkjvmti/transform.cc index 1f36da435a..bccdcb18af 100644 --- a/openjdkjvmti/transform.cc +++ b/openjdkjvmti/transform.cc @@ -29,14 +29,14 @@ * questions. */ +#include "transform.h" + #include <stddef.h> #include <sys/types.h> #include <unordered_map> #include <unordered_set> -#include "transform.h" - #include "art_method.h" #include "base/array_ref.h" #include "base/globals.h" @@ -64,9 +64,8 @@ #include "scoped_thread_state_change-inl.h" #include "stack.h" #include "thread_list.h" -#include "ti_redefine.h" #include "ti_logging.h" -#include "transform.h" +#include "ti_redefine.h" namespace openjdkjvmti { diff --git a/runtime/gc/collector/partial_mark_sweep.cc b/runtime/gc/collector/partial_mark_sweep.cc index f6ca867e69..e283a9583a 100644 --- a/runtime/gc/collector/partial_mark_sweep.cc +++ b/runtime/gc/collector/partial_mark_sweep.cc @@ -18,7 +18,6 @@ #include "gc/heap.h" #include "gc/space/space.h" -#include "partial_mark_sweep.h" #include "thread-current-inl.h" namespace art { diff --git a/runtime/gc/space/region_space-inl.h b/runtime/gc/space/region_space-inl.h index 901568e546..1026f42c27 100644 --- a/runtime/gc/space/region_space-inl.h +++ b/runtime/gc/space/region_space-inl.h @@ -17,8 +17,6 @@ #ifndef ART_RUNTIME_GC_SPACE_REGION_SPACE_INL_H_ #define ART_RUNTIME_GC_SPACE_REGION_SPACE_INL_H_ -#include "region_space.h" - #include "base/mutex-inl.h" #include "mirror/object-inl.h" #include "region_space.h" diff --git a/runtime/native_stack_dump.cc b/runtime/native_stack_dump.cc index d35188d048..d6a0fae02f 100644 --- a/runtime/native_stack_dump.cc +++ b/runtime/native_stack_dump.cc @@ -29,7 +29,6 @@ #if defined(__linux__) -#include <memory> #include <vector> #include <linux/unistd.h> |