[PATCH] D99055: [llvm-objcopy] Refactor CopyConfig structure.

Alexey Lapshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 2 06:20:56 PDT 2021


avl updated this revision to Diff 334944.
avl added a comment.

The one more argument for design presented by this patch is that: it is assumed that part of the interface
would be moved into the future ObjCopy library. The part which would be moved is quite small and clear.
Second part would be left in the llvm-objcopy tool. If we do not like its implementation(ParsedMultiFormatConfig)
we still might be able to reimplement llvm-objcopy part using another approach, but the library interface
will remain the same. Currently, indeed, we do not have many cross-format bugs. But, when this code
would be done as a library then it becomes more possibilities to do such cross-format bugs.
So, it is generally helpful if the interface of the library would prevent cross-format bugs.
I refactored this patch so that it would be more clear which part is supposed to go into the library
and which part is supposed to be left inside llvm-objcopy:

library part:

CopyConfigBase.h
CopyConfigELF.h
CopyConfigCOFF.h
CopyConfigMachO.h
CopyConfigWasm.h
MultiFormatCopyConfig.h

llvm-objcopy tool part:

ParsedConfig.cpp


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99055

Files:
  llvm/tools/llvm-objcopy/CMakeLists.txt
  llvm/tools/llvm-objcopy/COFF/COFFObjcopy.cpp
  llvm/tools/llvm-objcopy/COFF/COFFObjcopy.h
  llvm/tools/llvm-objcopy/COFF/CopyConfigCOFF.h
  llvm/tools/llvm-objcopy/CopyConfig.cpp
  llvm/tools/llvm-objcopy/CopyConfig.h
  llvm/tools/llvm-objcopy/CopyConfigBase.h
  llvm/tools/llvm-objcopy/ELF/CopyConfigELF.h
  llvm/tools/llvm-objcopy/ELF/ELFConfig.cpp
  llvm/tools/llvm-objcopy/ELF/ELFConfig.h
  llvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp
  llvm/tools/llvm-objcopy/ELF/ELFObjcopy.h
  llvm/tools/llvm-objcopy/ELF/Object.h
  llvm/tools/llvm-objcopy/MachO/CopyConfigMachO.h
  llvm/tools/llvm-objcopy/MachO/MachOObjcopy.cpp
  llvm/tools/llvm-objcopy/MachO/MachOObjcopy.h
  llvm/tools/llvm-objcopy/MultiFormatCopyConfig.h
  llvm/tools/llvm-objcopy/ParsedConfig.cpp
  llvm/tools/llvm-objcopy/ParsedConfig.h
  llvm/tools/llvm-objcopy/llvm-objcopy.cpp
  llvm/tools/llvm-objcopy/llvm-objcopy.h
  llvm/tools/llvm-objcopy/wasm/CopyConfigWasm.h
  llvm/tools/llvm-objcopy/wasm/WasmObjcopy.cpp
  llvm/tools/llvm-objcopy/wasm/WasmObjcopy.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99055.334944.patch
Type: text/x-patch
Size: 71369 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210402/28f73a57/attachment-0001.bin>


More information about the llvm-commits mailing list