llvm.org GIT mirror llvm / e38e995
Support: Stop relying on iterator auto-conversion, NFC Stop relying on ilist implicit conversions from `value_type&` to `iterator` in YAMLParser.cpp. I eventually want to outlaw this entirely. It encourages `getNextNode()` and `getPrevNode()` in iterator logic, which is extremely fragile (and relies on them never returning `nullptr`). FTR, there's nothing nefarious going on in this case, it was just easy to clean up since the callers really wanted iterators to begin with. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249767 91177308-0d34-0410-b5e6-96231b3b80d8 Duncan P. N. Exon Smith 4 years ago
1 changed file(s) with 6 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
800800
801801 removeStaleSimpleKeyCandidates();
802802 SimpleKey SK;
803 SK.Tok = TokenQueue.front();
803 SK.Tok = TokenQueue.begin();
804804 if (std::find(SimpleKeys.begin(), SimpleKeys.end(), SK)
805805 == SimpleKeys.end())
806806 break;
11621162 TokenQueue.push_back(T);
11631163
11641164 // [ and { may begin a simple key.
1165 saveSimpleKeyCandidate(TokenQueue.back(), Column - 1, false);
1165 saveSimpleKeyCandidate(--TokenQueue.end(), Column - 1, false);
11661166
11671167 // And may also be followed by a simple key.
11681168 IsSimpleKeyAllowed = true;
13251325 T.Range = StringRef(Start, Current - Start);
13261326 TokenQueue.push_back(T);
13271327
1328 saveSimpleKeyCandidate(TokenQueue.back(), ColStart, false);
1328 saveSimpleKeyCandidate(--TokenQueue.end(), ColStart, false);
13291329
13301330 IsSimpleKeyAllowed = false;
13311331
14031403 TokenQueue.push_back(T);
14041404
14051405 // Plain scalars can be simple keys.
1406 saveSimpleKeyCandidate(TokenQueue.back(), ColStart, false);
1406 saveSimpleKeyCandidate(--TokenQueue.end(), ColStart, false);
14071407
14081408 IsSimpleKeyAllowed = false;
14091409
14381438 TokenQueue.push_back(T);
14391439
14401440 // Alias and anchors can be simple keys.
1441 saveSimpleKeyCandidate(TokenQueue.back(), ColStart, false);
1441 saveSimpleKeyCandidate(--TokenQueue.end(), ColStart, false);
14421442
14431443 IsSimpleKeyAllowed = false;
14441444
16681668 TokenQueue.push_back(T);
16691669
16701670 // Tags can be simple keys.
1671 saveSimpleKeyCandidate(TokenQueue.back(), ColStart, false);
1671 saveSimpleKeyCandidate(--TokenQueue.end(), ColStart, false);
16721672
16731673 IsSimpleKeyAllowed = false;
16741674