mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-20 16:17:38 +00:00
[Mips] Use unique_ptr to manage ownership.
Required some tweaking of ValueMap to accommodate a move-only value type. No functional change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235091 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -60,15 +60,7 @@ void MipsCallEntry::printCustom(raw_ostream &O) const {
|
||||
#endif
|
||||
}
|
||||
|
||||
MipsFunctionInfo::~MipsFunctionInfo() {
|
||||
for (StringMap<const MipsCallEntry *>::iterator
|
||||
I = ExternalCallEntries.begin(), E = ExternalCallEntries.end(); I != E;
|
||||
++I)
|
||||
delete I->getValue();
|
||||
|
||||
for (const auto &Entry : GlobalCallEntries)
|
||||
delete Entry.second;
|
||||
}
|
||||
MipsFunctionInfo::~MipsFunctionInfo() {}
|
||||
|
||||
bool MipsFunctionInfo::globalBaseRegSet() const {
|
||||
return GlobalBaseReg;
|
||||
@@ -125,21 +117,21 @@ bool MipsFunctionInfo::isEhDataRegFI(int FI) const {
|
||||
}
|
||||
|
||||
MachinePointerInfo MipsFunctionInfo::callPtrInfo(StringRef Name) {
|
||||
const MipsCallEntry *&E = ExternalCallEntries[Name];
|
||||
std::unique_ptr<const MipsCallEntry> &E = ExternalCallEntries[Name];
|
||||
|
||||
if (!E)
|
||||
E = new MipsCallEntry(Name);
|
||||
E = llvm::make_unique<MipsCallEntry>(Name);
|
||||
|
||||
return MachinePointerInfo(E);
|
||||
return MachinePointerInfo(E.get());
|
||||
}
|
||||
|
||||
MachinePointerInfo MipsFunctionInfo::callPtrInfo(const GlobalValue *Val) {
|
||||
const MipsCallEntry *&E = GlobalCallEntries[Val];
|
||||
std::unique_ptr<const MipsCallEntry> &E = GlobalCallEntries[Val];
|
||||
|
||||
if (!E)
|
||||
E = new MipsCallEntry(Val);
|
||||
E = llvm::make_unique<MipsCallEntry>(Val);
|
||||
|
||||
return MachinePointerInfo(E);
|
||||
return MachinePointerInfo(E.get());
|
||||
}
|
||||
|
||||
int MipsFunctionInfo::getMoveF64ViaSpillFI(const TargetRegisterClass *RC) {
|
||||
|
||||
Reference in New Issue
Block a user