1 //===-- llvm/Target/TargetAsmInfo.h -----------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // Interface to provide the information necessary for producing assembly files.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_TARGET_TARGETASMINFO_H
15 #define LLVM_TARGET_TARGETASMINFO_H
17 #include "llvm/CodeGen/MachineLocation.h"
18 #include "llvm/Target/TargetLoweringObjectFile.h"
19 #include "llvm/Target/TargetFrameLowering.h"
20 #include "llvm/Target/TargetRegisterInfo.h"
25 class MachineFunction;
27 class TargetLoweringObjectFile;
32 TargetFrameLowering::StackDirection StackDir;
33 const TargetRegisterInfo *TRI;
34 std::vector<MachineMove> InitialFrameState;
35 const TargetLoweringObjectFile *TLOF;
38 explicit TargetAsmInfo(const TargetMachine &TM);
40 /// getPointerSize - Get the pointer size in bytes.
41 unsigned getPointerSize() const {
45 /// islittleendian - True if the target is little endian.
46 bool isLittleEndian() const {
47 return IsLittleEndian;
50 TargetFrameLowering::StackDirection getStackGrowthDirection() const {
54 const MCSection *getDwarfLineSection() const {
55 return TLOF->getDwarfLineSection();
58 const MCSection *getEHFrameSection() const {
59 return TLOF->getEHFrameSection();
62 const MCSection *getCompactUnwindSection() const {
63 return TLOF->getCompactUnwindSection();
66 const MCSection *getDwarfFrameSection() const {
67 return TLOF->getDwarfFrameSection();
70 const MCSection *getWin64EHFuncTableSection(StringRef Suffix) const {
71 return TLOF->getWin64EHFuncTableSection(Suffix);
74 const MCSection *getWin64EHTableSection(StringRef Suffix) const {
75 return TLOF->getWin64EHTableSection(Suffix);
78 unsigned getFDEEncoding(bool CFI) const {
79 return TLOF->getFDEEncoding(CFI);
82 bool isFunctionEHFrameSymbolPrivate() const {
83 return TLOF->isFunctionEHFrameSymbolPrivate();
86 const unsigned *getCalleeSavedRegs(MachineFunction *MF = 0) const {
87 return TRI->getCalleeSavedRegs(MF);
90 unsigned getDwarfRARegNum(bool isEH) const {
91 return TRI->getDwarfRegNum(TRI->getRARegister(), isEH);
94 const std::vector<MachineMove> &getInitialFrameState() const {
95 return InitialFrameState;
98 int getDwarfRegNum(unsigned RegNum, bool isEH) const {
99 return TRI->getDwarfRegNum(RegNum, isEH);
102 int getLLVMRegNum(unsigned DwarfRegNum, bool isEH) const {
103 return TRI->getLLVMRegNum(DwarfRegNum, isEH);
106 int getSEHRegNum(unsigned RegNum) const {
107 return TRI->getSEHRegNum(RegNum);