Skip to content

Commit

Permalink
[llvm-lto2] Simplify SymbolResolutions loop and avoid expensive std::…
Browse files Browse the repository at this point in the history
…string copy. NFC
  • Loading branch information
MaskRay committed Apr 26, 2024
1 parent 8cf0f9a commit 176ab5e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions llvm/tools/llvm-lto2/llvm-lto2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,9 @@ static int run(int argc, char **argv) {
// resolutions and apply them in the order observed.
std::map<std::pair<std::string, std::string>, std::list<SymbolResolution>>
CommandLineResolutions;
for (std::string R : SymbolResolutions) {
StringRef Rest = R;
StringRef FileName, SymbolName;
std::tie(FileName, Rest) = Rest.split(',');
for (StringRef R : SymbolResolutions) {
StringRef Rest, FileName, SymbolName;
std::tie(FileName, Rest) = R.split(',');
if (Rest.empty()) {
llvm::errs() << "invalid resolution: " << R << '\n';
return 1;
Expand Down

0 comments on commit 176ab5e

Please sign in to comment.