message: Correctly resolve method for result removal
  Summary: Look for which method is actually called, not referenced, when marking which results are used.
diff: #include "OptData.h"
  #include "OptDataDefs.h"
  #include "PassManager.h"
  +#include "Resolver.h"
  #include "Show.h"
  #include "Walkers.h"
  @@ -81,8 +82,8 @@ RemoveArgs::PassStats RemoveArgs::run(ConfigFiles& config) {
  * move-result instructions, and record this information for each method.
  */
  void RemoveArgs::gather_results_used() {
  - walk::parallel::code(
  - m_scope, [&result_used = m_result_used](DexMethod*, IRCode& code) {
  + walk::parallel::code(m_scope, [&result_used = m_result_used](DexMethod*,
  + IRCode& code) {
  always_assert(code.editable_cfg_built());
  auto& cfg = code.cfg();
  auto ii = InstructionIterable(cfg);
  @@ -95,7 +96,8 @@ void RemoveArgs::gather_results_used() {
  if (move_result.is_end()) {
  continue;
  }
  - auto method = insn->get_method()->as_def();
  + auto method =
  + resolve_method(insn->get_method(), opcode_to_search(insn->opcode()));
  if (!method) {
  // TODO: T31388603 -- Remove unused results for true virtuals.
  continue;
  @@ -411,13 +413,20 @@ bool RemoveArgs::update_method_signature(
  }
  DexMethodSpec spec(nullptr, name, updated_proto);
  +
  + std::string tmp;
  + if (traceEnabled(ARGS, 3)) {
  + tmp = show(method);
  + }
  +
  method->change(spec, true /* rename on collision */);
  // We make virtual method names unique via $rvp / $uva name mangling; check
  // that this worked:
  always_assert(!method->is_virtual() || method->get_name() == name);
  - TRACE(ARGS, 3, "Method signature updated to %s", SHOW(method));
  + TRACE(ARGS, 3, "Method signature %s updated to %s", tmp.c_str(),
  + SHOW(method));
  log_opt(METHOD_PARAMS_REMOVED, method);
  return true;
  }
  