Bring this directory into "it actually compiles" land
[oota-llvm.git] / lib / Target / Sparc / SparcRegisterInfo.cpp
1 //===- SparcV8RegisterInfo.cpp - SparcV8 Register Information ---*- C++ -*-===//
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 contains the SparcV8 implementation of the MRegisterInfo class.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #include "SparcV8.h"
15 #include "SparcV8RegisterInfo.h"
16 #include "llvm/Type.h"
17 using namespace llvm;
18
19 SparcV8RegisterInfo::SparcV8RegisterInfo()
20   : SparcV8GenRegisterInfo(V8::ADJCALLSTACKDOWN,
21                            V8::ADJCALLSTACKUP) {}
22
23 int SparcV8RegisterInfo::storeRegToStackSlot(
24   MachineBasicBlock &MBB,
25   MachineBasicBlock::iterator MBBI,
26   unsigned SrcReg, int FrameIdx,
27   const TargetRegisterClass *RC) const
28 {
29   abort();
30   return -1;
31 }
32
33 int SparcV8RegisterInfo::loadRegFromStackSlot(
34   MachineBasicBlock &MBB,
35   MachineBasicBlock::iterator MBBI,
36   unsigned DestReg, int FrameIdx,
37   const TargetRegisterClass *RC) const
38 {
39   abort();
40   return -1;
41 }
42
43 int SparcV8RegisterInfo::copyRegToReg(MachineBasicBlock &MBB,
44                                       MachineBasicBlock::iterator MBBI,
45                                       unsigned DestReg, unsigned SrcReg,
46                                       const TargetRegisterClass *RC) const {
47   abort();
48   return -1;
49 }
50
51 void SparcV8RegisterInfo::
52 eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
53                               MachineBasicBlock::iterator I) const {
54   abort();
55 }
56
57 void
58 SparcV8RegisterInfo::eliminateFrameIndex(MachineFunction &MF,
59                                          MachineBasicBlock::iterator II) const {
60   abort();
61 }
62
63 void SparcV8RegisterInfo::processFunctionBeforeFrameFinalized(
64     MachineFunction &MF) const {
65   abort();
66 }
67
68 void SparcV8RegisterInfo::emitPrologue(MachineFunction &MF) const {
69   abort();
70 }
71
72 void SparcV8RegisterInfo::emitEpilogue(MachineFunction &MF,
73                                        MachineBasicBlock &MBB) const {
74   abort();
75 }
76
77
78 #include "SparcV8GenRegisterInfo.inc"
79
80 const TargetRegisterClass*
81 SparcV8RegisterInfo::getRegClassForType(const Type* Ty) const {
82   switch (Ty->getPrimitiveID()) {
83   case Type::FloatTyID:
84   case Type::DoubleTyID:
85     assert(0 && "Floating point registers not supported yet!");
86   case Type::LongTyID:
87   case Type::ULongTyID: assert(0 && "Long values can't fit in registers!");
88   default:              assert(0 && "Invalid type to getClass!");
89   case Type::BoolTyID:
90   case Type::SByteTyID:
91   case Type::UByteTyID:
92   case Type::ShortTyID:
93   case Type::UShortTyID:
94   case Type::IntTyID:
95   case Type::UIntTyID:
96   case Type::PointerTyID: return &IntRegsInstance;
97   }
98 }
99