Coverage Report

Created: 2017-10-03 07:32

/Users/buildslave/jenkins/sharedspace/clang-stage2-coverage-R@2/llvm/lib/Target/Mips/MipsMachineFunction.h
Line
Count
Source
1
//===- MipsMachineFunctionInfo.h - Private data used for Mips ---*- 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
// This file declares the Mips specific subclass of MachineFunctionInfo.
11
//
12
//===----------------------------------------------------------------------===//
13
14
#ifndef LLVM_LIB_TARGET_MIPS_MIPSMACHINEFUNCTION_H
15
#define LLVM_LIB_TARGET_MIPS_MIPSMACHINEFUNCTION_H
16
17
#include "Mips16HardFloatInfo.h"
18
#include "llvm/CodeGen/MachineFunction.h"
19
#include "llvm/CodeGen/MachineMemOperand.h"
20
#include <map>
21
22
namespace llvm {
23
24
/// MipsFunctionInfo - This class is derived from MachineFunction private
25
/// Mips target-specific information for each MachineFunction.
26
class MipsFunctionInfo : public MachineFunctionInfo {
27
public:
28
12.3k
  MipsFunctionInfo(MachineFunction &MF) : MF(MF) {}
29
30
  ~MipsFunctionInfo() override;
31
32
56
  unsigned getSRetReturnReg() const { return SRetReturnReg; }
33
47
  void setSRetReturnReg(unsigned Reg) { SRetReturnReg = Reg; }
34
35
  bool globalBaseRegSet() const;
36
  unsigned getGlobalBaseReg();
37
38
76
  int getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
39
12.1k
  void setVarArgsFrameIndex(int Index) { VarArgsFrameIndex = Index; }
40
41
297
  bool hasByvalArg() const { return HasByvalArg; }
42
12.3k
  void setFormalArgInfo(unsigned Size, bool HasByval) {
43
12.3k
    IncomingArgSize = Size;
44
12.3k
    HasByvalArg = HasByval;
45
12.3k
  }
46
47
12.2k
  unsigned getIncomingArgSize() const { return IncomingArgSize; }
48
49
26.1k
  bool callsEhReturn() const { return CallsEhReturn; }
50
14
  void setCallsEhReturn() { CallsEhReturn = true; }
51
52
  void createEhDataRegsFI();
53
168
  int getEhDataRegFI(unsigned Reg) const { return EhDataRegFI[Reg]; }
54
  bool isEhDataRegFI(int FI) const;
55
56
  /// Create a MachinePointerInfo that has an ExternalSymbolPseudoSourceValue
57
  /// object representing a GOT entry for an external function.
58
  MachinePointerInfo callPtrInfo(const char *ES);
59
60
  // Functions with the "interrupt" attribute require special prologues,
61
  // epilogues and additional spill slots.
62
12.2k
  bool isISR() const { return IsISR; }
63
11
  void setISR() { IsISR = true; }
64
  void createISRRegFI();
65
36
  int getISRRegFI(unsigned Reg) const { return ISRDataRegFI[Reg]; }
66
  bool isISRRegFI(int FI) const;
67
68
  /// Create a MachinePointerInfo that has a GlobalValuePseudoSourceValue object
69
  /// representing a GOT entry for a global function.
70
  MachinePointerInfo callPtrInfo(const GlobalValue *GV);
71
72
100
  void setSaveS2() { SaveS2 = true; }
73
1.37k
  bool hasSaveS2() const { return SaveS2; }
74
75
  int getMoveF64ViaSpillFI(const TargetRegisterClass *RC);
76
77
  std::map<const char *, const Mips16HardFloatInfo::FuncSignature *>
78
  StubsNeeded;
79
80
private:
81
  virtual void anchor();
82
83
  MachineFunction& MF;
84
85
  /// SRetReturnReg - Some subtargets require that sret lowering includes
86
  /// returning the value of the returned struct in a register. This field
87
  /// holds the virtual register into which the sret argument is passed.
88
  unsigned SRetReturnReg = 0;
89
90
  /// GlobalBaseReg - keeps track of the virtual register initialized for
91
  /// use as the global base register. This is used for PIC in some PIC
92
  /// relocation models.
93
  unsigned GlobalBaseReg = 0;
94
95
  /// VarArgsFrameIndex - FrameIndex for start of varargs area.
96
  int VarArgsFrameIndex = 0;
97
98
  /// True if function has a byval argument.
99
  bool HasByvalArg;
100
101
  /// Size of incoming argument area.
102
  unsigned IncomingArgSize;
103
104
  /// CallsEhReturn - Whether the function calls llvm.eh.return.
105
  bool CallsEhReturn = false;
106
107
  /// Frame objects for spilling eh data registers.
108
  int EhDataRegFI[4];
109
110
  /// ISR - Whether the function is an Interrupt Service Routine.
111
  bool IsISR = false;
112
113
  /// Frame objects for spilling C0_STATUS, C0_EPC
114
  int ISRDataRegFI[2];
115
116
  // saveS2
117
  bool SaveS2 = false;
118
119
  /// FrameIndex for expanding BuildPairF64 nodes to spill and reload when the
120
  /// O32 FPXX ABI is enabled. -1 is used to denote invalid index.
121
  int MoveF64ViaSpillFI = -1;
122
};
123
124
} // end namespace llvm
125
126
#endif // LLVM_LIB_TARGET_MIPS_MIPSMACHINEFUNCTION_H