Skip to content

Commit a62768c

Browse files
[CodeGen] Simplify code with *Map::operator[] (NFC) (#112075)
1 parent 79d695f commit a62768c

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -630,8 +630,7 @@ static void finishCallSiteParams(ValT Val, const DIExpression *Expr,
630630
static void addToFwdRegWorklist(FwdRegWorklist &Worklist, unsigned Reg,
631631
const DIExpression *Expr,
632632
ArrayRef<FwdRegParamInfo> ParamsToAdd) {
633-
auto I = Worklist.insert({Reg, {}});
634-
auto &ParamsForFwdReg = I.first->second;
633+
auto &ParamsForFwdReg = Worklist[Reg];
635634
for (auto Param : ParamsToAdd) {
636635
assert(none_of(ParamsForFwdReg,
637636
[Param](const FwdRegParamInfo &D) {

llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,7 @@ void FunctionLoweringInfo::set(const Function &fn, MachineFunction &mf,
120120
for (WinEHTryBlockMapEntry &TBME : EHInfo.TryBlockMap) {
121121
for (WinEHHandlerType &H : TBME.HandlerArray) {
122122
if (const AllocaInst *AI = H.CatchObj.Alloca)
123-
CatchObjects.insert({AI, {}}).first->second.push_back(
124-
&H.CatchObj.FrameIndex);
123+
CatchObjects[AI].push_back(&H.CatchObj.FrameIndex);
125124
else
126125
H.CatchObj.FrameIndex = INT_MAX;
127126
}

0 commit comments

Comments
 (0)