Skip to content

Commit 06d0141

Browse files
Address a comment.
1 parent ab71070 commit 06d0141

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -491,16 +491,16 @@ static Value *getAddrSizeInt(Module *M, uint64_t C) {
491491
Function *
492492
WebAssemblyLowerEmscriptenEHSjLj::getFindMatchingCatch(Module &M,
493493
unsigned NumClauses) {
494-
if (auto It = FindMatchingCatches.find(NumClauses);
495-
It != FindMatchingCatches.end())
494+
auto [It, Inserted] = FindMatchingCatches.try_emplace(NumClauses);
495+
if (!Inserted)
496496
return It->second;
497497
PointerType *Int8PtrTy = PointerType::getUnqual(M.getContext());
498498
SmallVector<Type *, 16> Args(NumClauses, Int8PtrTy);
499499
FunctionType *FTy = FunctionType::get(Int8PtrTy, Args, false);
500500
Function *F = getFunction(
501501
FTy, "__cxa_find_matching_catch_" + Twine(NumClauses + 2), &M);
502502
markAsImported(F);
503-
FindMatchingCatches[NumClauses] = F;
503+
It->second = F;
504504
return F;
505505
}
506506

0 commit comments

Comments
 (0)