MachOConfig.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- MachOConfig.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_MACHO_MACHOCONFIG_H
  14. #define LLVM_OBJCOPY_MACHO_MACHOCONFIG_H
  15. #include "llvm/ADT/DenseMap.h"
  16. #include "llvm/ADT/DenseSet.h"
  17. #include "llvm/ADT/StringRef.h"
  18. #include <optional>
  19. #include <vector>
  20. namespace llvm {
  21. namespace objcopy {
  22. // Mach-O specific configuration for copying/stripping a single file.
  23. struct MachOConfig {
  24. // Repeated options
  25. std::vector<StringRef> RPathToAdd;
  26. std::vector<StringRef> RPathToPrepend;
  27. DenseMap<StringRef, StringRef> RPathsToUpdate;
  28. DenseMap<StringRef, StringRef> InstallNamesToUpdate;
  29. DenseSet<StringRef> RPathsToRemove;
  30. // install-name-tool's id option
  31. std::optional<StringRef> SharedLibId;
  32. // Segments to remove if they are empty
  33. DenseSet<StringRef> EmptySegmentsToRemove;
  34. // Boolean options
  35. bool StripSwiftSymbols = false;
  36. bool KeepUndefined = false;
  37. // install-name-tool's --delete_all_rpaths
  38. bool RemoveAllRpaths = false;
  39. };
  40. } // namespace objcopy
  41. } // namespace llvm
  42. #endif // LLVM_OBJCOPY_MACHO_MACHOCONFIG_H
  43. #ifdef __GNUC__
  44. #pragma GCC diagnostic pop
  45. #endif