Fix the build by eliminating some more dead code. That'll learn me not to listen...
[oota-llvm.git] / lib / Target / MRegisterInfo.cpp
1 //===- MRegisterInfo.cpp - Target Register Information Implementation -----===//
2 // 
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
7 // 
8 //===----------------------------------------------------------------------===//
9 //
10 // This file implements the MRegisterInfo interface.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #include "llvm/Target/MRegisterInfo.h"
15
16 namespace llvm {
17
18 MRegisterInfo::MRegisterInfo(const MRegisterDesc *D, unsigned NR,
19                              regclass_iterator RCB, regclass_iterator RCE,
20                              int CFSO, int CFDO)
21   : Desc(D), NumRegs(NR), RegClassBegin(RCB), RegClassEnd(RCE) {
22   assert(NumRegs < FirstVirtualRegister &&
23          "Target has too many physical registers!");
24
25   CallFrameSetupOpcode   = CFSO;
26   CallFrameDestroyOpcode = CFDO;
27 }
28
29 std::vector<bool> MRegisterInfo::getAllocatableSet(MachineFunction &MF) const {
30   std::vector<bool> Allocatable(NumRegs);
31   for (MRegisterInfo::regclass_iterator I = regclass_begin(),
32          E = regclass_end(); I != E; ++I) {
33     const TargetRegisterClass *RC = *I;
34     for (TargetRegisterClass::iterator I = RC->allocation_order_begin(MF),
35            E = RC->allocation_order_end(MF); I != E; ++I)
36       Allocatable[*I] = true;
37   }
38   return Allocatable;
39 }  
40
41 } // End llvm namespace