[all-commits] [llvm/llvm-project] c25938: Refactor CommandObjectTargetSymbolsAdd::AddModuleS...

amccarth-google via All-commits all-commits at lists.llvm.org
Mon Feb 3 14:22:22 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: c25938d57b1cf9534887313405bc409e570a9b69
      https://github.com/llvm/llvm-project/commit/c25938d57b1cf9534887313405bc409e570a9b69
  Author: Adrian McCarthy <amccarth at google.com>
  Date:   2020-02-03 (Mon, 03 Feb 2020)

  Changed paths:
    M lldb/source/Commands/CommandObjectTarget.cpp

  Log Message:
  -----------
  Refactor CommandObjectTargetSymbolsAdd::AddModuleSymbols

* [NFC] Renamed local `matching_module_list` to `matching_modules` for
conciseness.

* [NFC] Eliminated redundant local variable `num_matches` to reduce the risk
that changes get it out of sync with `matching_modules.GetSize()`.

* Used an early return from case where the symbol file specified matches
multiple modules.  This is a slight behavior change, but it's an improvement:
It didn't make sense to tell the user that the symbol file simultaneously
matched multiple modules and no modules.

* [NFC] Used an early return from the case where no matches are found, to
better align with LLVM coding style.

* [NFC] Simplified call of `AppendWarningWithFormat("%s", stuff)` to
`AppendWarning(stuff)`.  I don't think this adds any copies.  It does
construct a StringRef, but it was going to have to scan the string for the
length anyway.

* [NFC] Removed unnecessary comments and reworded others for clarity.

* Used an early return if the symbol file could not be loaded.  This is a
behavior change because previously it could fail silently.

* Used an early return if the object file could not be retrieved from the
symbol file.  Again, this is a change because now there's an error message.

* [NFC] Eliminated a namespace alias that wasn't particularly helpful.

Differential Revision: https://reviews.llvm.org/D73594


  Commit: 0e362d82b97fe16b5671ceeb2f3e5b6f4ccf00dd
      https://github.com/llvm/llvm-project/commit/0e362d82b97fe16b5671ceeb2f3e5b6f4ccf00dd
  Author: Adrian McCarthy <amccarth at google.com>
  Date:   2020-02-03 (Mon, 03 Feb 2020)

  Changed paths:
    M lldb/source/Commands/CommandObjectTarget.cpp

  Log Message:
  -----------
  Improve help text for (lldb) target symbols add

There were some missing words and awkward syntax.  I think this is clearer.

Differential Revision: https://reviews.llvm.org/D73589


Compare: https://github.com/llvm/llvm-project/compare/9831e5c7b9fa...0e362d82b97f


More information about the All-commits mailing list