本文整理汇总了C++中PassManager::get_config方法的典型用法代码示例。如果您正苦于以下问题:C++ PassManager::get_config方法的具体用法?C++ PassManager::get_config怎么用?C++ PassManager::get_config使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PassManager
的用法示例。
在下文中一共展示了PassManager::get_config方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: run_pass
//.........这里部分代码省略.........
while (cls != nullptr) {
if (this_escapes.find(cls) != this_escapes.end()) {
hierarchy_has_escape = true;
break;
}
cls = type_class(cls)->get_super_class();
}
if (!hierarchy_has_escape) {
no_escapes.emplace(builder);
}
}
size_t dmethod_count = 0;
size_t vmethod_count = 0;
size_t build_count = 0;
for (DexType* builder : no_escapes) {
auto cls = type_class(builder);
auto buildee = get_buildee(builder);
dmethod_count += cls->get_dmethods().size();
vmethod_count += cls->get_vmethods().size();
for (DexMethod* m : cls->get_vmethods()) {
if (m->get_proto()->get_rtype() == buildee) {
build_count++;
}
}
}
std::unordered_set<DexClass*> trivial_builders =
get_trivial_builders(m_builders, no_escapes);
std::unordered_set<DexClass*> kept_builders =
get_builders_with_subclasses(scope);
PassConfig pc(mgr.get_config());
BuilderTransform b_transform(pc, scope, stores, false);
// Inline non init methods.
std::unordered_set<DexClass*> removed_builders;
walk::methods(scope, [&](DexMethod* method) {
auto builders = created_builders(method);
for (DexType* builder : builders) {
if (method->get_class() == builder) {
continue;
}
DexClass* builder_cls = type_class(builder);
// Filter out builders that we cannot remove.
if (kept_builders.find(builder_cls) != kept_builders.end()) {
continue;
}
// Check it is a trivial one.
if (trivial_builders.find(builder_cls) != trivial_builders.end()) {
DexMethod* method_copy = DexMethod::make_method_from(
method,
method->get_class(),
DexString::make_string(method->get_name()->str() +
"$redex_builders"));
bool was_not_removed =
!b_transform.inline_methods(
method, builder, &get_non_init_methods) ||
!remove_builder_from(method, builder_cls, b_transform);