[lld] r287252 - Use llvm::reverse to get a reverse range.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 17 11:57:43 PST 2016
Author: ruiu
Date: Thu Nov 17 13:57:43 2016
New Revision: 287252
URL: http://llvm.org/viewvc/llvm-project?rev=287252&view=rev
Log:
Use llvm::reverse to get a reverse range.
Modified:
lld/trunk/ELF/SymbolTable.cpp
Modified: lld/trunk/ELF/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolTable.cpp?rev=287252&r1=287251&r2=287252&view=diff
==============================================================================
--- lld/trunk/ELF/SymbolTable.cpp (original)
+++ lld/trunk/ELF/SymbolTable.cpp Thu Nov 17 13:57:43 2016
@@ -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 <class ELFT> void SymbolTable<E
// 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<ELF32LE>;
More information about the llvm-commits
mailing list