Skip to content

Commit 176ab5e

Browse files
committed
[llvm-lto2] Simplify SymbolResolutions loop and avoid expensive std::string copy. NFC
1 parent 8cf0f9a commit 176ab5e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

llvm/tools/llvm-lto2/llvm-lto2.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,9 @@ static int run(int argc, char **argv) {
251251
// resolutions and apply them in the order observed.
252252
std::map<std::pair<std::string, std::string>, std::list<SymbolResolution>>
253253
CommandLineResolutions;
254-
for (std::string R : SymbolResolutions) {
255-
StringRef Rest = R;
256-
StringRef FileName, SymbolName;
257-
std::tie(FileName, Rest) = Rest.split(',');
254+
for (StringRef R : SymbolResolutions) {
255+
StringRef Rest, FileName, SymbolName;
256+
std::tie(FileName, Rest) = R.split(',');
258257
if (Rest.empty()) {
259258
llvm::errs() << "invalid resolution: " << R << '\n';
260259
return 1;

0 commit comments

Comments
 (0)