summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Mips/MipsMachineFunction.cpp
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2015-08-11 23:23:17 +0000
committerAlex Lorenz <arphaman@gmail.com>2015-08-11 23:23:17 +0000
commit5659a2f961087728b8da9ff24fbf139ca90330ce (patch)
tree84ab4735889285ba922a5c1799c62c65cc7a9103 /llvm/lib/Target/Mips/MipsMachineFunction.cpp
parent52a0f1e8c6f01a37be5b5e868eee8c0ff2958be0 (diff)
downloadbcm5719-llvm-5659a2f961087728b8da9ff24fbf139ca90330ce.tar.gz
bcm5719-llvm-5659a2f961087728b8da9ff24fbf139ca90330ce.zip
PseudoSourceValue: Transform the mips subclass to target independent subclasses
This commit transforms the mips-specific 'MipsCallEntry' subclass of the 'PseudoSourceValue' class into two, target-independent subclasses named 'GlobalValuePseudoSourceValue' and 'ExternalSymbolPseudoSourceValue'. This change makes it easier to serialize the pseudo source values by removing target-specific pseudo source values. Reviewers: Akira Hatanaka llvm-svn: 244698
Diffstat (limited to 'llvm/lib/Target/Mips/MipsMachineFunction.cpp')
-rw-r--r--llvm/lib/Target/Mips/MipsMachineFunction.cpp55
1 files changed, 4 insertions, 51 deletions
diff --git a/llvm/lib/Target/Mips/MipsMachineFunction.cpp b/llvm/lib/Target/Mips/MipsMachineFunction.cpp
index ebc5ac0486c..839760cc8a4 100644
--- a/llvm/lib/Target/Mips/MipsMachineFunction.cpp
+++ b/llvm/lib/Target/Mips/MipsMachineFunction.cpp
@@ -24,43 +24,6 @@ static cl::opt<bool>
FixGlobalBaseReg("mips-fix-global-base-reg", cl::Hidden, cl::init(true),
cl::desc("Always use $gp as the global base register."));
-// class MipsCallEntry.
-MipsCallEntry::MipsCallEntry(StringRef N) : PseudoSourceValue(MipsPSV) {
-#ifndef NDEBUG
- Name = N;
- Val = nullptr;
-#endif
-}
-
-MipsCallEntry::MipsCallEntry(const GlobalValue *V)
- : PseudoSourceValue(MipsPSV) {
-#ifndef NDEBUG
- Val = V;
-#endif
-}
-
-bool MipsCallEntry::isConstant(const MachineFrameInfo *) const {
- return false;
-}
-
-bool MipsCallEntry::isAliased(const MachineFrameInfo *) const {
- return false;
-}
-
-bool MipsCallEntry::mayAlias(const MachineFrameInfo *) const {
- return false;
-}
-
-void MipsCallEntry::printCustom(raw_ostream &O) const {
- O << "MipsCallEntry: ";
-#ifndef NDEBUG
- if (Val)
- O << Val->getName();
- else
- O << Name;
-#endif
-}
-
MipsFunctionInfo::~MipsFunctionInfo() {}
bool MipsFunctionInfo::globalBaseRegSet() const {
@@ -117,22 +80,12 @@ bool MipsFunctionInfo::isEhDataRegFI(int FI) const {
|| FI == EhDataRegFI[2] || FI == EhDataRegFI[3]);
}
-MachinePointerInfo MipsFunctionInfo::callPtrInfo(StringRef Name) {
- std::unique_ptr<const MipsCallEntry> &E = ExternalCallEntries[Name];
-
- if (!E)
- E = llvm::make_unique<MipsCallEntry>(Name);
-
- return MachinePointerInfo(E.get());
+MachinePointerInfo MipsFunctionInfo::callPtrInfo(const char *ES) {
+ return MachinePointerInfo(MF.getPSVManager().getExternalSymbolCallEntry(ES));
}
-MachinePointerInfo MipsFunctionInfo::callPtrInfo(const GlobalValue *Val) {
- std::unique_ptr<const MipsCallEntry> &E = GlobalCallEntries[Val];
-
- if (!E)
- E = llvm::make_unique<MipsCallEntry>(Val);
-
- return MachinePointerInfo(E.get());
+MachinePointerInfo MipsFunctionInfo::callPtrInfo(const GlobalValue *GV) {
+ return MachinePointerInfo(MF.getPSVManager().getGlobalValueCallEntry(GV));
}
int MipsFunctionInfo::getMoveF64ViaSpillFI(const TargetRegisterClass *RC) {
OpenPOWER on IntegriCloud