summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2015-10-17 00:08:48 +0000
committerMatthias Braun <matze@braunis.de>2015-10-17 00:08:48 +0000
commit96e411b90c5896119e3479b25dba939e799773d9 (patch)
treea3e00b7690c8fd84f6caa17d6b8d113fc48467cf /llvm/lib
parent7f47272cda6456a48a48150241672ab8931769ce (diff)
downloadbcm5719-llvm-96e411b90c5896119e3479b25dba939e799773d9.tar.gz
bcm5719-llvm-96e411b90c5896119e3479b25dba939e799773d9.zip
RegisterPressure: Hide non-const iterators of PressureDiff
It is too easy to accidentally violate the ordering requirements when modifying the PressureDiff entries through iterators. llvm-svn: 250590
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/RegisterPressure.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/RegisterPressure.cpp b/llvm/lib/CodeGen/RegisterPressure.cpp
index 87c3d46866e..88566d88732 100644
--- a/llvm/lib/CodeGen/RegisterPressure.cpp
+++ b/llvm/lib/CodeGen/RegisterPressure.cpp
@@ -389,7 +389,7 @@ void PressureDiff::addPressureChange(unsigned RegUnit, bool IsDec,
int Weight = IsDec ? -PSetI.getWeight() : PSetI.getWeight();
for (; PSetI.isValid(); ++PSetI) {
// Find an existing entry in the pressure diff for this PSet.
- PressureDiff::iterator I = begin(), E = end();
+ PressureDiff::iterator I = nonconst_begin(), E = nonconst_end();
for (; I != E && I->isValid(); ++I) {
if (I->getPSet() >= *PSetI)
break;
OpenPOWER on IntegriCloud