[PATCH] D108639: [SystemZ] [NFC] Replace SpecialRegisters field with a unique_ptr instead of a raw pointer.
Fanbo Meng via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 25 08:28:37 PDT 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rG6b94777be511: [SystemZ] [NFC] Replace SpecialRegisters field with a unique_ptr instead of a… (authored by Everybody0523, committed by fanbo-meng).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D108639/new/
https://reviews.llvm.org/D108639
Files:
llvm/lib/Target/SystemZ/SystemZSubtarget.cpp
llvm/lib/Target/SystemZ/SystemZSubtarget.h
Index: llvm/lib/Target/SystemZ/SystemZSubtarget.h
===================================================================
--- llvm/lib/Target/SystemZ/SystemZSubtarget.h
+++ llvm/lib/Target/SystemZ/SystemZSubtarget.h
@@ -77,7 +77,7 @@
private:
Triple TargetTriple;
- SystemZCallingConventionRegisters *SpecialRegisters;
+ std::unique_ptr<SystemZCallingConventionRegisters> SpecialRegisters;
SystemZInstrInfo InstrInfo;
SystemZTargetLowering TLInfo;
SystemZSelectionDAGInfo TSInfo;
@@ -91,11 +91,9 @@
SystemZSubtarget(const Triple &TT, const std::string &CPU,
const std::string &FS, const TargetMachine &TM);
- ~SystemZSubtarget();
-
SystemZCallingConventionRegisters *getSpecialRegisters() const {
assert(SpecialRegisters && "Unsupported SystemZ calling convention");
- return SpecialRegisters;
+ return SpecialRegisters.get();
}
const TargetFrameLowering *getFrameLowering() const override {
Index: llvm/lib/Target/SystemZ/SystemZSubtarget.cpp
===================================================================
--- llvm/lib/Target/SystemZ/SystemZSubtarget.cpp
+++ llvm/lib/Target/SystemZ/SystemZSubtarget.cpp
@@ -91,8 +91,6 @@
InstrInfo(initializeSubtargetDependencies(CPU, FS)), TLInfo(TM, *this),
TSInfo(), FrameLowering() {}
-SystemZSubtarget::~SystemZSubtarget() { delete getSpecialRegisters(); }
-
bool SystemZSubtarget::enableSubRegLiveness() const {
return UseSubRegLiveness;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108639.368651.patch
Type: text/x-patch
Size: 1468 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210825/4851cf62/attachment.bin>
More information about the llvm-commits
mailing list