1 //===-- ARMAsmBackendDarwin.h ARM Asm Backend Darwin ----------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_LIB_TARGET_ARM_ARMASMBACKENDDARWIN_H
10 #define LLVM_LIB_TARGET_ARM_ARMASMBACKENDDARWIN_H
12 #include "ARMAsmBackend.h"
13 #include "llvm/BinaryFormat/MachO.h"
14 #include "llvm/MC/MCContext.h"
15 #include "llvm/MC/MCObjectWriter.h"
18 class ARMAsmBackendDarwin
: public ARMAsmBackend
{
19 const MCRegisterInfo
&MRI
;
22 const MachO::CPUSubTypeARM Subtype
;
23 ARMAsmBackendDarwin(const Target
&T
, const MCSubtargetInfo
&STI
,
24 const MCRegisterInfo
&MRI
)
25 : ARMAsmBackend(T
, STI
.getTargetTriple().isThumb(),
26 llvm::endianness::little
),
27 MRI(MRI
), TT(STI
.getTargetTriple()),
28 Subtype((MachO::CPUSubTypeARM
)cantFail(
29 MachO::getCPUSubType(STI
.getTargetTriple()))) {}
31 std::unique_ptr
<MCObjectTargetWriter
>
32 createObjectTargetWriter() const override
{
33 return createARMMachObjectWriter(
34 /*Is64Bit=*/false, cantFail(MachO::getCPUType(TT
)), Subtype
);
37 uint64_t generateCompactUnwindEncoding(const MCDwarfFrameInfo
*FI
,
38 const MCContext
*Ctxt
) const override
;
40 } // end namespace llvm