[PATCH] D67139: [llvm-objcopy] Refactor ELF-specific config out to ELFCopyConfig. NFC.
Seiya Nuta via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 15 18:07:28 PDT 2019
seiya added a comment.
In D67139#1670164 <https://reviews.llvm.org/D67139#1670164>, @jakehehrlich wrote:
> What about having ELFcopyConfig inherit from CopyConfig?
How about this design? I believe moving the CopyConfig is not a big cost.
/// Parses CopyConfig and creates a ELFCopyConfig, or returns Error on parse errors.
class ELFCopyConfigBuilder {
CopyConfig Common;
public:
ELFCopyConfig(CopyConfig&& Common) : Common(std::move(Common)){};
Expected<ELFCopyConfig> build();
}
class ELFCopyConfig : public ELFConfig {
public:
Optional<uint8_t> NewSymbolVisibility;
std::vector<NewSymbolInfo> SymbolsToAdd;
ELFCopyConfig(CopyConfig&& Common, Optional<uint8_t> NewSymbolVisibility, /* ... */)
: CopyConfig(std::move(Common)), NewSymbolVisibility(NewSymbolVisibility) /* ... */ {}
};
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D67139/new/
https://reviews.llvm.org/D67139
More information about the llvm-commits
mailing list