MultiFormatConfig.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- MultiFormatConfig.h --------------------------------------*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #ifndef LLVM_OBJCOPY_MULTIFORMATCONFIG_H
  14. #define LLVM_OBJCOPY_MULTIFORMATCONFIG_H
  15. #include "llvm/Support/Error.h"
  16. namespace llvm {
  17. namespace objcopy {
  18. struct CommonConfig;
  19. struct ELFConfig;
  20. struct COFFConfig;
  21. struct MachOConfig;
  22. struct WasmConfig;
  23. struct XCOFFConfig;
  24. class MultiFormatConfig {
  25. public:
  26. virtual ~MultiFormatConfig() {}
  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. virtual Expected<const XCOFFConfig &> getXCOFFConfig() const = 0;
  33. };
  34. } // namespace objcopy
  35. } // namespace llvm
  36. #endif // LLVM_OBJCOPY_MULTIFORMATCONFIG_H
  37. #ifdef __GNUC__
  38. #pragma GCC diagnostic pop
  39. #endif