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
9#ifndef LLVM_LIB_TARGET_ARM_ARMASMBACKENDDARWIN_H
10#define LLVM_LIB_TARGET_ARM_ARMASMBACKENDDARWIN_H
11
12#include "ARMAsmBackend.h"
13#include "llvm/BinaryFormat/MachO.h"
14#include "llvm/MC/MCContext.h"
15#include "llvm/MC/MCObjectWriter.h"
16
17namespace llvm {
18class ARMAsmBackendDarwin : public ARMAsmBackend {
19 const MCRegisterInfo &MRI;
20 Triple TT;
21public:
22 const MachO::CPUSubTypeARM Subtype;
23 ARMAsmBackendDarwin(const Target &T, const MCSubtargetInfo &STI,
24 const MCRegisterInfo &MRI)
25 : ARMAsmBackend(T, llvm::endianness::little), MRI(MRI),
26 TT(STI.getTargetTriple()),
27 Subtype((MachO::CPUSubTypeARM)cantFail(
28 ValOrErr: MachO::getCPUSubType(T: STI.getTargetTriple()))) {}
29
30 std::unique_ptr<MCObjectTargetWriter>
31 createObjectTargetWriter() const override {
32 return createARMMachObjectWriter(
33 /*Is64Bit=*/Is64Bit: false, CPUType: cantFail(ValOrErr: MachO::getCPUType(T: TT)), CPUSubtype: Subtype);
34 }
35
36 uint64_t generateCompactUnwindEncoding(const MCDwarfFrameInfo *FI,
37 const MCContext *Ctxt) const override;
38};
39} // end namespace llvm
40
41#endif
42