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 std::vector<MachineMove> InitialFrameState;
34 const TargetRegisterInfo *TRI;
35 const TargetFrameLowering *TFI;
36 const TargetLoweringObjectFile *TLOF;
39 explicit TargetAsmInfo(const TargetMachine &TM);
41 /// getPointerSize - Get the pointer size in bytes.
42 unsigned getPointerSize() const {
46 /// islittleendian - True if the target is little endian.
47 bool isLittleEndian() const {
48 return IsLittleEndian;
51 TargetFrameLowering::StackDirection getStackGrowthDirection() const {
55 const MCSection *getDwarfLineSection() const {
56 return TLOF->getDwarfLineSection();
59 const MCSection *getEHFrameSection() const {
60 return TLOF->getEHFrameSection();
63 const MCSection *getCompactUnwindSection() const {
64 return TLOF->getCompactUnwindSection();
67 const MCSection *getDwarfFrameSection() const {
68 return TLOF->getDwarfFrameSection();
71 const MCSection *getWin64EHFuncTableSection(StringRef Suffix) const {
72 return TLOF->getWin64EHFuncTableSection(Suffix);
75 const MCSection *getWin64EHTableSection(StringRef Suffix) const {
76 return TLOF->getWin64EHTableSection(Suffix);
79 unsigned getFDEEncoding(bool CFI) const {
80 return TLOF->getFDEEncoding(CFI);
83 bool isFunctionEHFrameSymbolPrivate() const {
84 return TLOF->isFunctionEHFrameSymbolPrivate();
87 int getCompactUnwindEncoding(const std::vector<MCCFIInstruction> &Instrs,
88 int DataAlignmentFactor, bool IsEH) const {
89 return TFI->getCompactUnwindEncoding(Instrs, DataAlignmentFactor, IsEH);
92 const unsigned *getCalleeSavedRegs(MachineFunction *MF = 0) const {
93 return TRI->getCalleeSavedRegs(MF);
96 unsigned getDwarfRARegNum(bool isEH) const {
97 return TRI->getDwarfRegNum(TRI->getRARegister(), isEH);
100 const std::vector<MachineMove> &getInitialFrameState() const {
101 return InitialFrameState;
104 int getDwarfRegNum(unsigned RegNum, bool isEH) const {
105 return TRI->getDwarfRegNum(RegNum, isEH);
108 int getLLVMRegNum(unsigned DwarfRegNum, bool isEH) const {
109 return TRI->getLLVMRegNum(DwarfRegNum, isEH);
112 int getSEHRegNum(unsigned RegNum) const {
113 return TRI->getSEHRegNum(RegNum);