Move getInitialFrameState from TargetFrameInfo to MCAsmInfo (suggestions for
[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/Target/TargetLoweringObjectFile.h"
18 #include "llvm/Target/TargetFrameLowering.h"
19 #include "llvm/Target/TargetRegisterInfo.h"
20
21 namespace llvm {
22   template <typename T> class ArrayRef;
23   class MCSection;
24   class TargetMachine;
25   class TargetLoweringObjectFile;
26
27 class TargetAsmInfo {
28   const TargetFrameLowering *TFI;
29   const TargetLoweringObjectFile *TLOF;
30
31 public:
32   explicit TargetAsmInfo(const TargetMachine &TM);
33
34   const MCSection *getDwarfLineSection() const {
35     return TLOF->getDwarfLineSection();
36   }
37
38   const MCSection *getEHFrameSection() const {
39     return TLOF->getEHFrameSection();
40   }
41
42   const MCSection *getCompactUnwindSection() const {
43     return TLOF->getCompactUnwindSection();
44   }
45
46   const MCSection *getDwarfFrameSection() const {
47     return TLOF->getDwarfFrameSection();
48   }
49
50   const MCSection *getWin64EHFuncTableSection(StringRef Suffix) const {
51     return TLOF->getWin64EHFuncTableSection(Suffix);
52   }
53
54   const MCSection *getWin64EHTableSection(StringRef Suffix) const {
55     return TLOF->getWin64EHTableSection(Suffix);
56   }
57
58   unsigned getFDEEncoding(bool CFI) const {
59     return TLOF->getFDEEncoding(CFI);
60   }
61
62   bool isFunctionEHFrameSymbolPrivate() const {
63     return TLOF->isFunctionEHFrameSymbolPrivate();
64   }
65
66   int getCompactUnwindEncoding(ArrayRef<MCCFIInstruction> Instrs,
67                                int DataAlignmentFactor,
68                                bool IsEH) const {
69     return TFI->getCompactUnwindEncoding(Instrs, DataAlignmentFactor, IsEH);
70   }
71 };
72
73 }
74 #endif