[llvm-jitlink] Avoid repeated hash lookups (NFC) (#130465)
This commit is contained in:
@@ -72,14 +72,15 @@ Error registerMachOGraphInfo(Session &S, LinkGraph &G) {
|
||||
std::lock_guard<std::mutex> Lock(S.M);
|
||||
|
||||
auto FileName = sys::path::filename(G.getName());
|
||||
if (S.FileInfos.count(FileName)) {
|
||||
auto [It, Inserted] = S.FileInfos.try_emplace(FileName);
|
||||
if (!Inserted) {
|
||||
return make_error<StringError>("When -check is passed, file names must be "
|
||||
"distinct (duplicate: \"" +
|
||||
FileName + "\")",
|
||||
inconvertibleErrorCode());
|
||||
}
|
||||
|
||||
auto &FileInfo = S.FileInfos[FileName];
|
||||
auto &FileInfo = It->second;
|
||||
LLVM_DEBUG({
|
||||
dbgs() << "Registering MachO file info for \"" << FileName << "\"\n";
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user