96d3fb6da5aeb3d3acd16b5ddbbb65be78c1ca9a
[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 TargetMachine;
26   class TargetLoweringObjectFile;
27
28 class TargetAsmInfo {
29   unsigned PointerSize;
30   bool IsLittleEndian;
31   TargetFrameLowering::StackDirection StackDir;
32   const TargetRegisterInfo *TRI;
33   std::vector<MachineMove> InitialFrameState;
34   const TargetLoweringObjectFile *TLOF;
35
36 public:
37   explicit TargetAsmInfo(const TargetMachine &TM);
38
39   /// getPointerSize - Get the pointer size in bytes.
40   unsigned getPointerSize() const {
41     return PointerSize;
42   }
43
44   /// islittleendian - True if the target is little endian.
45   bool isLittleEndian() const {
46     return IsLittleEndian;
47   }
48
49   TargetFrameLowering::StackDirection getStackGrowthDirection() const {
50     return StackDir;
51   }
52
53   const MCSection *getDwarfLineSection() const {
54     return TLOF->getDwarfLineSection();
55   }
56
57   const MCSection *getEHFrameSection() const {
58     return TLOF->getEHFrameSection();
59   }
60
61   const unsigned getFDEEncoding() const {
62     return TLOF->getFDEEncoding();
63   }
64
65   unsigned getDwarfRARegNum(bool isEH) const {
66     return TRI->getDwarfRegNum(TRI->getRARegister(), isEH);
67   }
68
69   const std::vector<MachineMove> &getInitialFrameState() const {
70     return InitialFrameState;
71   }
72
73   int getDwarfRegNum(unsigned RegNum, bool isEH) const {
74     return TRI->getDwarfRegNum(RegNum, isEH);
75   }
76 };
77
78 }
79 #endif