diff options
author | Andreas Gampe <agampe@google.com> | 2019-01-03 16:08:31 -0800 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2019-01-03 16:09:07 -0800 |
commit | 62629598f845c2efec0dff652e440e8fbcce4b8a (patch) | |
tree | 7af96934e7ca5313787a9b328e85e6606645c4e5 | |
parent | d77abd9e128f60917f712b8da84bab46e3ed5870 (diff) | |
download | android_art-62629598f845c2efec0dff652e440e8fbcce4b8a.tar.gz android_art-62629598f845c2efec0dff652e440e8fbcce4b8a.tar.bz2 android_art-62629598f845c2efec0dff652e440e8fbcce4b8a.zip |
ART: Some more IWYU in common headers
Forward-declare a few structs and classes. Remove unused includes.
Bug: 119869270
Test: mmma art
Change-Id: I21215cee39269b373784d6a82577039322a4a950
-rw-r--r-- | libdexfile/dex/class_accessor-inl.h | 11 | ||||
-rw-r--r-- | libdexfile/dex/class_accessor.h | 21 | ||||
-rw-r--r-- | runtime/art_field-inl.h | 1 | ||||
-rw-r--r-- | runtime/art_method-inl.h | 1 | ||||
-rw-r--r-- | runtime/class_linker.h | 1 | ||||
-rw-r--r-- | runtime/interpreter/shadow_frame.h | 1 | ||||
-rw-r--r-- | runtime/mirror/class-inl.h | 1 | ||||
-rw-r--r-- | runtime/mirror/class.h | 8 |
8 files changed, 31 insertions, 14 deletions
diff --git a/libdexfile/dex/class_accessor-inl.h b/libdexfile/dex/class_accessor-inl.h index c9e5360f31..8562d0583c 100644 --- a/libdexfile/dex/class_accessor-inl.h +++ b/libdexfile/dex/class_accessor-inl.h @@ -24,6 +24,8 @@ #include "base/utils.h" #include "class_iterator.h" #include "code_item_accessors-inl.h" +#include "dex_file.h" +#include "method_reference.h" namespace art { @@ -71,6 +73,11 @@ inline void ClassAccessor::Method::Read() { } } +inline MethodReference ClassAccessor::Method::GetReference() const { + return MethodReference(&dex_file_, GetIndex()); +} + + inline void ClassAccessor::Field::Read() { index_ += DecodeUnsignedLeb128(&ptr_pos_); access_flags_ = DecodeUnsignedLeb128(&ptr_pos_); @@ -231,6 +238,10 @@ inline dex::TypeIndex ClassAccessor::GetClassIdx() const { return dex_file_.GetClassDef(class_def_index_).class_idx_; } +inline const dex::ClassDef& ClassAccessor::GetClassDef() const { + return dex_file_.GetClassDef(GetClassDefIndex()); +} + } // namespace art #endif // ART_LIBDEXFILE_DEX_CLASS_ACCESSOR_INL_H_ diff --git a/libdexfile/dex/class_accessor.h b/libdexfile/dex/class_accessor.h index cf6e5095d6..16282562cc 100644 --- a/libdexfile/dex/class_accessor.h +++ b/libdexfile/dex/class_accessor.h @@ -18,14 +18,21 @@ #define ART_LIBDEXFILE_DEX_CLASS_ACCESSOR_H_ #include "code_item_accessors.h" -#include "dex_file.h" +#include "dex_file_types.h" #include "invoke_type.h" -#include "method_reference.h" #include "modifiers.h" namespace art { +namespace dex { +struct ClassDef; +struct CodeItem; +} // namespace dex + class ClassIteratorData; +class DexFile; +template <typename Iter> class IterationRange; +class MethodReference; // Classes to access Dex data. class ClassAccessor { @@ -92,9 +99,7 @@ class ClassAccessor { : GetVirtualMethodInvokeType(class_access_flags); } - MethodReference GetReference() const { - return MethodReference(&dex_file_, GetIndex()); - } + MethodReference GetReference() const; CodeItemInstructionAccessor GetInstructions() const; CodeItemDataAccessor GetInstructionsAndData() const; @@ -273,7 +278,7 @@ class ClassAccessor { ClassAccessor(const DexFile& dex_file, const uint8_t* class_data, - uint32_t class_def_index = DexFile::kDexNoIndex32, + uint32_t class_def_index = dex::kDexNoIndex, bool parse_hiddenapi_class_data = false); // Return the code item for a method. @@ -361,9 +366,7 @@ class ClassAccessor { return class_def_index_; } - const dex::ClassDef& GetClassDef() const { - return dex_file_.GetClassDef(GetClassDefIndex()); - } + const dex::ClassDef& GetClassDef() const; protected: // Template visitor to reduce copy paste for visiting elements. diff --git a/runtime/art_field-inl.h b/runtime/art_field-inl.h index fb4141886a..6f976d1c16 100644 --- a/runtime/art_field-inl.h +++ b/runtime/art_field-inl.h @@ -29,7 +29,6 @@ #include "jvalue.h" #include "mirror/dex_cache-inl.h" #include "mirror/object-inl.h" -#include "scoped_thread_state_change-inl.h" #include "thread-current-inl.h" namespace art { diff --git a/runtime/art_method-inl.h b/runtime/art_method-inl.h index 02196baebd..e28ffa2122 100644 --- a/runtime/art_method-inl.h +++ b/runtime/art_method-inl.h @@ -43,7 +43,6 @@ #include "quick/quick_method_frame_info.h" #include "read_barrier-inl.h" #include "runtime-inl.h" -#include "scoped_thread_state_change-inl.h" #include "thread-current-inl.h" namespace art { diff --git a/runtime/class_linker.h b/runtime/class_linker.h index fa5df441c7..b9ac9caf0c 100644 --- a/runtime/class_linker.h +++ b/runtime/class_linker.h @@ -40,6 +40,7 @@ namespace art { namespace dex { struct ClassDef; +struct MethodHandleItem; } // namespace dex namespace gc { diff --git a/runtime/interpreter/shadow_frame.h b/runtime/interpreter/shadow_frame.h index ca98999acd..3f6b729644 100644 --- a/runtime/interpreter/shadow_frame.h +++ b/runtime/interpreter/shadow_frame.h @@ -23,7 +23,6 @@ #include "base/locks.h" #include "base/macros.h" -#include "dex/dex_file.h" #include "lock_count_data.h" #include "read_barrier.h" #include "stack_reference.h" diff --git a/runtime/mirror/class-inl.h b/runtime/mirror/class-inl.h index 0f19bac526..40c7d30707 100644 --- a/runtime/mirror/class-inl.h +++ b/runtime/mirror/class-inl.h @@ -32,6 +32,7 @@ #include "dex/invoke_type.h" #include "dex_cache.h" #include "iftable.h" +#include "imtable.h" #include "object-inl.h" #include "object_array.h" #include "read_barrier-inl.h" diff --git a/runtime/mirror/class.h b/runtime/mirror/class.h index 5682def4c4..f7a41f7f56 100644 --- a/runtime/mirror/class.h +++ b/runtime/mirror/class.h @@ -23,12 +23,10 @@ #include "base/stride_iterator.h" #include "class_flags.h" #include "class_status.h" -#include "dex/dex_file_structs.h" #include "dex/dex_file_types.h" #include "dex/modifiers.h" #include "dex/primitive.h" #include "gc/allocator_type.h" -#include "imtable.h" #include "object.h" #include "object_array.h" #include "read_barrier_option.h" @@ -36,11 +34,17 @@ namespace art { +namespace dex { +struct ClassDef; +class TypeList; +} // namespace dex + class ArtField; class ArtMethod; struct ClassOffsets; class DexFile; template<class T> class Handle; +class ImTable; enum InvokeType : uint32_t; template <typename Iter> class IterationRange; template<typename T> class LengthPrefixedArray; |