[polly] r329639 - [ScopInfo] Actually remove from list.
Michael Kruse via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 9 16:13:01 PDT 2018
Author: meinersbur
Date: Mon Apr 9 16:13:01 2018
New Revision: 329639
URL: http://llvm.org/viewvc/llvm-project?rev=329639&view=rev
Log:
[ScopInfo] Actually remove from list.
std::remove, despite its name, does not remove elements from a list, but
only moves them to the end of a list. Call erase() to shorten the
vector to the remaining elements.
Test case included in next commit.
Modified:
polly/trunk/lib/Analysis/ScopInfo.cpp
Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=329639&r1=329638&r2=329639&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Mon Apr 9 16:13:01 2018
@@ -4856,13 +4856,15 @@ void Scop::removeAccessData(MemoryAccess
ValueDefAccs.erase(Access->getAccessValue());
} else if (Access->isOriginalValueKind() && Access->isRead()) {
auto &Uses = ValueUseAccs[Access->getScopArrayInfo()];
- std::remove(Uses.begin(), Uses.end(), Access);
+ auto NewEnd = std::remove(Uses.begin(), Uses.end(), Access);
+ Uses.erase(NewEnd, Uses.end());
} else if (Access->isOriginalPHIKind() && Access->isRead()) {
PHINode *PHI = cast<PHINode>(Access->getAccessInstruction());
PHIReadAccs.erase(PHI);
} else if (Access->isOriginalAnyPHIKind() && Access->isWrite()) {
auto &Incomings = PHIIncomingAccs[Access->getScopArrayInfo()];
- std::remove(Incomings.begin(), Incomings.end(), Access);
+ auto NewEnd = std::remove(Incomings.begin(), Incomings.end(), Access);
+ Incomings.erase(NewEnd, Incomings.end());
}
}
More information about the llvm-commits
mailing list