mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 04:02:41 +01:00
[RegisterBankInfo] Inline the destructor to avoid link-time error when GlobalISel is not built.
llvm-svn: 265548
This commit is contained in:
parent
ec02e9ab60
commit
a65e2b8b2f
@ -16,6 +16,7 @@
|
|||||||
#define LLVM_CODEGEN_GLOBALISEL_REGBANKINFO_H
|
#define LLVM_CODEGEN_GLOBALISEL_REGBANKINFO_H
|
||||||
|
|
||||||
#include "llvm/CodeGen/GlobalISel/RegisterBank.h"
|
#include "llvm/CodeGen/GlobalISel/RegisterBank.h"
|
||||||
|
#include "llvm/Support/ErrorHandling.h"
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <memory> // For unique_ptr.
|
#include <memory> // For unique_ptr.
|
||||||
@ -39,7 +40,17 @@ protected:
|
|||||||
/// addRegBankCoverage RegisterBank.
|
/// addRegBankCoverage RegisterBank.
|
||||||
RegisterBankInfo(unsigned NumRegBanks);
|
RegisterBankInfo(unsigned NumRegBanks);
|
||||||
|
|
||||||
virtual ~RegisterBankInfo();
|
/// This constructor is meaningless.
|
||||||
|
/// It just provides a default constructor that can be used at link time
|
||||||
|
/// when GlobalISel is not built.
|
||||||
|
/// That way, targets can still inherit from this class without doing
|
||||||
|
/// crazy gymnastic to avoid link time failures.
|
||||||
|
/// \note That works because the constructor is inlined.
|
||||||
|
RegisterBankInfo() {
|
||||||
|
llvm_unreachable("This constructor should not be executed");
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual ~RegisterBankInfo() {}
|
||||||
|
|
||||||
/// Create a new register bank with the given parameter and add it
|
/// Create a new register bank with the given parameter and add it
|
||||||
/// to RegBanks.
|
/// to RegBanks.
|
||||||
|
@ -27,8 +27,6 @@ RegisterBankInfo::RegisterBankInfo(unsigned NumRegBanks)
|
|||||||
RegBanks.reset(new RegisterBank[NumRegBanks]);
|
RegBanks.reset(new RegisterBank[NumRegBanks]);
|
||||||
}
|
}
|
||||||
|
|
||||||
RegisterBankInfo::~RegisterBankInfo() {}
|
|
||||||
|
|
||||||
void RegisterBankInfo::verify(const TargetRegisterInfo &TRI) const {
|
void RegisterBankInfo::verify(const TargetRegisterInfo &TRI) const {
|
||||||
for (unsigned Idx = 0, End = getNumRegBanks(); Idx != End; ++Idx) {
|
for (unsigned Idx = 0, End = getNumRegBanks(); Idx != End; ++Idx) {
|
||||||
const RegisterBank &RegBank = getRegBank(Idx);
|
const RegisterBank &RegBank = getRegBank(Idx);
|
||||||
|
Loading…
Reference in New Issue
Block a user