Refactor DecodeDebugLocalInfo
Refactor the function to use a visitor instead of callback.
Test: test-art-ghost
Bug: 112311591
Bug: 77709234
Change-Id: I55385994952373b3fec4f9122400cf3c9d43da3b
diff --git a/libdexfile/dex/code_item_accessors-inl.h b/libdexfile/dex/code_item_accessors-inl.h
index c7e876e..bbf2224 100644
--- a/libdexfile/dex/code_item_accessors-inl.h
+++ b/libdexfile/dex/code_item_accessors-inl.h
@@ -184,19 +184,18 @@
CodeItemDataAccessor::Init(code_item);
}
-template<typename NewLocalCallback>
-inline bool CodeItemDebugInfoAccessor::DecodeDebugLocalInfo(bool is_static,
- uint32_t method_idx,
- NewLocalCallback new_local,
- void* context) const {
+template<typename NewLocalVisitor>
+inline bool CodeItemDebugInfoAccessor::DecodeDebugLocalInfo(
+ bool is_static,
+ uint32_t method_idx,
+ const NewLocalVisitor& new_local) const {
return dex_file_->DecodeDebugLocalInfo(RegistersSize(),
InsSize(),
InsnsSizeInCodeUnits(),
DebugInfoOffset(),
is_static,
method_idx,
- new_local,
- context);
+ new_local);
}
template <typename Visitor>