[llvm] r335399 - [MSSA] Remove incorrect comment + `auto`ify dyn_cast results; NFC
George Burgess IV via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 22 15:34:07 PDT 2018
Author: gbiv
Date: Fri Jun 22 15:34:07 2018
New Revision: 335399
URL: http://llvm.org/viewvc/llvm-project?rev=335399&view=rev
Log:
[MSSA] Remove incorrect comment + `auto`ify dyn_cast results; NFC
Modified:
llvm/trunk/lib/Analysis/MemorySSA.cpp
Modified: llvm/trunk/lib/Analysis/MemorySSA.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemorySSA.cpp?rev=335399&r1=335398&r2=335399&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/MemorySSA.cpp (original)
+++ llvm/trunk/lib/Analysis/MemorySSA.cpp Fri Jun 22 15:34:07 2018
@@ -1573,19 +1573,18 @@ void MemorySSA::removeFromLookups(Memory
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);
More information about the llvm-commits
mailing list