]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - contrib/llvm/include/llvm/Target/TargetAsmInfo.h
Copy head to stable/9 as part of 9.0-RELEASE release cycle.
[FreeBSD/stable/9.git] / contrib / llvm / include / llvm / Target / TargetAsmInfo.h
1 //===-- llvm/Target/TargetAsmInfo.h -----------------------------*- 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 // Interface to provide the information necessary for producing assembly files.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_TARGET_TARGETASMINFO_H
15 #define LLVM_TARGET_TARGETASMINFO_H
16
17 #include "llvm/CodeGen/MachineLocation.h"
18 #include "llvm/Target/TargetLoweringObjectFile.h"
19 #include "llvm/Target/TargetFrameLowering.h"
20 #include "llvm/Target/TargetRegisterInfo.h"
21
22 namespace llvm {
23   template <typename T> class ArrayRef;
24   class MCSection;
25   class MCContext;
26   class MachineFunction;
27   class TargetMachine;
28   class TargetLoweringObjectFile;
29
30 class TargetAsmInfo {
31   std::vector<MachineMove> InitialFrameState;
32   const TargetRegisterInfo *TRI;
33   const TargetFrameLowering *TFI;
34   const TargetLoweringObjectFile *TLOF;
35
36 public:
37   explicit TargetAsmInfo(const TargetMachine &TM);
38
39   const MCSection *getDwarfLineSection() const {
40     return TLOF->getDwarfLineSection();
41   }
42
43   const MCSection *getEHFrameSection() const {
44     return TLOF->getEHFrameSection();
45   }
46
47   const MCSection *getCompactUnwindSection() const {
48     return TLOF->getCompactUnwindSection();
49   }
50
51   const MCSection *getDwarfFrameSection() const {
52     return TLOF->getDwarfFrameSection();
53   }
54
55   const MCSection *getWin64EHFuncTableSection(StringRef Suffix) const {
56     return TLOF->getWin64EHFuncTableSection(Suffix);
57   }
58
59   const MCSection *getWin64EHTableSection(StringRef Suffix) const {
60     return TLOF->getWin64EHTableSection(Suffix);
61   }
62
63   unsigned getFDEEncoding(bool CFI) const {
64     return TLOF->getFDEEncoding(CFI);
65   }
66
67   bool isFunctionEHFrameSymbolPrivate() const {
68     return TLOF->isFunctionEHFrameSymbolPrivate();
69   }
70
71   int getCompactUnwindEncoding(ArrayRef<MCCFIInstruction> Instrs,
72                                int DataAlignmentFactor,
73                                bool IsEH) const {
74     return TFI->getCompactUnwindEncoding(Instrs, DataAlignmentFactor, IsEH);
75   }
76
77   const unsigned *getCalleeSavedRegs(MachineFunction *MF = 0) const {
78     return TRI->getCalleeSavedRegs(MF);
79   }
80
81   unsigned getDwarfRARegNum(bool isEH) const {
82     return TRI->getDwarfRegNum(TRI->getRARegister(), isEH);
83   }
84
85   const std::vector<MachineMove> &getInitialFrameState() const {
86     return InitialFrameState;
87   }
88
89   int getDwarfRegNum(unsigned RegNum, bool isEH) const {
90     return TRI->getDwarfRegNum(RegNum, isEH);
91   }
92
93   int getLLVMRegNum(unsigned DwarfRegNum, bool isEH) const {
94     return TRI->getLLVMRegNum(DwarfRegNum, isEH);
95   }
96
97   int getSEHRegNum(unsigned RegNum) const {
98     return TRI->getSEHRegNum(RegNum);
99   }
100 };
101
102 }
103 #endif