From: George Burgess IV Date: Fri, 22 Jun 2018 22:34:07 +0000 (+0000) Subject: [MSSA] Remove incorrect comment + `auto`ify dyn_cast results; NFC X-Git-Tag: android-x86-8.1-r1~1726 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=78cd292954dd1b32f0cc60c4c0035eade4a546fc;p=android-x86%2Fexternal-llvm.git [MSSA] Remove incorrect comment + `auto`ify dyn_cast results; NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335399 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/MemorySSA.cpp b/lib/Analysis/MemorySSA.cpp index 1a0103dd363..0177f591ded 100644 --- a/lib/Analysis/MemorySSA.cpp +++ b/lib/Analysis/MemorySSA.cpp @@ -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(MA)) + if (auto *MUD = dyn_cast(MA)) MUD->setDefiningAccess(nullptr); // Invalidate our walker's cache if necessary if (!isa(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(MA)) { + if (const auto *MUD = dyn_cast(MA)) MemoryInst = MUD->getMemoryInst(); - } else { + else MemoryInst = MA->getBlock(); - } + auto VMA = ValueToMemoryAccess.find(MemoryInst); if (VMA->second == MA) ValueToMemoryAccess.erase(VMA);