Missing files for the BlockFrequency analysis added.
[oota-llvm.git] / 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   class MCSection;
24   class MCContext;
25   class MachineFunction;
26   class TargetMachine;
27   class TargetLoweringObjectFile;
28
29 class TargetAsmInfo {
30   unsigned PointerSize;
31   bool IsLittleEndian;
32   TargetFrameLowering::StackDirection StackDir;
33   const TargetRegisterInfo *TRI;
34   std::vector<MachineMove> InitialFrameState;
35   const TargetLoweringObjectFile *TLOF;
36
37 public:
38   explicit TargetAsmInfo(const TargetMachine &TM);
39
40   /// getPointerSize - Get the pointer size in bytes.
41   unsigned getPointerSize() const {
42     return PointerSize;
43   }
44
45   /// islittleendian - True if the target is little endian.
46   bool isLittleEndian() const {
47     return IsLittleEndian;
48   }
49
50   TargetFrameLowering::StackDirection getStackGrowthDirection() const {
51     return StackDir;
52   }
53
54   const MCSection *getDwarfLineSection() const {
55     return TLOF->getDwarfLineSection();
56   }
57
58   const MCSection *getEHFrameSection() const {
59     return TLOF->getEHFrameSection();
60   }
61
62   const MCSection *getCompactUnwindSection() const {
63     return TLOF->getCompactUnwindSection();
64   }
65
66   const MCSection *getDwarfFrameSection() const {
67     return TLOF->getDwarfFrameSection();
68   }
69
70   const MCSection *getWin64EHFuncTableSection(StringRef Suffix) const {
71     return TLOF->getWin64EHFuncTableSection(Suffix);
72   }
73
74   const MCSection *getWin64EHTableSection(StringRef Suffix) const {
75     return TLOF->getWin64EHTableSection(Suffix);
76   }
77
78   unsigned getFDEEncoding(bool CFI) const {
79     return TLOF->getFDEEncoding(CFI);
80   }
81
82   bool isFunctionEHFrameSymbolPrivate() const {
83     return TLOF->isFunctionEHFrameSymbolPrivate();
84   }
85
86   const unsigned *getCalleeSavedRegs(MachineFunction *MF = 0) const {
87     return TRI->getCalleeSavedRegs(MF);
88   }
89
90   unsigned getDwarfRARegNum(bool isEH) const {
91     return TRI->getDwarfRegNum(TRI->getRARegister(), isEH);
92   }
93
94   const std::vector<MachineMove> &getInitialFrameState() const {
95     return InitialFrameState;
96   }
97
98   int getDwarfRegNum(unsigned RegNum, bool isEH) const {
99     return TRI->getDwarfRegNum(RegNum, isEH);
100   }
101
102   int getLLVMRegNum(unsigned DwarfRegNum, bool isEH) const {
103     return TRI->getLLVMRegNum(DwarfRegNum, isEH);
104   }
105
106   int getSEHRegNum(unsigned RegNum) const {
107     return TRI->getSEHRegNum(RegNum);
108   }
109 };
110
111 }
112 #endif