diff options
| author | David Blaikie <dblaikie@gmail.com> | 2014-12-22 21:26:38 +0000 | 
|---|---|---|
| committer | David Blaikie <dblaikie@gmail.com> | 2014-12-22 21:26:38 +0000 | 
| commit | 9a6f2836db75968682b3ed98bfe642000bcbd815 (patch) | |
| tree | fc1799eb3e60d9c47def7c3fe5486c99c0e7a3e0 | |
| parent | ba4e00f04a52a6d0aa019f82920a9ae7463e15b7 (diff) | |
| download | bcm5719-llvm-9a6f2836db75968682b3ed98bfe642000bcbd815.tar.gz bcm5719-llvm-9a6f2836db75968682b3ed98bfe642000bcbd815.zip  | |
Use iterators rather than indices to make this forwards-compatible with a change to the underlying container (to std::list)
llvm-svn: 224734
| -rw-r--r-- | llvm/utils/TableGen/AsmMatcherEmitter.cpp | 9 | 
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/utils/TableGen/AsmMatcherEmitter.cpp b/llvm/utils/TableGen/AsmMatcherEmitter.cpp index 095b51d1ee2..3663de77581 100644 --- a/llvm/utils/TableGen/AsmMatcherEmitter.cpp +++ b/llvm/utils/TableGen/AsmMatcherEmitter.cpp @@ -2606,10 +2606,11 @@ void AsmMatcherEmitter::run(raw_ostream &OS) {    // Check for ambiguous matchables.    DEBUG_WITH_TYPE("ambiguous_instrs", {      unsigned NumAmbiguous = 0; -    for (unsigned i = 0, e = Info.Matchables.size(); i != e; ++i) { -      for (unsigned j = i + 1; j != e; ++j) { -        const MatchableInfo &A = *Info.Matchables[i]; -        const MatchableInfo &B = *Info.Matchables[j]; +    for (auto I = Info.Matchables.begin(), E = Info.Matchables.end(); I != E; +         ++I) { +      for (auto J = std::next(I); J != E; ++J) { +        const MatchableInfo &A = **I; +        const MatchableInfo &B = **J;          if (A.couldMatchAmbiguouslyWith(B)) {            errs() << "warning: ambiguous matchables:\n";  | 

