当前位置: 首页>>代码示例>>C++>>正文


C++ PassManager::get_current_pass_info方法代码示例

本文整理汇总了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);
  }
}
开发者ID:facebook,项目名称:redex,代码行数:36,代码来源:RemoveUnreachable.cpp


注:本文中的PassManager::get_current_pass_info方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。