1 //===- MultiFormatConfig.h --------------------------------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 #ifndef LLVM_TOOLS_LLVM_OBJCOPY_MULTIFORMATCONFIG_H 10 #define LLVM_TOOLS_LLVM_OBJCOPY_MULTIFORMATCONFIG_H 11 12 #include "llvm/Support/Error.h" 13 14 namespace llvm { 15 namespace objcopy { 16 17 struct CommonConfig; 18 struct ELFConfig; 19 struct COFFConfig; 20 struct MachOConfig; 21 struct WasmConfig; 22 23 class MultiFormatConfig { 24 public: ~MultiFormatConfig()25 virtual ~MultiFormatConfig() {} 26 27 virtual const CommonConfig &getCommonConfig() const = 0; 28 virtual Expected<const ELFConfig &> getELFConfig() const = 0; 29 virtual Expected<const COFFConfig &> getCOFFConfig() const = 0; 30 virtual Expected<const MachOConfig &> getMachOConfig() const = 0; 31 virtual Expected<const WasmConfig &> getWasmConfig() const = 0; 32 }; 33 34 } // namespace objcopy 35 } // namespace llvm 36 37 #endif // LLVM_TOOLS_LLVM_OBJCOPY_MULTIFORMATCONFIG_H 38