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"
23 template <typename T> class ArrayRef;
26 class MachineFunction;
28 class TargetLoweringObjectFile;
31 std::vector<MachineMove> InitialFrameState;
32 const TargetRegisterInfo *TRI;
33 const TargetFrameLowering *TFI;
34 const TargetLoweringObjectFile *TLOF;
37 explicit TargetAsmInfo(const TargetMachine &TM);
39 const MCSection *getDwarfLineSection() const {
40 return TLOF->getDwarfLineSection();
43 const MCSection *getEHFrameSection() const {
44 return TLOF->getEHFrameSection();
47 const MCSection *getCompactUnwindSection() const {
48 return TLOF->getCompactUnwindSection();
51 const MCSection *getDwarfFrameSection() const {
52 return TLOF->getDwarfFrameSection();
55 const MCSection *getWin64EHFuncTableSection(StringRef Suffix) const {
56 return TLOF->getWin64EHFuncTableSection(Suffix);
59 const MCSection *getWin64EHTableSection(StringRef Suffix) const {
60 return TLOF->getWin64EHTableSection(Suffix);
63 unsigned getFDEEncoding(bool CFI) const {
64 return TLOF->getFDEEncoding(CFI);
67 bool isFunctionEHFrameSymbolPrivate() const {
68 return TLOF->isFunctionEHFrameSymbolPrivate();
71 int getCompactUnwindEncoding(ArrayRef<MCCFIInstruction> Instrs,
72 int DataAlignmentFactor,
74 return TFI->getCompactUnwindEncoding(Instrs, DataAlignmentFactor, IsEH);
77 const unsigned *getCalleeSavedRegs(MachineFunction *MF = 0) const {
78 return TRI->getCalleeSavedRegs(MF);
81 unsigned getDwarfRARegNum(bool isEH) const {
82 return TRI->getDwarfRegNum(TRI->getRARegister(), isEH);
85 const std::vector<MachineMove> &getInitialFrameState() const {
86 return InitialFrameState;
89 int getDwarfRegNum(unsigned RegNum, bool isEH) const {
90 return TRI->getDwarfRegNum(RegNum, isEH);
93 int getLLVMRegNum(unsigned DwarfRegNum, bool isEH) const {
94 return TRI->getLLVMRegNum(DwarfRegNum, isEH);
97 int getSEHRegNum(unsigned RegNum) const {
98 return TRI->getSEHRegNum(RegNum);