Skip to content

Commit af8cab8

Browse files
author
git apple-llvm automerger
committed
Merge commit 'b11e1baf22a4' from llvm.org/main into next
2 parents e63483e + b11e1ba commit af8cab8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

llvm/tools/llvm-readtapi/llvm-readtapi.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,17 +358,19 @@ static void stubifyDirectory(const StringRef InputPath, Context &Ctx) {
358358
SmallString<PATH_MAX> NormalizedPath(Path);
359359
replace_extension(NormalizedPath, "");
360360

361+
auto [It, Inserted] = Dylibs.try_emplace(NormalizedPath.str());
362+
361363
if ((IF->getFileType() == FileType::MachO_DynamicLibrary) ||
362364
(IF->getFileType() == FileType::MachO_DynamicLibrary_Stub)) {
363365
OriginalNames[NormalizedPath.c_str()] = IF->getPath();
364366

365367
// Don't add this MachO dynamic library because we already have a
366368
// text-based stub recorded for this path.
367-
if (Dylibs.count(NormalizedPath.c_str()))
369+
if (!Inserted)
368370
continue;
369371
}
370372

371-
Dylibs[NormalizedPath.c_str()] = std::move(IF);
373+
It->second = std::move(IF);
372374
}
373375

374376
for (auto &Lib : Dylibs) {

0 commit comments

Comments
 (0)