ExportInfo* Binary::add_exported_function(uint64_t address, const std::string& name) {
  if (Symbol* symbol = add_local_symbol(address, name)) {
    if (DyldExportsTrie* exports = dyld_exports_trie()) {
      auto export_info = std::make_unique<ExportInfo>(address, 0);
      export_info->symbol_ = symbol;
      export_info->address(address);
      symbol->export_info_ = export_info.get();

      auto* info = export_info.get();
      exports->add(std::move(export_info));
      return info;
    }

    if (DyldInfo* info = dyld_info()) {
      auto export_info = std::make_unique<ExportInfo>(address, 0);
      export_info->symbol_ = symbol;
      export_info->address(address);
      symbol->export_info_ = export_info.get();

      auto* info_ptr = export_info.get();
      info->add(std::move(export_info));
      return info_ptr;
    }
  }
  return nullptr;
}
ExportInfo* Binary::add_exported_function(uint64_t address, const std::string& name) {
  if (Symbol* symbol = add_local_symbol(address, name)) {
    if (DyldExportsTrie* exports = dyld_exports_trie()) {
      auto export_info = std::make_unique<ExportInfo>(address, 0);
      export_info->symbol_ = symbol;
      export_info->address(address);
      symbol->export_info_ = export_info.get();

      auto* info = export_info.get();
      exports->add(std::move(export_info));
      return info;
    }

    if (DyldInfo* info = dyld_info()) {
      auto export_info = std::make_unique<ExportInfo>(address, 0);
      export_info->symbol_ = symbol;
      export_info->address(address);
      symbol->export_info_ = export_info.get();

      auto* info_ptr = export_info.get();
      info->add(std::move(export_info));
      return info_ptr;
    }
  }
  return nullptr;
}