Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.cpp
Line
Count
Source (jump to first uncovered line)
1
//===-- PPCMachineFunctionInfo.cpp - Private data used for PowerPC --------===//
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
#include "PPCMachineFunctionInfo.h"
10
#include "llvm/ADT/Twine.h"
11
#include "llvm/IR/DataLayout.h"
12
#include "llvm/MC/MCContext.h"
13
14
using namespace llvm;
15
16
0
void PPCFunctionInfo::anchor() {}
17
18
24
MCSymbol *PPCFunctionInfo::getPICOffsetSymbol() const {
19
24
  const DataLayout &DL = MF.getDataLayout();
20
24
  return MF.getContext().getOrCreateSymbol(Twine(DL.getPrivateGlobalPrefix()) +
21
24
                                           Twine(MF.getFunctionNumber()) +
22
24
                                           "$poff");
23
24
}
24
25
1.54k
MCSymbol *PPCFunctionInfo::getGlobalEPSymbol() const {
26
1.54k
  const DataLayout &DL = MF.getDataLayout();
27
1.54k
  return MF.getContext().getOrCreateSymbol(Twine(DL.getPrivateGlobalPrefix()) +
28
1.54k
                                           "func_gep" +
29
1.54k
                                           Twine(MF.getFunctionNumber()));
30
1.54k
}
31
32
1.54k
MCSymbol *PPCFunctionInfo::getLocalEPSymbol() const {
33
1.54k
  const DataLayout &DL = MF.getDataLayout();
34
1.54k
  return MF.getContext().getOrCreateSymbol(Twine(DL.getPrivateGlobalPrefix()) +
35
1.54k
                                           "func_lep" +
36
1.54k
                                           Twine(MF.getFunctionNumber()));
37
1.54k
}
38
39
8
MCSymbol *PPCFunctionInfo::getTOCOffsetSymbol() const {
40
8
  const DataLayout &DL = MF.getDataLayout();
41
8
  return MF.getContext().getOrCreateSymbol(Twine(DL.getPrivateGlobalPrefix()) +
42
8
                                           "func_toc" +
43
8
                                           Twine(MF.getFunctionNumber()));
44
8
}
45
46
317
bool PPCFunctionInfo::isLiveInSExt(unsigned VReg) const {
47
317
  for (const std::pair<unsigned, ISD::ArgFlagsTy> &LiveIn : LiveInAttrs)
48
589
    if (LiveIn.first == VReg)
49
317
      return LiveIn.second.isSExt();
50
317
  
return false0
;
51
317
}
52
53
183
bool PPCFunctionInfo::isLiveInZExt(unsigned VReg) const {
54
183
  for (const std::pair<unsigned, ISD::ArgFlagsTy> &LiveIn : LiveInAttrs)
55
282
    if (LiveIn.first == VReg)
56
183
      return LiveIn.second.isZExt();
57
183
  
return false0
;
58
183
}