[llvm] r257114 - [LiveDebugValues] Replace several lines of code with operator[].

Alexey Samsonov via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 7 15:38:46 PST 2016


Author: samsonov
Date: Thu Jan  7 17:38:45 2016
New Revision: 257114

URL: http://llvm.org/viewvc/llvm-project?rev=257114&view=rev
Log:
[LiveDebugValues] Replace several lines of code with operator[].

Modified:
    llvm/trunk/lib/CodeGen/LiveDebugValues.cpp

Modified: llvm/trunk/lib/CodeGen/LiveDebugValues.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveDebugValues.cpp?rev=257114&r1=257113&r2=257114&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LiveDebugValues.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveDebugValues.cpp Thu Jan  7 17:38:45 2016
@@ -235,14 +235,7 @@ void LiveDebugValues::transferTerminator
   if (OpenRanges.empty())
     return;
 
-  if (OutLocs.find(CurMBB) == OutLocs.end()) {
-    // Create space for new Outgoing locs entries.
-    VarLocList VLL;
-    OutLocs.insert(std::make_pair(CurMBB, std::move(VLL)));
-  }
-  auto OL = OutLocs.find(CurMBB);
-  assert(OL != OutLocs.end());
-  VarLocList &VLL = OL->second;
+  VarLocList &VLL = OutLocs[CurMBB];
 
   for (auto OR : OpenRanges) {
     // Copy OpenRanges to OutLocs, if not already present.
@@ -305,14 +298,7 @@ void LiveDebugValues::join(MachineBasicB
   if (InLocsT.empty())
     return;
 
-  if (InLocs.find(&MBB) == InLocs.end()) {
-    // Create space for new Incoming locs entries.
-    VarLocList VLL;
-    InLocs.insert(std::make_pair(&MBB, std::move(VLL)));
-  }
-  auto IL = InLocs.find(&MBB);
-  assert(IL != InLocs.end());
-  VarLocList &ILL = IL->second;
+  VarLocList &ILL = InLocs[&MBB];
 
   // Insert DBG_VALUE instructions, if not already inserted.
   for (auto ILT : InLocsT) {




More information about the llvm-commits mailing list