diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2015-03-27 00:55:05 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2015-03-27 00:55:05 +0000 |
commit | 12c8f6540886bcf7d375f42c334f6034f56aa439 (patch) | |
tree | ee25e0df75e78d6f2bec8cf581e882071ba842cb /clang/lib/Serialization/ASTWriter.cpp | |
parent | acbbeb9782445a9f02b8f38c49b49aba2fb525b8 (diff) | |
download | bcm5719-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.cpp | 8 |
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); } |