OSDN Git Service

[MSSA] Remove incorrect comment + `auto`ify dyn_cast results; NFC
authorGeorge Burgess IV <george.burgess.iv@gmail.com>
Fri, 22 Jun 2018 22:34:07 +0000 (22:34 +0000)
committerGeorge Burgess IV <george.burgess.iv@gmail.com>
Fri, 22 Jun 2018 22:34:07 +0000 (22:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335399 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/MemorySSA.cpp

index 1a0103d..0177f59 100644 (file)
@@ -1573,19 +1573,18 @@ void MemorySSA::removeFromLookups(MemoryAccess *MA) {
   assert(MA->use_empty() &&
          "Trying to remove memory access that still has uses");
   BlockNumbering.erase(MA);
-  if (MemoryUseOrDef *MUD = dyn_cast<MemoryUseOrDef>(MA))
+  if (auto *MUD = dyn_cast<MemoryUseOrDef>(MA))
     MUD->setDefiningAccess(nullptr);
   // Invalidate our walker's cache if necessary
   if (!isa<MemoryUse>(MA))
     Walker->invalidateInfo(MA);
-  // The call below to erase will destroy MA, so we can't change the order we
-  // are doing things here
+
   Value *MemoryInst;
-  if (MemoryUseOrDef *MUD = dyn_cast<MemoryUseOrDef>(MA)) {
+  if (const auto *MUD = dyn_cast<MemoryUseOrDef>(MA))
     MemoryInst = MUD->getMemoryInst();
-  } else {
+  else
     MemoryInst = MA->getBlock();
-  }
+
   auto VMA = ValueToMemoryAccess.find(MemoryInst);
   if (VMA->second == MA)
     ValueToMemoryAccess.erase(VMA);