Skip to content

Commit e41da79

Browse files
authored
[CodeGen] Make TargetRegisterInfo destructor public (NFC) (#157341)
All in-tree targets store target-specific TRI in target-specific Subtarget/InstrInfo class by value, but some downstream targets may prefer to store it as `std::unique_ptr<const TargetRegisterInfo>` (to avoid inclusion of MyTargetRegisterInfo.h in MySubtarget.h). Making the destructor public makes this possible, and also follows general C++ guidelines (the destructor should be either public virtual or protected non-virtual). All other related classes already have their destructors public.
1 parent 645dd32 commit e41da79

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/include/llvm/CodeGen/TargetRegisterInfo.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,10 @@ class LLVM_ABI TargetRegisterInfo : public MCRegisterInfo {
273273
const RegClassInfo *const RCIs,
274274
const MVT::SimpleValueType *const RCVTLists,
275275
unsigned Mode = 0);
276-
virtual ~TargetRegisterInfo();
277276

278277
public:
278+
virtual ~TargetRegisterInfo();
279+
279280
/// Return the number of registers for the function. (may overestimate)
280281
virtual unsigned getNumSupportedRegs(const MachineFunction &) const {
281282
return getNumRegs();

0 commit comments

Comments
 (0)