ARMAsmBackendDarwin.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //===-- ARMAsmBackendDarwin.h ARM Asm Backend Darwin ----------*- 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. #ifndef LLVM_LIB_TARGET_ARM_ARMASMBACKENDDARWIN_H
  9. #define LLVM_LIB_TARGET_ARM_ARMASMBACKENDDARWIN_H
  10. #include "ARMAsmBackend.h"
  11. #include "llvm/BinaryFormat/MachO.h"
  12. #include "llvm/MC/MCObjectWriter.h"
  13. namespace llvm {
  14. class ARMAsmBackendDarwin : public ARMAsmBackend {
  15. const MCRegisterInfo &MRI;
  16. Triple TT;
  17. public:
  18. const MachO::CPUSubTypeARM Subtype;
  19. ARMAsmBackendDarwin(const Target &T, const MCSubtargetInfo &STI,
  20. const MCRegisterInfo &MRI)
  21. : ARMAsmBackend(T, STI.getTargetTriple().isThumb(), support::little),
  22. MRI(MRI), TT(STI.getTargetTriple()),
  23. Subtype((MachO::CPUSubTypeARM)cantFail(
  24. MachO::getCPUSubType(STI.getTargetTriple()))) {}
  25. std::unique_ptr<MCObjectTargetWriter>
  26. createObjectTargetWriter() const override {
  27. return createARMMachObjectWriter(
  28. /*Is64Bit=*/false, cantFail(MachO::getCPUType(TT)), Subtype);
  29. }
  30. uint32_t generateCompactUnwindEncoding(
  31. ArrayRef<MCCFIInstruction> Instrs) const override;
  32. };
  33. } // end namespace llvm
  34. #endif