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
Loading
Please sign in to comment