本文整理汇总了C++中TypeSystem::find_interface_scope方法的典型用法代码示例。如果您正苦于以下问题:C++ TypeSystem::find_interface_scope方法的具体用法?C++ TypeSystem::find_interface_scope怎么用?C++ TypeSystem::find_interface_scope使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TypeSystem
的用法示例。
在下文中一共展示了TypeSystem::find_interface_scope方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: remove_leaf_interfaces
TypeSet RemoveInterfacePass::remove_leaf_interfaces(
const Scope& scope,
const DexType* root,
const TypeSet& interfaces,
const TypeSystem& type_system) {
TypeSet leaf_interfaces;
for (const auto intf : interfaces) {
if (is_leaf(type_system, intf)) {
leaf_interfaces.insert(intf);
}
}
std::unordered_map<DexMethod*, DexMethod*> intf_meth_to_dispatch;
for (const auto intf : leaf_interfaces) {
TRACE(RM_INTF, 5, "Found leaf interface %s\n", SHOW(intf));
auto implementors = type_system.get_implementors(intf);
auto intf_methods = type_class(intf)->get_vmethods();
for (const auto meth : intf_methods) {
TRACE(RM_INTF, 5, "Finding virt scope for %s\n", SHOW(meth));
auto intf_scope = type_system.find_interface_scope(meth);
MethodOrderedSet found_targets =
find_dispatch_targets(type_system, intf_scope, implementors);
std::vector<DexMethod*> dispatch_targets(found_targets.begin(),
found_targets.end());
auto replacement_type = get_replacement_type(type_system, intf, root);
auto dispatch =
generate_dispatch(replacement_type, dispatch_targets, meth,
m_keep_debug_info, m_interface_dispatch_anno);
m_dispatch_stats[dispatch_targets.size()]++;
intf_meth_to_dispatch[meth] = dispatch;
}
}
update_interface_calls(scope, intf_meth_to_dispatch);
remove_inheritance(scope, type_system, leaf_interfaces);
m_num_interface_removed += leaf_interfaces.size();
return leaf_interfaces;
}