summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTWriter.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2015-03-27 00:55:05 +0000
committerChandler Carruth <chandlerc@gmail.com>2015-03-27 00:55:05 +0000
commit12c8f6540886bcf7d375f42c334f6034f56aa439 (patch)
treeee25e0df75e78d6f2bec8cf581e882071ba842cb /clang/lib/Serialization/ASTWriter.cpp
parentacbbeb9782445a9f02b8f38c49b49aba2fb525b8 (diff)
downloadbcm5719-llvm-12c8f6540886bcf7d375f42c334f6034f56aa439.tar.gz
bcm5719-llvm-12c8f6540886bcf7d375f42c334f6034f56aa439.zip
[Modules] Make Sema's map of referenced selectors have a deterministic
order based on order of insertion. This should cause both our warnings about these and the modules serialization to be deterministic as a consequence. Found by inspection. llvm-svn: 233343
Diffstat (limited to 'clang/lib/Serialization/ASTWriter.cpp')
-rw-r--r--clang/lib/Serialization/ASTWriter.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp
index e5891abb56a..eccff9d757e 100644
--- a/clang/lib/Serialization/ASTWriter.cpp
+++ b/clang/lib/Serialization/ASTWriter.cpp
@@ -3122,11 +3122,9 @@ void ASTWriter::WriteReferencedSelectorsPool(Sema &SemaRef) {
// Note: this writes out all references even for a dependent AST. But it is
// very tricky to fix, and given that @selector shouldn't really appear in
// headers, probably not worth it. It's not a correctness issue.
- for (DenseMap<Selector, SourceLocation>::iterator S =
- SemaRef.ReferencedSelectors.begin(),
- E = SemaRef.ReferencedSelectors.end(); S != E; ++S) {
- Selector Sel = (*S).first;
- SourceLocation Loc = (*S).second;
+ for (auto &SelectorAndLocation : SemaRef.ReferencedSelectors) {
+ Selector Sel = SelectorAndLocation.first;
+ SourceLocation Loc = SelectorAndLocation.second;
AddSelectorRef(Sel, Record);
AddSourceLocation(Loc, Record);
}
OpenPOWER on IntegriCloud