Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/lib/Target/XCore/XCoreMachineFunctionInfo.h
Line
Count
Source (jump to first uncovered line)
1
//===- XCoreMachineFunctionInfo.h - XCore machine function info -*- C++ -*-===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
//
9
// This file declares XCore-specific per-machine-function information.
10
//
11
//===----------------------------------------------------------------------===//
12
13
#ifndef LLVM_LIB_TARGET_XCORE_XCOREMACHINEFUNCTIONINFO_H
14
#define LLVM_LIB_TARGET_XCORE_XCOREMACHINEFUNCTIONINFO_H
15
16
#include "llvm/CodeGen/MachineBasicBlock.h"
17
#include "llvm/CodeGen/MachineFrameInfo.h"
18
#include "llvm/CodeGen/MachineFunction.h"
19
#include <cassert>
20
#include <utility>
21
#include <vector>
22
23
namespace llvm {
24
25
/// XCoreFunctionInfo - This class is derived from MachineFunction private
26
/// XCore target-specific information for each MachineFunction.
27
class XCoreFunctionInfo : public MachineFunctionInfo {
28
  bool LRSpillSlotSet = false;
29
  int LRSpillSlot;
30
  bool FPSpillSlotSet = false;
31
  int FPSpillSlot;
32
  bool EHSpillSlotSet = false;
33
  int EHSpillSlot[2];
34
  unsigned ReturnStackOffset;
35
  bool ReturnStackOffsetSet = false;
36
  int VarArgsFrameIndex = 0;
37
  mutable int CachedEStackSize = -1;
38
  std::vector<std::pair<MachineBasicBlock::iterator, CalleeSavedInfo>>
39
  SpillLabels;
40
41
  virtual void anchor();
42
43
public:
44
  XCoreFunctionInfo() = default;
45
46
280
  explicit XCoreFunctionInfo(MachineFunction &MF) {}
47
48
278
  ~XCoreFunctionInfo() override = default;
49
50
4
  void setVarArgsFrameIndex(int off) { VarArgsFrameIndex = off; }
51
1
  int getVarArgsFrameIndex() const { return VarArgsFrameIndex; }
52
53
  int createLRSpillSlot(MachineFunction &MF);
54
589
  bool hasLRSpillSlot() { return LRSpillSlotSet; }
55
164
  int getLRSpillSlot() const {
56
164
    assert(LRSpillSlotSet && "LR Spill slot not set");
57
164
    return LRSpillSlot;
58
164
  }
59
60
  int createFPSpillSlot(MachineFunction &MF);
61
0
  bool hasFPSpillSlot() { return FPSpillSlotSet; }
62
74
  int getFPSpillSlot() const {
63
74
    assert(FPSpillSlotSet && "FP Spill slot not set");
64
74
    return FPSpillSlot;
65
74
  }
66
67
  const int* createEHSpillSlot(MachineFunction &MF);
68
162
  bool hasEHSpillSlot() { return EHSpillSlotSet; }
69
20
  const int* getEHSpillSlot() const {
70
20
    assert(EHSpillSlotSet && "EH Spill slot not set");
71
20
    return EHSpillSlot;
72
20
  }
73
74
276
  void setReturnStackOffset(unsigned value) {
75
276
    assert(!ReturnStackOffsetSet && "Return stack offset set twice");
76
276
    ReturnStackOffset = value;
77
276
    ReturnStackOffsetSet = true;
78
276
  }
79
80
308
  unsigned getReturnStackOffset() const {
81
308
    assert(ReturnStackOffsetSet && "Return stack offset not set");
82
308
    return ReturnStackOffset;
83
308
  }
84
85
  bool isLargeFrame(const MachineFunction &MF) const;
86
87
  std::vector<std::pair<MachineBasicBlock::iterator, CalleeSavedInfo>> &
88
214
  getSpillLabels() {
89
214
    return SpillLabels;
90
214
  }
91
};
92
93
} // end namespace llvm
94
95
#endif // LLVM_LIB_TARGET_XCORE_XCOREMACHINEFUNCTIONINFO_H