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/Sema/SemaDeclObjC.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/Sema/SemaDeclObjC.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDeclObjC.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp index 33d9e95f27f..4865b08ddfd 100644 --- a/clang/lib/Sema/SemaDeclObjC.cpp +++ b/clang/lib/Sema/SemaDeclObjC.cpp @@ -3490,12 +3490,11 @@ void Sema::DiagnoseUseOfUnimplementedSelectors() { if (ReferencedSelectors.empty() || !Context.AnyObjCImplementation()) return; - for (llvm::DenseMap<Selector, SourceLocation>::iterator S = - ReferencedSelectors.begin(), - E = ReferencedSelectors.end(); S != E; ++S) { - Selector Sel = (*S).first; + for (auto &SelectorAndLocation : ReferencedSelectors) { + Selector Sel = SelectorAndLocation.first; + SourceLocation Loc = SelectorAndLocation.second; if (!LookupImplementedMethodInGlobalPool(Sel)) - Diag((*S).second, diag::warn_unimplemented_selector) << Sel; + Diag(Loc, diag::warn_unimplemented_selector) << Sel; } return; } |