[PATCH] D21894: [ELF] - Fixed incorrect logic of version assignments when mixing wildcards with values matching.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 1 03:48:16 PDT 2016


grimar added inline comments.

================
Comment at: ELF/SymbolTable.cpp:628
@@ +627,3 @@
+
+  for (Version &V : Reverse(Config->SymbolVersions))
+    for (VersionSymbol &Sym : V.Globals)
----------------
ruiu wrote:
> grimar wrote:
> > ruiu wrote:
> > > `Reverse` is overkill. You can just iterate in the reverse order by this.
> > > 
> > >   for (size_t I = Config->SymbolVersions.size() - 1; I != 0; --I) {
> > >     VersionSymbol &Sym = Config->SymbolVersions[I];
> > >     ...
> > >   }
> > Sure I can :) That just looks a bit different from loop above making me think it do something special, when it is not.
> > Will fix.
> I'd rewrite the above for-loop with an explicit index as well because `&V - Config->SymbolVersions.data()` is not intuitive.
ok


http://reviews.llvm.org/D21894





More information about the llvm-commits mailing list