1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-29 23:12:55 +01:00
llvm-mirror/lib/Target/MRegisterInfo.cpp

44 lines
1.5 KiB
C++
Raw Normal View History

2002-12-17 05:03:08 +01:00
//===- MRegisterInfo.cpp - Target Register Information Implementation -----===//
//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
2002-12-17 05:03:08 +01:00
//
// This file implements the MRegisterInfo interface.
//
//===----------------------------------------------------------------------===//
#include "llvm/Target/MRegisterInfo.h"
namespace llvm {
2002-12-17 05:03:08 +01:00
MRegisterInfo::MRegisterInfo(const MRegisterDesc *D, unsigned NR,
regclass_iterator RCB, regclass_iterator RCE,
int CFSO, int CFDO)
2002-12-17 05:03:08 +01:00
: Desc(D), NumRegs(NR), RegClassBegin(RCB), RegClassEnd(RCE) {
assert(NumRegs < FirstVirtualRegister &&
"Target has too many physical registers!");
CallFrameSetupOpcode = CFSO;
CallFrameDestroyOpcode = CFDO;
2002-12-17 05:03:08 +01:00
}
MRegisterInfo::~MRegisterInfo() {}
std::vector<bool> MRegisterInfo::getAllocatableSet(MachineFunction &MF) const {
std::vector<bool> Allocatable(NumRegs);
for (MRegisterInfo::regclass_iterator I = regclass_begin(),
E = regclass_end(); I != E; ++I) {
const TargetRegisterClass *RC = *I;
for (TargetRegisterClass::iterator I = RC->allocation_order_begin(MF),
E = RC->allocation_order_end(MF); I != E; ++I)
Allocatable[*I] = true;
}
return Allocatable;
}
} // End llvm namespace