We have a similar logic for LLVM/GNU styles that can be deduplicated.
This will allow to replace reportError calls with reportUniqueWarning
calls in a single place.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
Looks okay. I'm not a massive fan of having three lambdas though, and I wonder whether they'd be better off as virtual functions, at least to some extent, of the dump style classes (probably only for the ProcessNote one though, I accept).
llvm/tools/llvm-readobj/ELFDumper.cpp | ||
---|---|---|
5562 | This line gives a warning with clang's "range-loop analysis" diagnostic: error: loop variable 'Note' is always a copy because the range of type 'iterator_range<llvm::object::ELFFile<llvm::object::ELFType<llvm::support::big, true> >::Elf_Note_Iterator>' (aka 'iterator_range<Elf_Note_Iterator_Impl<ELFType<(llvm::support::endianness)0U, true> > >') does not return a reference [-Werror,-Wrange-loop-analysis] for (const typename ELFT::Note &Note : Obj.notes(S, Err)) It can be fixed by removing the ampersand. |
llvm/tools/llvm-readobj/ELFDumper.cpp | ||
---|---|---|
5562 | Fixed in rGc3673ea65df576535c85397dfe36624bd09fe47b, thanks! |
This line gives a warning with clang's "range-loop analysis" diagnostic:
It can be fixed by removing the ampersand.