1
0
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:
Quentin Colombet 2016-04-06 15:47:17 +00:00
parent ec02e9ab60
commit a65e2b8b2f
2 changed files with 12 additions and 3 deletions

View File

@ -16,6 +16,7 @@
#define LLVM_CODEGEN_GLOBALISEL_REGBANKINFO_H
#include "llvm/CodeGen/GlobalISel/RegisterBank.h"
#include "llvm/Support/ErrorHandling.h"
#include <cassert>
#include <memory> // For unique_ptr.
@ -39,7 +40,17 @@ protected:
/// addRegBankCoverage RegisterBank.
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
/// to RegBanks.

View File

@ -27,8 +27,6 @@ RegisterBankInfo::RegisterBankInfo(unsigned NumRegBanks)
RegBanks.reset(new RegisterBank[NumRegBanks]);
}
RegisterBankInfo::~RegisterBankInfo() {}
void RegisterBankInfo::verify(const TargetRegisterInfo &TRI) const {
for (unsigned Idx = 0, End = getNumRegBanks(); Idx != End; ++Idx) {
const RegisterBank &RegBank = getRegBank(Idx);