aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm/include/llvm/Target/TargetAsmInfo.h
blob: 5a526dcebc9da73cec7e159f122b283f9f98a0c4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
//===-- llvm/Target/TargetAsmInfo.h -----------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// Interface to provide the information necessary for producing assembly files.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_TARGET_TARGETASMINFO_H
#define LLVM_TARGET_TARGETASMINFO_H

#include "llvm/CodeGen/MachineLocation.h"
#include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Target/TargetFrameLowering.h"
#include "llvm/Target/TargetRegisterInfo.h"

namespace llvm {
  template <typename T> class ArrayRef;
  class MCSection;
  class MCContext;
  class MachineFunction;
  class TargetMachine;
  class TargetLoweringObjectFile;

class TargetAsmInfo {
  std::vector<MachineMove> InitialFrameState;
  const TargetRegisterInfo *TRI;
  const TargetFrameLowering *TFI;
  const TargetLoweringObjectFile *TLOF;

public:
  explicit TargetAsmInfo(const TargetMachine &TM);

  const MCSection *getDwarfLineSection() const {
    return TLOF->getDwarfLineSection();
  }

  const MCSection *getEHFrameSection() const {
    return TLOF->getEHFrameSection();
  }

  const MCSection *getCompactUnwindSection() const {
    return TLOF->getCompactUnwindSection();
  }

  const MCSection *getDwarfFrameSection() const {
    return TLOF->getDwarfFrameSection();
  }

  const MCSection *getWin64EHFuncTableSection(StringRef Suffix) const {
    return TLOF->getWin64EHFuncTableSection(Suffix);
  }

  const MCSection *getWin64EHTableSection(StringRef Suffix) const {
    return TLOF->getWin64EHTableSection(Suffix);
  }

  unsigned getFDEEncoding(bool CFI) const {
    return TLOF->getFDEEncoding(CFI);
  }

  bool isFunctionEHFrameSymbolPrivate() const {
    return TLOF->isFunctionEHFrameSymbolPrivate();
  }

  int getCompactUnwindEncoding(ArrayRef<MCCFIInstruction> Instrs,
                               int DataAlignmentFactor,
                               bool IsEH) const {
    return TFI->getCompactUnwindEncoding(Instrs, DataAlignmentFactor, IsEH);
  }

  const unsigned *getCalleeSavedRegs(MachineFunction *MF = 0) const {
    return TRI->getCalleeSavedRegs(MF);
  }

  unsigned getDwarfRARegNum(bool isEH) const {
    return TRI->getDwarfRegNum(TRI->getRARegister(), isEH);
  }

  const std::vector<MachineMove> &getInitialFrameState() const {
    return InitialFrameState;
  }

  int getDwarfRegNum(unsigned RegNum, bool isEH) const {
    return TRI->getDwarfRegNum(RegNum, isEH);
  }

  int getLLVMRegNum(unsigned DwarfRegNum, bool isEH) const {
    return TRI->getLLVMRegNum(DwarfRegNum, isEH);
  }

  int getSEHRegNum(unsigned RegNum) const {
    return TRI->getSEHRegNum(RegNum);
  }
};

}
#endif