summaryrefslogtreecommitdiff
path: root/llvm/lib/Target/SystemZ/SystemZSubtarget.h
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/SystemZ/SystemZSubtarget.h')
-rw-r--r--llvm/lib/Target/SystemZ/SystemZSubtarget.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/llvm/lib/Target/SystemZ/SystemZSubtarget.h b/llvm/lib/Target/SystemZ/SystemZSubtarget.h
index f6c155de44a0..67c5b8eb09b6 100644
--- a/llvm/lib/Target/SystemZ/SystemZSubtarget.h
+++ b/llvm/lib/Target/SystemZ/SystemZSubtarget.h
@@ -77,11 +77,11 @@ protected:
private:
Triple TargetTriple;
- SystemZCallingConventionRegisters *SpecialRegisters;
+ std::unique_ptr<SystemZCallingConventionRegisters> SpecialRegisters;
SystemZInstrInfo InstrInfo;
SystemZTargetLowering TLInfo;
SystemZSelectionDAGInfo TSInfo;
- SystemZFrameLowering FrameLowering;
+ std::unique_ptr<const SystemZFrameLowering> FrameLowering;
SystemZSubtarget &initializeSubtargetDependencies(StringRef CPU,
StringRef FS);
@@ -91,16 +91,23 @@ public:
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();
+ }
+
+ template <class SR> SR &getSpecialRegisters() const {
+ return *static_cast<SR *>(getSpecialRegisters());
}
const TargetFrameLowering *getFrameLowering() const override {
- return &FrameLowering;
+ return FrameLowering.get();
}
+
+ template <class TFL> const TFL *getFrameLowering() const {
+ return static_cast<const TFL *>(getFrameLowering());
+ }
+
const SystemZInstrInfo *getInstrInfo() const override { return &InstrInfo; }
const SystemZRegisterInfo *getRegisterInfo() const override {
return &InstrInfo.getRegisterInfo();