[PATCH] D67039: [ELF] Add a spell corrector for "undefined symbol" diagnostics

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 3 02:46:09 PDT 2019


grimar added inline comments.


================
Comment at: ELF/Relocations.cpp:823
+  size_t i = 0;
+  for (const UndefinedDiag &undef : undefs)
+    if (!undef.locs.empty()) {
----------------
grimar wrote:
> MaskRay wrote:
> > grimar wrote:
> > > It feels `for` would look a bit better?
> > > 
> > > ```
> > > for (size_t I = 0; I<undefs.size(); ++I)
> > >   if (!undefs[I].locs.empty())
> > >     reportUndefinedSymbol<ELFT>(undefs[I], i < 2);
> > > ```
> > I'll use
> > 
> > `for (auto it : enumerate(undefs))`
> > 
> I am not sure `enumerate` is better (it is not consistent and this approach uses `auto`), I'll leave it to others.
(not consistent with the LLD code I meant. Which doesn't use it anywhere, preferring 'for')


Repository:
  rLLD LLVM Linker

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67039/new/

https://reviews.llvm.org/D67039





More information about the llvm-commits mailing list