[PATCH] D101332: [llvm-objcopy] Keep ihex sections with same address

Eugene Leviant via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 10 04:19:36 PDT 2021


evgeny777 added inline comments.


================
Comment at: llvm/tools/llvm-objcopy/ELF/Object.h:371
 
-class IHexWriter : public Writer {
-  struct SectionCompare {
-    bool operator()(const SectionBase *Lhs, const SectionBase *Rhs) const;
-  };
+namespace internal {
+struct SectionCompare {
----------------
mciantyre wrote:
> jhenderson wrote:
> > Any particular reason you've wrapped this function in a distinct namespace?
> The comparator was previously private to the `Segment` class. Now that it's shared with the `IHexWriter`, I wanted a way to signal "this is an implementation detail" to those who include this header. I usually use `namespace details` for this, but `namespace internal` had more occurrences throughout the LLVM code base.
You can use anonymous namespace here. Both classes are in the same TU, so no need for SectionCompare to have external visibility.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101332



More information about the llvm-commits mailing list