LLVM
10.0.0
lib
Target
PowerPC
PPCMachineFunctionInfo.cpp
Go to the documentation of this file.
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
void
PPCFunctionInfo::anchor() {}
17
18
MCSymbol
*
PPCFunctionInfo::getPICOffsetSymbol
()
const
{
19
const
DataLayout
&DL = MF.
getDataLayout
();
20
return
MF.
getContext
().
getOrCreateSymbol
(
Twine
(DL.
getPrivateGlobalPrefix
()) +
21
Twine
(MF.
getFunctionNumber
()) +
22
"$poff"
);
23
}
24
25
MCSymbol
*
PPCFunctionInfo::getGlobalEPSymbol
()
const
{
26
const
DataLayout
&DL = MF.
getDataLayout
();
27
return
MF.
getContext
().
getOrCreateSymbol
(
Twine
(DL.
getPrivateGlobalPrefix
()) +
28
"func_gep"
+
29
Twine
(MF.
getFunctionNumber
()));
30
}
31
32
MCSymbol
*
PPCFunctionInfo::getLocalEPSymbol
()
const
{
33
const
DataLayout
&DL = MF.
getDataLayout
();
34
return
MF.
getContext
().
getOrCreateSymbol
(
Twine
(DL.
getPrivateGlobalPrefix
()) +
35
"func_lep"
+
36
Twine
(MF.
getFunctionNumber
()));
37
}
38
39
MCSymbol
*
PPCFunctionInfo::getTOCOffsetSymbol
()
const
{
40
const
DataLayout
&DL = MF.
getDataLayout
();
41
return
MF.
getContext
().
getOrCreateSymbol
(
Twine
(DL.
getPrivateGlobalPrefix
()) +
42
"func_toc"
+
43
Twine
(MF.
getFunctionNumber
()));
44
}
45
46
bool
PPCFunctionInfo::isLiveInSExt
(
unsigned
VReg)
const
{
47
for
(
const
std::pair<unsigned, ISD::ArgFlagsTy> &LiveIn : LiveInAttrs)
48
if
(LiveIn.first == VReg)
49
return
LiveIn.second.isSExt();
50
return
false
;
51
}
52
53
bool
PPCFunctionInfo::isLiveInZExt
(
unsigned
VReg)
const
{
54
for
(
const
std::pair<unsigned, ISD::ArgFlagsTy> &LiveIn : LiveInAttrs)
55
if
(LiveIn.first == VReg)
56
return
LiveIn.second.isZExt();
57
return
false
;
58
}
llvm::DataLayout
A parsed version of the target data layout string in and methods for querying it. ...
Definition:
DataLayout.h:111
llvm::PPCFunctionInfo::getGlobalEPSymbol
MCSymbol * getGlobalEPSymbol() const
Definition:
PPCMachineFunctionInfo.cpp:25
MCContext.h
llvm::MachineFunction::getFunctionNumber
unsigned getFunctionNumber() const
getFunctionNumber - Return a unique ID for the current function.
Definition:
MachineFunction.h:462
llvm
This class represents lattice values for constants.
Definition:
AllocatorList.h:23
llvm::DataLayout::getPrivateGlobalPrefix
StringRef getPrivateGlobalPrefix() const
Definition:
DataLayout.h:320
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition:
MCSymbol.h:41
DataLayout.h
Twine.h
PPCMachineFunctionInfo.h
llvm::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition:
Twine.h:80
llvm::PPCFunctionInfo::getTOCOffsetSymbol
MCSymbol * getTOCOffsetSymbol() const
Definition:
PPCMachineFunctionInfo.cpp:39
llvm::MachineFunction::getDataLayout
const DataLayout & getDataLayout() const
Return the DataLayout attached to the Module associated to this MF.
Definition:
MachineFunction.cpp:258
llvm::MachineFunction::getContext
MCContext & getContext() const
Definition:
MachineFunction.h:448
llvm::PPCFunctionInfo::isLiveInSExt
bool isLiveInSExt(unsigned VReg) const
This function returns true if the specified vreg is a live-in register and sign-extended.
Definition:
PPCMachineFunctionInfo.cpp:46
llvm::PPCFunctionInfo::getPICOffsetSymbol
MCSymbol * getPICOffsetSymbol() const
Definition:
PPCMachineFunctionInfo.cpp:18
llvm::MCContext::getOrCreateSymbol
MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
Definition:
MCContext.cpp:130
llvm::PPCFunctionInfo::getLocalEPSymbol
MCSymbol * getLocalEPSymbol() const
Definition:
PPCMachineFunctionInfo.cpp:32
llvm::PPCFunctionInfo::isLiveInZExt
bool isLiveInZExt(unsigned VReg) const
This function returns true if the specified vreg is a live-in register and zero-extended.
Definition:
PPCMachineFunctionInfo.cpp:53
Generated on Tue Mar 24 2020 13:12:42 for LLVM by
1.8.13