本文整理汇总了C++中PassManager::get_current_pass_info方法的典型用法代码示例。如果您正苦于以下问题:C++ PassManager::get_current_pass_info方法的具体用法?C++ PassManager::get_current_pass_info怎么用?C++ PassManager::get_current_pass_info使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PassManager
的用法示例。
在下文中一共展示了PassManager::get_current_pass_info方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: run_pass
void RemoveUnreachablePass::run_pass(DexStoresVector& stores,
ConfigFiles& conf,
PassManager& pm) {
// Store names of removed classes and methods
ConcurrentSet<std::string> removed_symbols;
if (pm.no_proguard_rules()) {
TRACE(RMU,
1,
"RemoveUnreachablePass not run because no "
"ProGuard configuration was provided.");
return;
}
bool output_unreachable_symbols = pm.get_current_pass_info()->repeat == 0 &&
!m_unreachable_symbols_file_name.empty();
int num_ignore_check_strings = 0;
auto reachables = reachability::compute_reachable_objects(
stores, m_ignore_sets, &num_ignore_check_strings);
reachability::ObjectCounts before = reachability::count_objects(stores);
TRACE(RMU, 1, "before: %lu classes, %lu fields, %lu methods\n",
before.num_classes, before.num_fields, before.num_methods);
reachability::sweep(stores, *reachables,
output_unreachable_symbols ? &removed_symbols : nullptr);
reachability::ObjectCounts after = reachability::count_objects(stores);
TRACE(RMU, 1, "after: %lu classes, %lu fields, %lu methods\n",
after.num_classes, after.num_fields, after.num_methods);
pm.incr_metric("num_ignore_check_strings", num_ignore_check_strings);
pm.incr_metric("classes_removed", before.num_classes - after.num_classes);
pm.incr_metric("fields_removed", before.num_fields - after.num_fields);
pm.incr_metric("methods_removed", before.num_methods - after.num_methods);
if (output_unreachable_symbols) {
std::string filepath = conf.metafile(m_unreachable_symbols_file_name);
write_out_removed_symbols(filepath, removed_symbols);
}
}