From: Rui Ueyama Date: Thu, 17 Nov 2016 19:57:43 +0000 (+0000) Subject: Use llvm::reverse to get a reverse range. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cd236a957735dd8004fde8925774d7f3c961e49d;p=platform%2Fupstream%2Fllvm.git Use llvm::reverse to get a reverse range. llvm-svn: 287252 --- diff --git a/lld/ELF/SymbolTable.cpp b/lld/ELF/SymbolTable.cpp index d7e7a94..f8b8a63 100644 --- a/lld/ELF/SymbolTable.cpp +++ b/lld/ELF/SymbolTable.cpp @@ -21,6 +21,7 @@ #include "Memory.h" #include "SymbolListFile.h" #include "Symbols.h" +#include "llvm/ADT/STLExtras.h" using namespace llvm; using namespace llvm::object; @@ -723,9 +724,9 @@ template void SymbolTable::scanVersionScript() { // we iterate over the definitions in the reverse order. for (SymbolVersion &Ver : Config->VersionScriptLocals) assignWildcardVersion(Ver, VER_NDX_LOCAL); - for (size_t I = Config->VersionDefinitions.size() - 1; I != (size_t)-1; --I) - for (SymbolVersion &Ver : Config->VersionDefinitions[I].Globals) - assignWildcardVersion(Ver, Config->VersionDefinitions[I].Id); + for (VersionDefinition &V : llvm::reverse(Config->VersionDefinitions)) + for (SymbolVersion &Ver : V.Globals) + assignWildcardVersion(Ver, V.Id); } template class elf::SymbolTable;