Skip to content

Commit

Permalink
[llvm-jitlink] Avoid some SymbolStringPtr copies.
Browse files Browse the repository at this point in the history
  • Loading branch information
lhames committed Dec 15, 2024
1 parent 8345a95 commit 646ad49
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions llvm/tools/llvm-jitlink/llvm-jitlink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -740,8 +740,7 @@ getTestObjectFileInterface(Session &S, MemoryBufferRef O) {
!(*SymFlagsOrErr & object::BasicSymbolRef::SF_Global))
continue;

auto InternedName = S.ES.intern(*Name);
I->SymbolFlags[InternedName] = std::move(*SymFlags);
I->SymbolFlags[S.ES.intern(*Name)] = std::move(*SymFlags);
}

return I;
Expand Down Expand Up @@ -1711,8 +1710,8 @@ static Error addAbsoluteSymbols(Session &S,
return Err;

// Register the absolute symbol with the session symbol infos.
S.SymbolInfos[InternedName] = {ArrayRef<char>(), Addr,
AbsDef.getFlags().getTargetFlags()};
S.SymbolInfos[std::move(InternedName)] =
{ArrayRef<char>(), Addr, AbsDef.getFlags().getTargetFlags()};
}

return Error::success();
Expand Down

0 comments on commit 646ad49

Please sign in to comment.