From 5659a2f961087728b8da9ff24fbf139ca90330ce Mon Sep 17 00:00:00 2001 From: Alex Lorenz Date: Tue, 11 Aug 2015 23:23:17 +0000 Subject: 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 --- llvm/lib/Target/Mips/MipsMachineFunction.cpp | 55 ++-------------------------- 1 file changed, 4 insertions(+), 51 deletions(-) (limited to 'llvm/lib/Target/Mips/MipsMachineFunction.cpp') 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 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 &E = ExternalCallEntries[Name]; - - if (!E) - E = llvm::make_unique(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 &E = GlobalCallEntries[Val]; - - if (!E) - E = llvm::make_unique(Val); - - return MachinePointerInfo(E.get()); +MachinePointerInfo MipsFunctionInfo::callPtrInfo(const GlobalValue *GV) { + return MachinePointerInfo(MF.getPSVManager().getGlobalValueCallEntry(GV)); } int MipsFunctionInfo::getMoveF64ViaSpillFI(const TargetRegisterClass *RC) { -- cgit v1.2.3