diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2015-02-06 17:25:10 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2015-02-06 17:25:10 +0000 |
commit | b4ef66832dee03a992c0424c4c6aa115bdefdbb6 (patch) | |
tree | 9e9f696f3c0cfc35a8ede24006cd10a29b482ea4 /clang/tools/libclang | |
parent | 808141c2af4ba3de2e1d2df946eab36a317bb611 (diff) | |
download | bcm5719-llvm-b4ef66832dee03a992c0424c4c6aa115bdefdbb6.tar.gz bcm5719-llvm-b4ef66832dee03a992c0424c4c6aa115bdefdbb6.zip |
Update APIs that return a pair of iterators to return an iterator_range instead.
Convert uses of those APIs into ranged for loops. NFC.
llvm-svn: 228404
Diffstat (limited to 'clang/tools/libclang')
-rw-r--r-- | clang/tools/libclang/CIndex.cpp | 5 | ||||
-rw-r--r-- | clang/tools/libclang/Indexing.cpp | 7 |
2 files changed, 3 insertions, 9 deletions
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp index b8e44a2124c..6c603afb5c1 100644 --- a/clang/tools/libclang/CIndex.cpp +++ b/clang/tools/libclang/CIndex.cpp @@ -240,9 +240,8 @@ static bool visitPreprocessedEntitiesInRange(SourceRange R, FID = FileID(); } - std::pair<PreprocessingRecord::iterator, PreprocessingRecord::iterator> - Entities = PPRec.getPreprocessedEntitiesInRange(R); - return Visitor.visitPreprocessedEntities(Entities.first, Entities.second, + const auto &Entities = PPRec.getPreprocessedEntitiesInRange(R); + return Visitor.visitPreprocessedEntities(Entities.begin(), Entities.end(), PPRec, FID); } diff --git a/clang/tools/libclang/Indexing.cpp b/clang/tools/libclang/Indexing.cpp index 20f4474a1ee..20df33e8420 100644 --- a/clang/tools/libclang/Indexing.cpp +++ b/clang/tools/libclang/Indexing.cpp @@ -697,13 +697,8 @@ static void indexPreprocessingRecord(ASTUnit &Unit, IndexingContext &IdxCtx) { // FIXME: Only deserialize inclusion directives. - PreprocessingRecord::iterator I, E; - std::tie(I, E) = Unit.getLocalPreprocessingEntities(); - bool isModuleFile = Unit.isModuleFile(); - for (; I != E; ++I) { - PreprocessedEntity *PPE = *I; - + for (PreprocessedEntity *PPE : Unit.getLocalPreprocessingEntities()) { if (InclusionDirective *ID = dyn_cast<InclusionDirective>(PPE)) { SourceLocation Loc = ID->getSourceRange().getBegin(); // Modules have synthetic main files as input, give an invalid location |