From 1179bdf300258d4e6eb90b23aeeae89950d922c5 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Wed, 2 Nov 2022 14:29:14 -0700 Subject: [PATCH] WebAssembly: Remove unnecessary set check The empty set will be default constructed if this wasn't in the map already. --- llvm/include/llvm/CodeGen/WasmEHFuncInfo.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/llvm/include/llvm/CodeGen/WasmEHFuncInfo.h b/llvm/include/llvm/CodeGen/WasmEHFuncInfo.h index 8b55a45..60ee649 100644 --- a/llvm/include/llvm/CodeGen/WasmEHFuncInfo.h +++ b/llvm/include/llvm/CodeGen/WasmEHFuncInfo.h @@ -50,8 +50,6 @@ struct WasmEHFuncInfo { } void setUnwindDest(const BasicBlock *BB, const BasicBlock *Dest) { SrcToUnwindDest[BB] = Dest; - if (!UnwindDestToSrcs.count(Dest)) - UnwindDestToSrcs[Dest] = SmallPtrSet(); UnwindDestToSrcs[Dest].insert(BB); } bool hasUnwindDest(const BasicBlock *BB) const { @@ -76,8 +74,6 @@ struct WasmEHFuncInfo { } void setUnwindDest(MachineBasicBlock *MBB, MachineBasicBlock *Dest) { SrcToUnwindDest[MBB] = Dest; - if (!UnwindDestToSrcs.count(Dest)) - UnwindDestToSrcs[Dest] = SmallPtrSet(); UnwindDestToSrcs[Dest].insert(MBB); } bool hasUnwindDest(MachineBasicBlock *MBB) const { -- 2.7.4