ObjCopy.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- ObjCopy.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_OBJCOPY_H
  14. #define LLVM_OBJCOPY_OBJCOPY_H
  15. #include "llvm/Support/Error.h"
  16. namespace llvm {
  17. class raw_ostream;
  18. namespace object {
  19. class Archive;
  20. class Binary;
  21. } // end namespace object
  22. namespace objcopy {
  23. class MultiFormatConfig;
  24. /// Applies the transformations described by \p Config to
  25. /// each member in archive \p Ar.
  26. /// Writes a result in a file specified by \p Config.OutputFilename.
  27. /// \returns any Error encountered whilst performing the operation.
  28. Error executeObjcopyOnArchive(const MultiFormatConfig &Config,
  29. const object::Archive &Ar);
  30. /// Applies the transformations described by \p Config to \p In and writes
  31. /// the result into \p Out. This function does the dispatch based on the
  32. /// format of the input binary (COFF, ELF, MachO or wasm).
  33. /// \returns any Error encountered whilst performing the operation.
  34. Error executeObjcopyOnBinary(const MultiFormatConfig &Config,
  35. object::Binary &In, raw_ostream &Out);
  36. } // end namespace objcopy
  37. } // end namespace llvm
  38. #endif // LLVM_OBJCOPY_OBJCOPY_H
  39. #ifdef __GNUC__
  40. #pragma GCC diagnostic pop
  41. #endif