summaryrefslogtreecommitdiff
path: root/dexlayout/dex_ir.h
diff options
context:
space:
mode:
Diffstat (limited to 'dexlayout/dex_ir.h')
-rw-r--r--dexlayout/dex_ir.h27
1 files changed, 24 insertions, 3 deletions
diff --git a/dexlayout/dex_ir.h b/dexlayout/dex_ir.h
index 96afb906c7..cad039550a 100644
--- a/dexlayout/dex_ir.h
+++ b/dexlayout/dex_ir.h
@@ -748,8 +748,7 @@ class ClassDef : public IndexedItem {
const TypeId* ClassType() const { return class_type_; }
uint32_t GetAccessFlags() const { return access_flags_; }
const TypeId* Superclass() const { return superclass_; }
- const TypeIdVector* Interfaces()
- { return interfaces_ == nullptr ? nullptr : interfaces_->GetTypeList(); }
+ const TypeList* Interfaces() { return interfaces_; }
uint32_t InterfacesOffset() { return interfaces_ == nullptr ? 0 : interfaces_->GetOffset(); }
const StringId* SourceFile() const { return source_file_; }
AnnotationsDirectoryItem* Annotations() const { return annotations_; }
@@ -781,7 +780,7 @@ class TypeAddrPair {
uint32_t GetAddress() const { return address_; }
private:
- const TypeId* type_id_;
+ const TypeId* type_id_; // This can be nullptr.
uint32_t address_;
DISALLOW_COPY_AND_ASSIGN(TypeAddrPair);
@@ -1105,6 +1104,28 @@ class MapItem : public Item {
DISALLOW_COPY_AND_ASSIGN(MapItem);
};
+// Interface for building a vector of file sections for use by other clients.
+struct DexFileSection {
+ public:
+ DexFileSection(const std::string& name, uint16_t type, uint32_t size, uint32_t offset)
+ : name(name), type(type), size(size), offset(offset) { }
+ std::string name;
+ // The type (DexFile::MapItemType).
+ uint16_t type;
+ // The size (in elements, not bytes).
+ uint32_t size;
+ // The byte offset from the start of the file.
+ uint32_t offset;
+};
+
+enum class SortDirection {
+ kSortAscending,
+ kSortDescending
+};
+
+std::vector<DexFileSection> GetSortedDexFileSections(dex_ir::Header* header,
+ SortDirection direction);
+
} // namespace dex_ir
} // namespace art