LLVM
8.0.1
lib
Target
PowerPC
PPCMachineFunctionInfo.cpp
Go to the documentation of this file.
1
//===-- PPCMachineFunctionInfo.cpp - Private data used for PowerPC --------===//
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
#include "
PPCMachineFunctionInfo.h
"
11
#include "
llvm/ADT/Twine.h
"
12
#include "
llvm/IR/DataLayout.h
"
13
#include "
llvm/MC/MCContext.h
"
14
15
using namespace
llvm
;
16
17
void
PPCFunctionInfo::anchor() {}
18
19
MCSymbol
*
PPCFunctionInfo::getPICOffsetSymbol
()
const
{
20
const
DataLayout
&DL = MF.
getDataLayout
();
21
return
MF.
getContext
().
getOrCreateSymbol
(
Twine
(DL.
getPrivateGlobalPrefix
()) +
22
Twine
(MF.
getFunctionNumber
()) +
23
"$poff"
);
24
}
25
26
MCSymbol
*
PPCFunctionInfo::getGlobalEPSymbol
()
const
{
27
const
DataLayout
&DL = MF.
getDataLayout
();
28
return
MF.
getContext
().
getOrCreateSymbol
(
Twine
(DL.
getPrivateGlobalPrefix
()) +
29
"func_gep"
+
30
Twine
(MF.
getFunctionNumber
()));
31
}
32
33
MCSymbol
*
PPCFunctionInfo::getLocalEPSymbol
()
const
{
34
const
DataLayout
&DL = MF.
getDataLayout
();
35
return
MF.
getContext
().
getOrCreateSymbol
(
Twine
(DL.
getPrivateGlobalPrefix
()) +
36
"func_lep"
+
37
Twine
(MF.
getFunctionNumber
()));
38
}
39
40
MCSymbol
*
PPCFunctionInfo::getTOCOffsetSymbol
()
const
{
41
const
DataLayout
&DL = MF.
getDataLayout
();
42
return
MF.
getContext
().
getOrCreateSymbol
(
Twine
(DL.
getPrivateGlobalPrefix
()) +
43
"func_toc"
+
44
Twine
(MF.
getFunctionNumber
()));
45
}
46
47
bool
PPCFunctionInfo::isLiveInSExt
(
unsigned
VReg)
const
{
48
for
(
const
std::pair<unsigned, ISD::ArgFlagsTy> &LiveIn : LiveInAttrs)
49
if
(LiveIn.first == VReg)
50
return
LiveIn.second.isSExt();
51
return
false
;
52
}
53
54
bool
PPCFunctionInfo::isLiveInZExt
(
unsigned
VReg)
const
{
55
for
(
const
std::pair<unsigned, ISD::ArgFlagsTy> &LiveIn : LiveInAttrs)
56
if
(LiveIn.first == VReg)
57
return
LiveIn.second.isZExt();
58
return
false
;
59
}
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:26
MCContext.h
llvm::MachineFunction::getFunctionNumber
unsigned getFunctionNumber() const
getFunctionNumber - Return a unique ID for the current function.
Definition:
MachineFunction.h:439
llvm
This class represents lattice values for constants.
Definition:
AllocatorList.h:24
llvm::DataLayout::getPrivateGlobalPrefix
StringRef getPrivateGlobalPrefix() const
Definition:
DataLayout.h:294
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition:
MCSymbol.h:42
DataLayout.h
Twine.h
PPCMachineFunctionInfo.h
llvm::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition:
Twine.h:81
llvm::PPCFunctionInfo::getTOCOffsetSymbol
MCSymbol * getTOCOffsetSymbol() const
Definition:
PPCMachineFunctionInfo.cpp:40
llvm::MachineFunction::getDataLayout
const DataLayout & getDataLayout() const
Return the DataLayout attached to the Module associated to this MF.
Definition:
MachineFunction.cpp:257
llvm::MachineFunction::getContext
MCContext & getContext() const
Definition:
MachineFunction.h:425
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:47
llvm::PPCFunctionInfo::getPICOffsetSymbol
MCSymbol * getPICOffsetSymbol() const
Definition:
PPCMachineFunctionInfo.cpp:19
llvm::MCContext::getOrCreateSymbol
MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
Definition:
MCContext.cpp:123
llvm::PPCFunctionInfo::getLocalEPSymbol
MCSymbol * getLocalEPSymbol() const
Definition:
PPCMachineFunctionInfo.cpp:33
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:54
Generated on Sun Dec 20 2020 13:57:44 for LLVM by
1.8.13