1 //===-- ARMAsmBackendDarwin.h   ARM Asm Backend Darwin ----------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_LIB_TARGET_ARM_ARMASMBACKENDDARWIN_H
11 #define LLVM_LIB_TARGET_ARM_ARMASMBACKENDDARWIN_H
12 
13 #include "llvm/Support/MachO.h"
14 
15 using namespace llvm;
16 
17 namespace {
18 class ARMAsmBackendDarwin : public ARMAsmBackend {
19   const MCRegisterInfo &MRI;
20 public:
21   const MachO::CPUSubTypeARM Subtype;
ARMAsmBackendDarwin(const Target & T,const Triple & TT,const MCRegisterInfo & MRI,MachO::CPUSubTypeARM st)22   ARMAsmBackendDarwin(const Target &T, const Triple &TT,
23                       const MCRegisterInfo &MRI, MachO::CPUSubTypeARM st)
24       : ARMAsmBackend(T, TT, /* IsLittleEndian */ true), MRI(MRI), Subtype(st) {
25     HasDataInCodeSupport = true;
26   }
27 
createObjectWriter(raw_pwrite_stream & OS)28   MCObjectWriter *createObjectWriter(raw_pwrite_stream &OS) const override {
29     return createARMMachObjectWriter(OS, /*Is64Bit=*/false, MachO::CPU_TYPE_ARM,
30                                      Subtype);
31   }
32 
33   uint32_t generateCompactUnwindEncoding(
34       ArrayRef<MCCFIInstruction> Instrs) const override;
35 };
36 }
37 
38 #endif
39