-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[CodeGen] Simplify code with *Map::operator[] (NFC) #112075
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CodeGen] Simplify code with *Map::operator[] (NFC) #112075
Conversation
@llvm/pr-subscribers-debuginfo @llvm/pr-subscribers-llvm-selectiondag Author: Kazu Hirata (kazutakahirata) ChangesFull diff: https://github.com/llvm/llvm-project/pull/112075.diff 2 Files Affected:
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 27931e118504b9..10736305762d21 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -630,8 +630,7 @@ static void finishCallSiteParams(ValT Val, const DIExpression *Expr,
static void addToFwdRegWorklist(FwdRegWorklist &Worklist, unsigned Reg,
const DIExpression *Expr,
ArrayRef<FwdRegParamInfo> ParamsToAdd) {
- auto I = Worklist.insert({Reg, {}});
- auto &ParamsForFwdReg = I.first->second;
+ auto &ParamsForFwdReg = Worklist[Reg];
for (auto Param : ParamsToAdd) {
assert(none_of(ParamsForFwdReg,
[Param](const FwdRegParamInfo &D) {
diff --git a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
index 6a6bc19314d5b6..374f23099a9080 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
@@ -120,8 +120,7 @@ void FunctionLoweringInfo::set(const Function &fn, MachineFunction &mf,
for (WinEHTryBlockMapEntry &TBME : EHInfo.TryBlockMap) {
for (WinEHHandlerType &H : TBME.HandlerArray) {
if (const AllocaInst *AI = H.CatchObj.Alloca)
- CatchObjects.insert({AI, {}}).first->second.push_back(
- &H.CatchObj.FrameIndex);
+ CatchObjects[AI].push_back(&H.CatchObj.FrameIndex);
else
H.CatchObj.FrameIndex = INT_MAX;
}
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/23/builds/3794 Here is the relevant piece of the build log for the reference
|
No description provided.